[OpenLayers-Users] Setting zoom levels

Andreas Hocevar ahocevar at opengeo.org
Wed Feb 1 13:50:19 EST 2012


Hi,

for all non-proprietary-API layers, the options to use are
maxResolution and numZoomLevels. See
http://openlayers.org/dev/examples/bing-tiles-restrictedzoom.html

For making other tiled layer types work on top of a Google base layer
that is configured with a minZoom, you should be able to get things
working using the zoomOffset option and setting it to the minZoom
value you provided for Google.

Andreas.

On Wed, Feb 1, 2012 at 4:29 PM, Javier Mr <javiersdevmail at ymail.com> wrote:
> Hi,
>
> i'm having problems setting the zoom levels using OpenLayers.
>
> By default the map (and it's base layers) are created with 18 zoom levels
> (from 0 to 17). Now we need to change that from 2 to 17.
>
> I have tried, in a Google layer, settign minZoomLevel = 2 and numZoomLevels
> = 16, and what i get is that the zoom levels go from 0 to 15. The map looks
> good and this prevent the users from see the map too small, but the zoom
> indexes go from 0 to 15. This is a handicap since we use the zoom level to
> access the features that are going to be painted on the map from a diferent
> service. Is there a way to set up the minZoom and the numZoomLevels so that
> i get a range of zoom from [minZoom, minZoom + numZoomLevels]?
>
> The previous point is almost solved wrapping the calls to map.getZoom(), in
> that wrapper i add the minZoom value.
>
> But now i found (apparently) that WMS layers (like OSM) doesn't support
> minZoom, is the a way that i can achieve this in all types of layers
> (currently using Google, OSM and WMS)?
>
> Thanks.
>
> Javier.
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.


More information about the Users mailing list