[OpenLayers-Users] Min Zoom Level

Warren Vick wvick at europa-tech.com
Sat Feb 21 07:18:25 EST 2009


Hello Arnd,

Thanks for the reference.

Both scales[] and resolutions[] seem to be ideal for supporting maps of a known/fixed area, say a particular country. However, my problem is that I was to set the minimum zoom at run time and don't know what to load into those arrays. Any suggestions? I've still got a worldwide TMS layer, but just want to stop the end user wandering around. Extents stop the user panning, but zoom is still a problem. I see that a minZoom is supported to pass thru to commercial layers like Google, but this is not supported generally (a worthy enhancement IMHO). In an ideal world (excuse the pun), I'd like to zoom to a max extent, query the zoom level, and then set that as the min zoom for the map. I'd then have a nice "tight" map extent for the user.

Regards,
Warren

-----Original Message-----
From: arnd.wippermann at web.de [mailto:arnd.wippermann at web.de] 
Sent: 20 February 2009 22:42
To: Warren Vick
Cc: users at openlayers.org
Subject: AW: [OpenLayers-Users] Min Zoom Level

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