[OpenLayers-Users] Zoom to layer

Lennox Antoine lxnyce at gmail.com
Mon Mar 26 17:54:12 EDT 2007


Hi All.

I am trying to zoom to a layer after it's created. What I want to do is
create a bunch of layers in a tree structure. When the user clicks on a
layer, I want it to jump to that layer. What I would like to do is given the
layer pointer, call map.zoomToExtent with the layers extent.

The problem is that I couldn't find a way to query the current layer for
it's full extents. When I call getExtent() and getZoom(), it returns me the
current extent and zoom of the layer in the map, not the full extent and
full zoom. Is there an easier way of doing this? I should mention that I
pass a "maxExtent" for each one of the layers created. Is there a way to
pull the layer extent from this?

-Lennox
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070326/9e3f044e/attachment.html


More information about the Users mailing list