Select to view content in your preferred language

overviewmap extent is not updated when switching between 2 different maps

1402
4
01-23-2011 02:59 PM
ThaoNguyen
Emerging Contributor
I have 2 tab views (say tab1 and tab2).  Each view has an ESRI map.  But I have only 1 overview map area.  When I click to tab1/tab2, I programmatically change the overviewmap Map and layer Url attributes to the tab1/tab2 map.
The problem I'm having now is when I switch back and forth between 2 views, the extent of the overview map just takes the previous extent until I pan the map then the extent is updated.  For instance, I go to tab1 and zoom in, my overview map extent is changed accordingly as expected.  Then I switch to tab2, I expect the overview map extent changed to the extent of this map, but it doesn't even though I change the Map attribute to this map.
What am I missing?  Please advice.

Thanks!
0 Kudos
4 Replies
JenniferNery
Esri Regular Contributor
What version of the API for SL/WPF are you using?

I don't know if you are experiencing the same as what has been reported in this post http://forums.arcgis.com/threads/10033-Overview-map-does-not-show-contents-until-after-view-extent-c.... This bug was fixed in v2.1 and the SDK sample http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#OverviewMap, no longer produce this.
0 Kudos
ThaoNguyen
Emerging Contributor
What version of the API for SL/WPF are you using?

I don't know if you are experiencing the same as what has been reported in this post http://forums.arcgis.com/threads/10033-Overview-map-does-not-show-contents-until-after-view-extent-c.... This bug was fixed in v2.1 and the SDK sample http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#OverviewMap, no longer produce this.


No, I don't exprience the same problem with that post.  I read that post before posting my thread.  That post has a different scenario with mine.  The sample overview map is a simple one and my map works just like that.  No complaint on that.  I don't have any problem when zoom in 1 map.  That is working.  My problem is: when I switch between 2 different maps with different extents, my common overview map is not updated based on the current map.  Note that I only have 1 overview map for multiple maps.

This is my scenario:
- Go to map 1, then zoom in.  My overview map is also zoomed in as expected.
- Go to map 2, programatically update my overview map "Map" attribute and layer "URL" to map 2.  The extent of this overview map is still like the map 1, it is still zoomed in.  I expect the overview map extent picks up the extent of map 2 but it doesn't.

Hope I am clear now.  I'm having api 2.1.
0 Kudos
ThaoNguyen
Emerging Contributor
What version of the API for SL/WPF are you using?

I don't know if you are experiencing the same as what has been reported in this post http://forums.arcgis.com/threads/10033-Overview-map-does-not-show-contents-until-after-view-extent-c.... This bug was fixed in v2.1 and the SDK sample http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#OverviewMap, no longer produce this.


I got the problem resolved by explicitly set the overview map extent to the map extent.  Something like this:
overviewMap.Map.Extent = MyMap.Extent;
0 Kudos
JenniferNery
Esri Regular Contributor
Did you update the Overview Map's Map property to switch between two maps? When this property changes, the old map is unsubscribed from ExtentChanged and the new map is subscribed to ExtentChanged, so succeeding ExtentChanged events in the new map should be captured by the OverviewMap.

As for the initial switch, the new map's Extent did not actually change so I think your fix is appropriate. I'll check to see if this is something we should account for when Map property changes.
0 Kudos