I am using GeoServer+OpenLayers and I have a base layer (Google map) and some additional layers (OpenLayers.Layer.WMS); users can show or hide these layers. I would like when user show a layer then the map should zoom to the area where layer has data.

I know I have to use map.zoomToExtent(bounds) but I don't know how get this information from the layer.

Do you have any suggestion?

  • Use a WMS GetCapabilities request to find the bounds of any layer in a WMS
    – nmtoken
    Commented Dec 4, 2019 at 11:00


Browse other questions tagged or ask your own question.