Suggestion for Zoom functionalitity

Apr 4, 2009 at 4:58 PM
Hi

This is a great control. I like it. I have a suggestion for it.

After zoom level goes beyond 17, can it use map (or graphics) file downloaded (cached)? By using graphics file, the zoom can go any level.

Thank you very much,

Coordinator
Apr 4, 2009 at 8:21 PM
level is limited by map provider, zooming beyond max just by scaling image isn't so good idea... anyway what do you mean exactly?
Apr 4, 2009 at 9:15 PM
Edited Apr 4, 2009 at 9:16 PM
Beyond the map provider zoom level, I want to scale the image the control already cached. Why it is not a good idea?

Is it hard to implement?

Thanks,


Apr 5, 2009 at 10:20 AM
Dear Transoft !

First of all I would like to Pay Plenty of thanks for providing so quick Helping Response. Secondly, I want to know how to open Cache Database File ? I tried my best to search on the Web giving this extensiion .gmdb but could'nt succeeded. Pls tell me which database software can open such files ?

Looking Forward for your Positive & Early Response.

Your's Sincerely,
Usman



From: [email removed]
To: [email removed]
Date: Sat, 4 Apr 2009 13:15:50 -0700
Subject: Re: Suggestion for Zoom functionalitity [gmap4dotnet:52279]

From: transoft
Beyond the map provide zoom level, I want to scale the image the control already cached. Why it is not a good idea?




Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! Try it!
Apr 5, 2009 at 2:14 PM
Sorry, I am trying to figure it out.


Apr 6, 2009 at 7:11 PM
Along these lines the zoom would be greatly enhanced if the current image viewport was scaled up/down before the requested zoom level tiles are fetched.  I'm sure you've seen this on some of the mapping sites and it a nice way to provide good interactivity response without actually hitting the cache or network.
Coordinator
Apr 6, 2009 at 8:13 PM
definitely! ..takes time to materilize it ;}
Jun 22, 2009 at 12:45 PM

I've got this working in my WPF version although I had to do some serious hacking.

The solution is two-fold. First you use a render transform to scale the map as you zoom (I added a new dependency property of type Double called IncrementalZoom), then as you pass an integer zoom level, you copy the map to an image, then fade it out as you zoom into the next level.

It works really well and gives smooth zooming, but as I said before, I've hacked and slashed at release 32093 so it's no-longer compatable with the main solution here.
As I know the code will "break" in the latest release, would you want me to upload it, or just post some code snippets on how I got it to work?

 

Moose

Coordinator
Jun 22, 2009 at 1:31 PM

upload all solution(that is building) ziped, and i try to figure out how to apply it to newest release, great thanks!

Jun 22, 2009 at 3:40 PM

Hi Radioman, solution Uploaded as id 3144.

In the geography project I have a window that has a usercontrol called "slide". In this control you have an instance of "MungleMap", do a search for "AddFadeImage" and "OnIncrementalZoomPropertyChanged" in MungleMap.xaml.cs, that should point to the code you're looking for.

Moose

Coordinator
Jun 22, 2009 at 3:48 PM

great! can you upload ActiproSoftware.Ribbon.Wpf30 and ActiproSoftware.Shared.Wpf30, i'm missing them?

Coordinator
Jun 22, 2009 at 4:06 PM

ok, builds now, great!

Jun 23, 2009 at 12:09 PM

did you manage to get this working Radioman?

Moose

Coordinator
Jun 23, 2009 at 5:27 PM

yes scalig works nice, now trying remove flickering using image fading

Coordinator
Jun 24, 2009 at 12:28 PM

any ideas?

Jun 24, 2009 at 12:34 PM

you need to set "ClipToBounds" on the Canvas.... I know, that caught me out as well!

Moose

Coordinator
Jun 24, 2009 at 12:37 PM

..but thats the point: it doesn't work

Coordinator
Jun 24, 2009 at 12:43 PM

can you test it: http://7qv7da.blu.livefilestore.com/y1pcXexFtOGyRr27FH6u0jX98yt6ZDJdbcPruThyc2UfaFQlIkbs4DEJktw88Ia93DwDoGhXXdoPE7xDR1U3b0W0PEeL6VVQ6Bi/GMapNET%20wpf%20test.zip?download

Jun 24, 2009 at 12:45 PM

Set cliptobounds on the instance of the Map itself. In my solution I've got it as:

<font size="2" color="#a31515"><font size="2" color="#a31515">

 

</font></font><font size="2" color="#a31515">

 

</font>

 

<local:Map x:Name="MainMap" ClipToBounds="True" Grid.Row="1" Grid.Column="1" Margin="6,6,6,6"></local:Map>

Coordinator
Jun 24, 2009 at 12:47 PM

still do not work

Jun 24, 2009 at 12:50 PM

Hi RadioMan, just downloading the test code now...

Jun 24, 2009 at 1:16 PM

OK...managed to get it working(ish), if you add the cliptobounds to the Maps parent [the groupbox called "mapgroup"], that seems to inforce the ClipToBounds.
I changed the Xaml on line 11 of MainWindow.xaml to: <font size="2" color="#0000ff"><font size="2" color="#0000ff">

<

</font></font><font size="2" color="#0000ff">

 

</font>

GroupBox Name="mapgroup" ClipToBounds="True"  ...

I think we'll need to do a bit of Googling to get it working correctly...

Moose

Coordinator
Jun 24, 2009 at 1:19 PM

but it clips to groupbox, not a map control ;/

Jun 24, 2009 at 1:26 PM

If you wrap the map in a control that does correctly ClipToBounds, it will work.... I wrapped the map in a grid, and it works!!!!!

 

 

 

 

 

<font size="2" color="#a31515"><font size="2" color="#a31515">

 

</font></font><font size="2" color="#a31515">

 

</font>

 

<GroupBox Name="mapgroup" ClipToBounds="True" Header="gmap" Margin="12,7,241,12" VerticalContentAlignment="Stretch" HorizontalContentAlignment

="Stretch">

<font size="2" color="#a31515"><font size="2" color="#a31515">

 

</font></font>
<font size="2" color="#a31515">

 

</font>

 

<Grid ClipToBounds="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background

="Red">

<font size="2" color="#a31515"><font size="2" color="#a31515">

 

</font></font>
<font size="2" color="#a31515">

 

</font>

 

<src:Map x:Name

="MainMap" />

<font size="2" color="#a31515"><font size="2" color="#a31515">

 

</font></font>
<font size="2" color="#a31515">

 

</font>

 

</Grid

>

<font size="2" color="#a31515"><font size="2" color="#a31515">

 

</font></font>
<font size="2" color="#a31515">

 

</font>

 

</GroupBox

>

Coordinator
Jun 24, 2009 at 1:38 PM

strange, any ideas how put that technique 'inside'?

Jun 24, 2009 at 1:51 PM

Not too sure without frigging your ItemsControl properties
Moose

Jun 24, 2009 at 2:03 PM

What if you changed the ItemsPanelTemplate in GMapControl to be a Grid containing a Canvas?

Coordinator
Jun 24, 2009 at 2:18 PM

i discover great solution! now just need correct markers coordinates..

Jun 24, 2009 at 2:22 PM

How did you do it?

Coordinator
Jun 24, 2009 at 3:00 PM

look there

..any ideas how to correct  local markers positions when zoom is inbetween integer scale?

Jun 24, 2009 at 3:36 PM

Sorry Radioman, that code doesn't run... how did you fix the cliptobounds?

 

regarding the mapmarkers, I just flipped the scaletransform

 

 

 

 

 

 

 

 

<font size="2">

 

</font>

 

 

if(mm.MainMap.MapMarkers.Count > 0)
{
foreach (GMapMarker item in mm.MainMap.MapMarkers)

{

<font size="2">

 

</font>

 

FrameworkElement fe = ((GMapMarkerFrameworkElement)item).MarkerElement;<font size="2">

scaleTransform =

</font>

new ScaleTransform(1 / scaleValue, 1 / scaleValue, fe.ActualWidth / 2, fe.ActualHeight / 2);<font size="2">

 

</font>

 

if (fe.RenderTransform is TransformGroup)
{
TransformGroup tg = new TransformGroup();
tg.Children.Add(((
TransformGroup)fe.RenderTransform).Children[0]);
tg.Children.Add(scaleTransform);
fe.RenderTransform = tg;
}
else
{
fe.RenderTransform = scaleTransform;
}
}
}

Coordinator
Jun 24, 2009 at 3:39 PM

look at Zoom, and

protected override void OnRender(DrawingContext drawingContext)

Jun 24, 2009 at 3:45 PM

very cool my friend ;)