[OpenLayers-Dev] preserving scale on base layer switching

Andreas Hocevar ahocevar at opengeo.org
Wed Feb 3 00:58:16 EST 2010


Tim Schaub wrote:
> Currently, when a new base layer is set, we determine the new resolution 
> based on the previous map extent.  An alternative would be to determine 
> the new resolution based on the previous scale.  Preserving center and 
> scale makes better sense to me.  I'm curious what others think.
>   

I totally agree. This should also improve behavior when switching 
between base layers with different projections/units.

-Andreas.

> The resolution based on extent method breaks down when extents are not 
> well defined.  E.g. with an extent that wraps the date line.  To see 
> this break-down in action, follow these steps:
>
> 1) open http://openlayers.org/dev/examples/google.html
> 2) click to zoom all the way out (you'll see multiple worlds)
> 3) open the switcher and change base layers
>
> You should see the scale change.
>
> Apply the patch for http://trac.openlayers.org/ticket/2457 and you 
> should see better behavior.
>
> Thanks for any feedback.
> Tim
>
>   


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




More information about the Dev mailing list