This project is read-only.

Can multiple map controls be displayed at the same time?

Feb 9, 2009 at 4:52 PM
Hi everyone
I am just putting together a small demo.  I have a map control, with a VE tile source which has one geometry layer added to it and this displays fine.  When a pushpin on the map is clicked I slide in a panel and display a mini map just of that item, this mini map again on has one Geometry layer.  However when display this second map, the layer in the first big map seems to shrink into the top corner, both of the actual maps display corrrectly but something is causing the layer to shrink.

Incase it has any bearing both the map and the slide in panel are contained in a DockPanel with the map filling the reomain area. 
Is what I am trying to achieve possible?
Thanks
Feb 9, 2009 at 5:55 PM
Should be possible.  We have "Mini Map" listed as a potential feature enhancement, but we have not yet tried or tested.  If you can post a stripped down example, I can help you figure out what can be done to make this work.
Feb 9, 2009 at 6:58 PM
FYI: I use a DeepEarth contol that is added dynamically to a Divelements SandDock. Through a coding error I once had 20 DeepEarth controls active at the same time without any problem.
Feb 10, 2009 at 11:43 AM
Hi Guys
Thanks for your replies, sorry I was unable toreply yesterday.  I have knocked together a quick sample to demonstrate my problem and while the behaviour is slightly different there is still a problem.  I find that map 2 and its layer behave correctly  while map 1 behaves ok but its layer is all wrong.

I have uploaded the sample to my skydrive. http://cid-a24653a4a7be3271.skydrive.live.com/self.aspx/Public/MultimapTest.zip
Feb 10, 2009 at 4:32 PM
Ok, I have discovered a couple more things whilst digging into this problem.

Map1 is affected by there just being a second map control, even if I do not set a source or add a layer to map2, the layer in map 1 just behaves strangely.  If however I set the update mode of map1 layer to PanOnlyUpdate it is ok.  I  then added back the source and layer of map2 and tried setting the update mode of map1 layer back to ElementUpdate and map2 layer to PanOnlyUpdate but the problem was still there, but if I set map2 layer to be ElementUpdate and map1 layer to be PanOnlyUpdate then it is ok.

 
Feb 13, 2009 at 11:05 AM
OK I still haven't gotten to the bottom of this but another thing I have noticed is that it seems to be the last map control that is added to the visual tree works fine and the others go wrong.  So by adding a third map to the sample I posted then causes map 2 to stop working correctly.
Feb 13, 2009 at 1:53 PM
Sounds like Map.DefaultInstance is being used somewhere it shouldn't be. This value is always the last map created, and shouldn't be used in multi-map scenarios.  I'll try to look at your example this weekend.  In the mean time if you put a break in Map.DefaultInstance you might find it yourself.  Looking for ways the MapInstance can be set explicitly may reveal the solution.
Feb 13, 2009 at 6:41 PM
You were spot on with your thoughts RoadWarrior, I had a look at all the objects that use Map.DefaultInstance and found that PointBase, PathBase and GeometeryLayer all use it to get access to CoordHelper.  I made changes to these classes so that they use the MapInstance in the layer and it seems to be working ok now.