[OpenLayers-Users] limit map to maxExtent?

John Pulles john.pulles at geodan.nl
Thu Jan 8 04:45:41 EST 2009


ashlin schreef:
> Hi,
>
> I have the same problem too. May i know is it possible to keep panning
> within max extent?
>   
I assume the restrictedExtent (see 
http://openlayers.org/dev/examples/restricted-extent.html) is the 
solution to this problem.

Regards,
John
> Best Regards,
> Ashlin
>
>
>
> bartvde wrote:
>   
>> Hi list,
>>
>> is there a way to limit the map to its maxExtent? Right now I can pan
>> outside of the maxExtent.
>>
>> I tried adding a check to setCenter in Map.js:
>>
>> ..
>> var bounds = this.getExtent();
>> if (!this.maxExtent.containsBounds(bounds))
>> { 
>>   return false;
>> }
>>
>> but that does not seem to do the job.
>>
>> Any help appreciated.
>>
>> Best regards,
>> Bart
>>
>> --
>> Bart van den Eijnden
>> OSGIS, Open Source GIS
>> http://www.osgis.nl
>>
>>
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>>
>>
>>     
>
>   


-- 
John Pulles
-------------------------------------
Geodan IT b.v.
Buitenhaven 27-A
5211TP 's-Hertogenbosch
-------------------------------------
Tel: +31 (0)73 - 692 5151
Fax: +31 (0)73 - 692 5150
-------------------------------------
Postadres / mailing address
President Kennedylaan 1
1079MB Amsterdam
-------------------------------------
E-mail:  john.pulles at geodan.nl
Website: http://www.geodan.nl
-------------------------------------





More information about the Users mailing list