[OpenLayers-Users] Single untiled map with maxextent

Christopher Schmidt crschmidt at metacarta.com
Thu Sep 13 06:48:11 EDT 2007


On Thu, Sep 13, 2007 at 12:54:00AM -0700, jonz wrote:
> 
> I've modified a version of WMS/Untiled, which I've configured with a ratio of
> 2. After the map is loaded I don't want the user to be able to drag the map
> outside of the original map extent. 
> I've done the following.
> 1) After the map is loaded, I do a map.setOptions setting maxExtent to
> getExtent().
> 2) modified moveTo in the Untiled.js so that if the map is out of bounds, it
> is not reloaded


The code to do this will become trivially easy when #340 hits trunk
later today. Essentially, you'll simply set 'map.restrictedExtent = new
OpenLayers.Bounds()', and then dragging outside that bounds will no
longer be possible. I'll follow up more once this goes in. 

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list