Refreshing the Extent

1585
5
11-02-2011 01:12 AM
MohammedIsmail
New Contributor
Hi

am loading different map services in my web application on click , but my problem is that maps are getting loaded somewhere, its may be because of the first map extent,  as you can see in the screen shots the diffrences.

how can i load the map with default extent so that it will get displayed on the screen

Thanks
0 Kudos
5 Replies
by Anonymous User
Not applicable
Original User: VBoycheva

The BookmarkWidget has a function addBookmark, which shows how to apply a new extent to the map. You can extract the extent values from the config file.

Regards,
Valentina Boycheva
0 Kudos
MohammedIsmail
New Contributor
am unable to find the config file please tell me the location

thanks
0 Kudos
by Anonymous User
Not applicable
Original User: VBoycheva

I meant the widget's configuration file - BookmarkWidget.xml, located in the same directory as the widget itself. The full widget documentation is here:

http://links.esri.com/bookmarkwidget
0 Kudos
MohammedIsmail
New Contributor
how to attach this xml file to our application 

thanks
0 Kudos
by Anonymous User
Not applicable
Original User: ibespalov


I am loading different map services in my web application on click , but my problem is that maps are getting loaded somewhere


1 - Switching basemaps with defined center: Esri Sample

2 - How to get access to your map current extent: Esri Sample

3 - Such layers as ArcGISDynamicMapServiceLayer and ArcGISTiledMapServiceLayer has readonly property fullExtent.

4 - Map component has initialExtent property.

5.1 - On switching layers add and listen LayerEvent.UPDATE_END handler. Get this layer fullExtent. Set it as map initialExtent. And make map.zoomToInitialExtent() .

OR

5.2 - On switching layers add and listen LayerEvent.UPDATE_END handler. Get this layer fullExtent. Set it as map current extent.

Good luck.

Also you can post the result of your working (not working) code. It helps others to find your bug.
0 Kudos