<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content=text/html;charset=iso-8859-1>
<META content="MSHTML 6.00.6002.18407" name=GENERATOR></HEAD>
<BODY id=MailContainerBody 
style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px" leftMargin=0 
topMargin=0 CanvasTabStop="true" name="Compose message area">
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>First, this question is suited to the user's list 
not the developer's list. The developer's list is for questions or discussions 
about developments in the actual OpenLayers library, not using OpenLayers for 
development.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>Second,</FONT></DIV>
<DIV><FONT face=Arial size=2>You can just set the restricted extent directly on 
the layers of interest once the selection is made</FONT></DIV>
<DIV>&nbsp;</DIV></FONT></DIV>
<DIV><FONT face=Arial size=2>Thirdly if&nbsp;you want to precisely control 
things yourself you&nbsp;can listen to and react to the map's&nbsp;'movestart' 
&amp; 'moveend' events. and also the 'move' event if you want finer 
control.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Cache the location when movestart 
fires</FONT></DIV>
<DIV><FONT face=Arial size=2>Test the current location (extent, zoom, etc) as 
move or moveend fires</FONT></DIV>
<DIV><FONT face=Arial size=2>If using move event, then if the location is within 
the limit then change the cached location to the current location</FONT></DIV>
<DIV><FONT face=Arial size=2>When moveend fires, if the map is outside of the 
acceptable bounds for the area you are focusing on, then move it back to the 
cached location programattically (ie map.setCenter(....) )</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Matt Priour</FONT></DIV>
<DIV><FONT face=Arial size=2>Kestrel Computer Consulting</FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><FONT face=Arial></FONT><FONT face=Arial></FONT><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A 
title="mailto:openlayers-dev-request@lists.osgeo.org&#10;CTRL + Click to follow link" 
href="mailto:openlayers-dev-request@lists.osgeo.org">openlayers-dev-request@lists.osgeo.org</A> 
</DIV>
<DIV><B>Sent:</B> Thursday, May 26, 2011 11:00 AM</DIV>
<DIV><B>To:</B> <A 
title="mailto:openlayers-dev@lists.osgeo.org&#10;CTRL + Click to follow link" 
href="mailto:openlayers-dev@lists.osgeo.org">openlayers-dev@lists.osgeo.org</A> 
</DIV>
<DIV><B>Subject:</B> Dev Digest, Vol 56, Issue 28</DIV></DIV></DIV>
<DIV><BR></DIV>Send Dev mailing list submissions to<BR><A 
title="mailto:openlayers-dev@lists.osgeo.org&#10;CTRL + Click to follow link" 
href="mailto:openlayers-dev@lists.osgeo.org">openlayers-dev@lists.osgeo.org</A><BR><BR>To 
subscribe or unsubscribe via the World Wide Web, visit<BR><A 
title="http://lists.osgeo.org/mailman/listinfo/openlayers-dev&#10;CTRL + Click to follow link" 
href="http://lists.osgeo.org/mailman/listinfo/openlayers-dev">http://lists.osgeo.org/mailman/listinfo/openlayers-dev</A><BR>or, 
via email, send a message with subject or body 'help' to<BR><A 
title="mailto:openlayers-dev-request@lists.osgeo.org&#10;CTRL + Click to follow link" 
href="mailto:openlayers-dev-request@lists.osgeo.org">openlayers-dev-request@lists.osgeo.org</A><BR><BR>You 
can reach the person managing the list at<BR><A 
title="mailto:openlayers-dev-owner@lists.osgeo.org&#10;CTRL + Click to follow link" 
href="mailto:openlayers-dev-owner@lists.osgeo.org">openlayers-dev-owner@lists.osgeo.org</A><BR><BR>When 
replying, please edit your Subject line so it is more specific<BR>than "Re: 
Contents of Dev digest..."<BR><BR>Message: 1<BR>Date: Wed, 25 May 2011 09:04:55 
-0700<BR>From: "Mark K. Zanfardino" &lt;<A 
title="mailto:mzanfardino@gmail.com&#10;CTRL + Click to follow link" 
href="mailto:mzanfardino@gmail.com">mzanfardino@gmail.com</A>&gt;<BR>Subject: 
[OpenLayers-Dev] How to dynamically set maxExtent and<BR>restrictedExtent<BR>To: 
OpenLayers-Dev Dev &lt;<A 
href="mailto:dev@openlayers.org">dev@openlayers.org</A>&gt;<BR>Message-ID: 
&lt;<A 
href="mailto:4DDD28A7.9080504@gmail.com">4DDD28A7.9080504@gmail.com</A>&gt;<BR>Content-Type: 
text/plain; charset=ISO-8859-1; format=flowed<BR><BR>What I'm trying to 
do:<BR>I'm rending a map for an entire county. I have a simply html select 
<BR>option of extents that I wish to use to set focus on the map. I need to 
<BR>restrict the user from being able to zoom 'out' (pull back and see the 
<BR>entire county) or slide 'away' (drag the map to another area) after an 
<BR>option has been selected.<BR><BR>I currently initialize the map to the 
county view when the page loads <BR>(see <A 
href="http://pastebin.com/jSmnHtwS">http://pastebin.com/jSmnHtwS</A> for HTML). 
I have written a function <BR>which will zoom to a new extent based on the 
selection of the option <BR>list (see <A 
href="http://pastebin.com/WBX0rmxz">http://pastebin.com/WBX0rmxz</A> for 
JavaScript). All this works <BR>fine, but I'm stuck with how I can restrict the 
user from zooming 'out' <BR>or slipping 'away' from the focused 
extent.<BR><BR>I'm looking for any suggestions on what might be the best 
approach to <BR>achieve my objective.<BR><BR>Thanks,<BR><BR>Mark 
Zanfardino<BR><BR>PS - My apologies if this shows up as a duplicate. I received 
a notice <BR>that the first email I sent was quarantined do to the attachment of 
the <BR>javascript)<BR><BR><BR>------------------------------<BR></BODY></HTML>