[OpenLayers-Users] Reset the zoom

Andrew Stewart Andrew.Stewart at reddeer.ca
Mon Jan 7 14:23:33 PST 2013


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: openlayers-users-bounces at lists.osgeo.org [mailto:openlayers-users-bounces at lists.osgeo.org] On Behalf Of Ayrton Araújo
Sent: January 07, 2013 2:34 PM
To: openlayers-users at lists.osgeo.org
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.]



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130107/46b69d29/attachment.html>


More information about the Users mailing list