[OpenLayers-Users] OpenStreetMap - trying to limit zoom levels

Linda Rawson linda.rawson at gmail.com
Thu Dec 13 12:57:16 EST 2007


I think you have to customize PanZoomBar.

Linda



On Dec 13, 2007 10:30 AM, The Bun <rosario.carbone at ipl.com> wrote:

>
> Hi
>
> I am using OSM and connecting successfully to their mapnik server.
> Everything works OK, this is my code:
>
>                map = new OpenLayers.Map ("map", {
>                        controls:[
>                                new OpenLayers.Control.Permalink(),
>                                new OpenLayers.Control.MouseDefaults(),
>                                new OpenLayers.Control.LayerSwitcher(),
>                                new OpenLayers.Control.MousePosition(),
>                                new OpenLayers.Control.PanZoomBar()],
>                        maxExtent: new
> OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
>                        numZoomLevels:17,
>                  maxResolution:156543,
>                  units:'meters',
>                  projection: "EPSG:41001"} );
>
>        layerMapnik = new OpenLayers.Layer.TMS(
>                "Mapnik (updated weekly)",
>                "http://tile.openstreetmap.org/mapnik/",
>                {type:'png', getURL: get_osm_url, displayOutsideMaxExtent:
> true },
> {'buffer':1} );
>
> etc. etc.
>
> What I am not understanding is how to limit the zoom levels to just from
> zoom 9 to zoom 16 I tried different ways: An array of scales, an array of
> resolutions, changing the maxResolution, change the numZoomLevels etc etc
> always failed, is there someone in the list who can help with this issue?
>
> Kind Regards
> Rosario Carbone
> --
> View this message in context:
> http://www.nabble.com/OpenStreetMap---trying-to-limit-zoom-levels-tp14320769p14320769.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com<http://nabble.com/>
> .
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20071213/ae9267a3/attachment.html


More information about the Users mailing list