[OpenLayers-Dev] MinZoomLevel in OSM layer

Bruno Binet bruno.binet at camptocamp.com
Tue Nov 2 08:29:45 EDT 2010


I agree with Tim, zoomOffset would help in that case.

But when we need to allow only specific zoom levels (for exemple, if
you need zoom levels 3, 4, 7), then zoomOffset is not applicable.
I have created ticket http://trac.osgeo.org/openlayers/ticket/2909 to
add support for serverResolution in XYZ layers. The patch is ready for
review.

Bruno

On 1 November 2010 19:28, Tim Schaub <tschaub at opengeo.org> wrote:
> 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.
> _______________________________________________
> Dev mailing list
> Dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-dev
>



-- 
Bruno Binet

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Mail : bruno.binet at camptocamp.com
http://www.camptocamp.com


More information about the Dev mailing list