You can zoom to any scale on a button press using -

map.zoomToScale("25000")

Or you can use OpenLayers.Control.NavigationHistory for zooming to previous 
levels, it can be associated with a button and you can use nav.previous to go 
back 1 level (or more).

Also, if you define your map extent at the beginning of load and want to go 
back, get the Bounds of your map assigned to a variable, then just 
map.ZoomToExtent using that variable.



Andrew Stewart

________________________________
From: [email protected] 
[mailto:[email protected]] On Behalf Of Ayrton Araújo
Sent: January 07, 2013 2:34 PM
To: [email protected]
Subject: [OpenLayers-Users] Reset the zoom

I want to make a button for reset the zoom status. If some user use the zoom, 
will be possible to reset to the initial state.

How is the best way to do this using JavaScript?

________________________________
[This message has been scanned for security content threats and viruses.]

[The City of Red Deer I.T. Services asks that you please consider the 
environment before printing this e-mail.]



_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to