I am using OpenLayers+GeoServer and I have a vector layer in a map with some features I would like to make a zoom and show the map centered in one of these features that I can get by ID. How can I do this operation?

  • I tried to get the bounds of the feature and then pass it to zoomToExtent() method of the layer. The problem is that bounds properties and getBounds() method of the feature return null
    – stefanoBL
    Commented Sep 19, 2014 at 6:43
  • What kind of features are you dealing with? points or lines or polygons? Commented Sep 19, 2014 at 6:44
  • they are MultiLineString
    – stefanoBL
    Commented Sep 19, 2014 at 6:45


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.