[OpenLayers-Users] zooming out when changing base layer

Erik Uzureau euzuro at gmail.com
Mon Dec 11 06:15:11 EST 2006


When you switch between base layers, OpenLayers tries to find the
nearest approximate
zoom for the new base layer.

So what is happening is that when you switch from baselayer A to baselayer B

1) records current extent of map in baselayer A
2) switches to base layer B
3) calls zoomToExtent() on stored extent from base layer A

if the resolutions/scales array for your two base layers are not the same,
this would explain the behaviour.

Note that with the commercial layers (google, yahoo, etc) we have specifically
hard coded the resolutions array so that it will be more consistent with wms
layers (due to projection differences).

On 12/11/06, Bart van den Eijnden (OSGIS) <bartvde at osgis.nl> wrote:
> Hi list,
>
> I have 2 base layers and several overlays, all are WMS Untiled.
>
> When I change the base layer, the application zooms out.
>
> Is this a bug?
>
> Best regards,
> Bart
>
> --
> Bart van den Eijnden
> OSGIS, Open Source GIS
> http://www.osgis.nl
>
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



More information about the Users mailing list