[OpenLayers-Dev] Display a subset of zoom levels

Andrea Battisti battisti at actgate.com
Thu Mar 12 11:48:52 EDT 2009


> This is what you need: http://trac.openlayers.org/wiki/SettingZoomLevels
>
> fredj
>
>   

Frédéric,

I already knew about that page but I don't see there the answer to my
question.


Consider the following use case:

TMS Layer with 3 zoomlevels: 0, 1, 2
The map has: maxResolution = 1000 and numZoomLevels = 3

I want to display only zoom levels 1 and 2.
If I set:
maxResolution = 500 and numZoomLevels = 2
then the resolutions array will be: [ 500, 250 ] so 500 gets mapped to
zl '0' and 250 to zl '1' of the tms layer.

My goal is to map that 500 to zl '1' and that 250 to zl '2' of the tms
layer. Is this possible?



> PS: you should use the users at openlayers.org mailing list for this kind of
> question
>   

I will in the future, thanks.


> Le Thu, 12 Mar 2009 15:20:03 +0100,
> Andrea Battisti <battisti at actgate.com> a écrit :
>
>   
>> Hi All,
>>
>>
>> is there a way to force openlayers to show only a subset of zoom levels
>> for a given layer?
>>
>> As an example, if the map is configured using a (maxResolution,
>> numZoomLevels) pair, the maxResolution is mapped to zoom level 0,
>> maxResolution/2 to zl 1 and so on...
>>
>> Will it be possible to tell the map to display for example only the zoom
>> levels > N, or say, only selected zoom levels, e.g. 2, 5, 7 ?
>>
>>
>> Thanks in advance,
>>
>>     
>
>
>   


-- 
Andrea Battisti
Applied Coherent Technology Corp.




More information about the Dev mailing list