[OpenLayers-Users] Min Zoom Level

Matthias Woltering woltering at gmail.com
Thu Feb 12 08:29:28 EST 2009


Hi Warren,

if you add the PanZoomBar

map.addControl(new OpenLayers.Control.PanZoomBar());

you will have as much zoomlevels as you have defined in the
scales-section. In the previous example there will be 7 zoom-levels.

Regards,
Matthias


Warren Vick schrieb:
> Hi Matthias,
> 
> Thanks for the prompt feedback. How would changing the scale of each
> zoom level limit the number of levels available to the user? In my case,
> I have 11 zoom levels but want to start at level 6. So, my zoom control
> would only represents the levels between 6 and 11.
> 
> Regards,
> Warren
> 
> -----Original Message-----
> From: Matthias Woltering [mailto:woltering at gmail.com] 
> Sent: 12 February 2009 13:00
> To: Warren Vick
> Cc: users at openlayers.org
> Subject: Re: [OpenLayers-Users] Min Zoom Level
> 
> Hi Warren,
> 
> you can set set the scales manually like this:
> 
> var options = {
>   maxExtent: new OpenLayers.Bounds(1430000,4400000,1760000,4660000)
>   ,maxResolution: "auto"
>   ,scales: [1000000,500000,250000,100000,50000,25000,10000]
>   ,units: 'm'
>   ,projection: 'EPSG:31466'
>   ,controls: []
>   //,zoom: 1
>   //,numZoomLevels: 8
> };
> map = new OpenLayers.Map('map', options);
> 
> If you don't want to set scales use numZoomLevels.
> 
> Regards,
> Matthias
> 
> 
> Warren Vick schrieb:
>> How can I set a minimum zoom level for a map? Focussing on a single
>> country, I know how to limit the extent but can't figure out how to
> stop
>> someone zooming out and seeing TMS tiles that have not been rendered.
>>
>> Regards,
>> Warren
>>
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
> 
> 
> 




More information about the Users mailing list