Select to view content in your preferred language

how can i manage the zoom of the map at starting point

747
2
07-08-2010 04:21 AM
binyamintrachtman
Emerging Contributor
help i want the map to be at zoomed in section at the opening of the map page
i have tried to use the foaling but nothing happen only after the map is loaded completely  the foaling code works.

mapCenterPoint=map.extent.getCenter();
map.centerAndZoom(mapCenterPoint,scaleDegry);
map.resize();

second i have the same problem hiding the zoom scrooler the foaling code only works after the map is completely download how can i load the map without the scroller

map.hideZoomSlider()

thanks
0 Kudos
2 Replies
AndrewJones
Deactivated User
The only way to start the map at a certain scale or location is to set the startExtent in the constructor parameters.  Alternatively you can hide the map, zoom to the scale and then show it.

The zoom slider has to be hidden after the map is loaded if you use the slider:true constructor parameter.  slider:false will not allow you to show the slider at all once the map is created.  The only alternative is to create your own slider and connect it to the maps onChangeExtent event.
0 Kudos
FrankMcGowan
Emerging Contributor
andrew is right. you can also add an onload event that fires after the map loads, which you can then execute your code below.

mapCenterPoint=map.extent.getCenter();
map.centerAndZoom(mapCenterPoint,scaleDegry);
map.resize();
0 Kudos