[OpenLayers-Dev] MinZoomLevel in OSM layer

Tim Schaub tschaub at opengeo.org
Mon Nov 1 14:28:43 EDT 2010


On 10/31/10 6:16 AM, Andrea Pogliaghi wrote:
> Hi everybody,
>
> I am having a problem in displaying an OSM layer with openlayers.
> Basically I want to cover a certain region and I want to limit the zoom
> between two levels (let's say 10 and 17). I investigated a bit in the
> matter but it seems OSM layer doesn't take into account the "minLevel"
> parameter, it only lets you set the overall max number of levels, but it
> always start from level 0.

You start at an arbitrary zoom level by supplying the zoomOffset 
property to the layer configuration.

http://dev.openlayers.org/apidocs/files/OpenLayers/Layer/XYZ-js.html#OpenLayers.Layer.XYZ.zoomOffset

If you are explicit in setting map related properties, you can get what 
you want by configuring the layer with a zoomOffset (this indicates the 
difference between map zoom level 0 and tile source zoom level 0).

http://openlayers.org/dev/examples/xyz-offset.html

This example demonstrates pulling tiles from a subset of an ArcGIS 
cache.  The same can be done for an OSM tile cache.

Tim

> I did some research and I found this:
> http://trac.osgeo.org/openlayers/ticket/2189.
> I applied the patch on my version of openlayers and now it seems working.
> I am wondering if there is a reason why the patch hasn't been applied in
> the codebase? Does the patch fix the issue but breaks something else?
>
> thanks
> andrea
>
>
>
> _______________________________________________
> Dev mailing list
> Dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-dev


-- 
Tim Schaub
OpenGeo - http://opengeo.org
Expert service straight from the developers.


More information about the Dev mailing list