getDataExtent only works for layers that are rendered client-side
(i.e. vector layers). For other layers (e.g. WMS), your best bet is to
use OpenLayers.Format.WMSCapabilities and create the layer with the
bbox advertised there as maxExtent, and use
map.zoomToExtent(layer.getMaxExtent()) instead.

Andreas.

On Wed, Aug 22, 2012 at 10:22 PM, Lucho <[email protected]> wrote:
> Hi List,
>
> I'm trying to create a button with the zoom2layer funcionality, but this
> function map.zoomToExtent(layer_name.getDataExtent()); doesn't return any
> value. I don't know if this is because the layer is an image, not a vector
> layer. Any help with this funcionality will be appreciated.
>
> Best wishes,
>
> --
> LUIS FERNANDO ORTIZ REYES
> INGENIERO DE SISTEMAS
> ESP. EN PROYECTOS INFORMÁTICOS
> UNIVERSIDAD DISTRITAL
>
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to