[OpenLayers-Dev] Re: 'changelayer' event + map zoom

Andreas Hocevar ahocevar at opengeo.org
Fri Jan 13 06:00:06 EST 2012

Ok, now I see what you want to achieve. "changelayer" is not the event
you want to listen to. When listening to the "changebaselayer" event,
you don't even have to check for visibility in the listener:


On Fri, Jan 13, 2012 at 10:38 AM, Grzegorz Kurzejamski
<grzegorz.kurzejamski at lingaro.com> wrote:
> Thank you for reply, and sorry for posting in wrong section.
> Andreas, I really don't understand the statement about the map "not knowing"
> maxExtents of another layers. All of the layers are the base layers. All of
> them has been declared with maxExtent property configured, as well as map.
> All of the maxExtents are identical. And, as I said, just before closing of
> alert box I can see the changed layer and zoomed to extent chosen by me.
> Just after closing (so just after going out of 'changelayer' function) the
> zoom comes back to state from before layer changing.
> Unfortunately your code didn't solve my problem either. Why the zoom is
> 'corrected' after going out of changelayer function?
> --
> View this message in context: http://osgeo-org.1803224.n2.nabble.com/changelayer-event-map-zoom-tp7180553p7183495.html
> Sent from the OpenLayers Dev mailing list archive at Nabble.com.
> _______________________________________________
> Dev mailing list
> Dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-dev

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

More information about the Dev mailing list