[OpenLayers-Dev] How to dynamically set maxExtent and restrictedExtent

Mark K. Zanfardino mzanfardino at gmail.com
Tue May 24 21:16:42 EDT 2011

What I'm trying to do:
I'm rending a map for an entire county. I have a simply html select 
option of extents that I wish to use to set focus on the map. I need to 
restrict the user from being able to zoom 'out' (pull back and see the 
entire county) or slide 'away' (drag the map to another area) after an 
option has been selected.

I currently initialize the map to the county view when the page loads 
(see attached HTML). I have written a function which will zoom to a new 
extent based on the selection of the option list (see attached 
javascript). All this works fine, but I'm stuck with how I can restrict 
the user from zooming 'out' or slipping 'away' from the focused extent.

I'm looking for any suggestions on what might be the best approach to 
achieve my objective.


Mark Zanfardino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20110524/f025d8b0/index.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: index.css
Type: text/css
Size: 2874 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20110524/f025d8b0/index.css
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mapserver.js
Type: application/javascript
Size: 2820 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20110524/f025d8b0/mapserver.bin

More information about the Dev mailing list