Select to view content in your preferred language

Linking navigation actions to more than one map control

893
3
04-22-2010 09:42 AM
TheresaKennedy
Emerging Contributor
Hi All,

Can anyone help me on the best approach to linking map controls? I have a tab control with a map control in each tab. I would like to have each map update when the user pans or zooms on any one of them.  I've thought about using overview maps, but I don't know what the limitations are on functionality for an overview map versus a main map control?

I'm using Expression Blend, and I'm fairly new to this. My code behind is all in VB at the moment.

Thanks for your help!

Theresa
0 Kudos
3 Replies
KadeSmith
Frequent Contributor
Use the Map.ExtentChanged on each of the maps.  Inside of that call, set the Map.Extent in each of the other maps to the new map extent.  For Example:

        void Map_ExtentChanged(object sender, ExtentEventArgs e)
        {
            Map1.Extent = e.NewExtent;
            Map2.Extent = e.NewExtent;
            Map3.Extent = e.NewExtent;
            Map4.Extent = e.NewExtent;
            Map5.Extent = e.NewExtent;
        }
0 Kudos
TheresaKennedy
Emerging Contributor
Thanks for your response Kadesmith. I haven't managed to get this working yet, despite trying your code as well as a few pointers I found elsewhere. I think that the Tab control I'm using to hold the maps is part of the problem. I will post code and some further details after a little more testing with 2.0.

Thanks again,

Theresa
0 Kudos
DavidCulverhouse
New Contributor
I have also found that you need...

Map1.MaximumResolution = MainMap.MaximumResolution;
Map1.MinimumResolution = MainMap.MinimumResolution;

...if you are using layers with small extents in order to keep the views linked properly.
0 Kudos