2

I use wms layer from geoserver on my map and i use openlayers3 api. I want to zoom to my selected layer but for this i have too use extent of my selected layer.

mySelectedLayer=map.getLayers().getArray()[map.getLayers().getLength()-1];
mySelectedLayer.getExtent()// result is undefined

why?

1 Answer 1

1

It seems you didn't search before asking or I misunderstand. You can already have the answer at this question.

Edit due to comment

Ok, WPS can be a bit annoying. So, another way is to call GetCapabilities if you use a WMS. You can convert the XML result to JSON and extract layer extent. See this official example illustrating the concept.

1
  • 1
    I saw that answer but i dont know how to use or control wps services in openlayers3 Commented Oct 27, 2014 at 18:02

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.