[OpenLayers-Users] Stopping DragPan moving map out side of the viewport.

Dave Potts dave.potts at pinan.co.uk
Sun Oct 23 01:53:14 EDT 2011


On 23/10/11 01:02, Chris Foulston wrote:
Hi Chris,


/Brilliant/ ! problem sorted!

> Hi Dave,
>
> Try setting the "restrictedExtent" property on the map, this should do
> it if I understand your question correctly.
>
> Chris
>
>
>
> On 22 Oct 2011, at 20:12, Dave Potts wrote:
>
>>
>> When using the DragPan Control its possible to move the map image
>> outside of the viewport.
>>
>> When I set the MaxExtent of a map, to match the physical size of the
>> map,  I  assume the it would be impossible to drag the map image outside
>> of the viewport, but openlayers seem to be quite happy to allow this.
>> Is there any way of stopping it?
>>
>> For example
>> http://dev.openlayers.org/releases/OpenLayers-2.11/examples/drag-feature.html
>>
>> if you drag the map down untill you can see the north pole, it possible
>> to carry on dragging  the map until you move off the end off the image,
>> when you see a white background.  If would prefer to limit the map
>> movement until you hit the border of the map image.
>>
>> Dave.
>> _______________________________________________
>> Users mailing list
>> Users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>
> Chris Foulston
> Managing Director
>
> One Bright Space
> Badgers Moon
> Hook End
> Checkendon
> Reading
> RG8 0UJ
> Mobile: 07769 783 744
> www.onebrightspace.com <http://www.onebrightspace.com>
>
> BS EN ISO 9001:2008
> Green Dragon Environmental Standard
> Young Entrepreneur of Ceredigion 2008
>
> Registered in England and Wales Company number 5027696
> Registered Office: Technium, Y Lanfa, Aberystwyth, SY23 1AS
> -----------------------------------------------------------------------------------
> Confidentiality and Disclaimer: This email and its attachments are
> intended for the addressee only and may be confidential or the subject
> of legal privilege. If this email and its attachments have come to you
> in error you must take no action based on them, nor must you copy
> them, distribute them or show them to anyone. Please contact the
> sender to notify us of the error. This email and any attached files
> have been scanned for the presence of computer viruses. However, you
> are advised that you open any attachments at your own risk
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20111023/2f658966/attachment-0001.html


More information about the Users mailing list