[OpenLayers-Users] Min Zoom Level
Arnd Wippermann
arnd.wippermann at web.de
Fri Feb 20 17:42:14 EST 2009
Hi,
Have a look at
http://n2.nabble.com/projections-resolution-extents-td1826696.html. Instead
of scales[] you can also use resolutions[].
Arnd Wippermann
-----Ursprüngliche Nachricht-----
Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von Warren Vick
Gesendet: Donnerstag, 19. Februar 2009 19:35
An: users at openlayers.org
Betreff: Re: [OpenLayers-Users] Min Zoom Level
I'm still a bit stuck on implementing a minimum zoom level and would
appreciate any more feedback.
My problem is that my starting point is a bound for any country of the
world. So, the number of zoom levels for a large country will be different
from a small one. So, even if the scales[] property is the way to go (and I
haven't got it working yet), I don't know what to load into that array.
Regards,
Warren Vick
-----Original Message-----
From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org]
On Behalf Of Warren Vick
Sent: 12 February 2009 13:46
To: Matthias Woltering
Cc: users at openlayers.org
Subject: Re: [OpenLayers-Users] Min Zoom Level
Ah, I see.
So, the final part of my question is... what are the scale values for the
standard zoom levels in OL? Is it the same as Min/MaxScaleDenominator when
rendering TMS tiles?
Regards,
Warren
-----Original Message-----
From: Matthias Woltering [mailto:woltering at gmail.com]
Sent: 12 February 2009 13:29
To: Warren Vick
Cc: users at openlayers.org
Subject: Re: [OpenLayers-Users] Min Zoom Level
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
>
>
>
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users
More information about the Users
mailing list