I am trying to get the boundary box using a square polygon in openlayers. I need to get the North, South, West, and East values from the box. Right now I am using :
var topleft = vectors.features[0].geometry.getVertices()[0];
to get the top left vertex. However it returns a value like this:
POINT(-13393350.718762 4024321.5982824)
How can I get the lat and lon values from this returned point?
One option you have is using the getVertices()[i] to generate a point
then transform that point to get Lat and Long with something like
Then you should be able to grab the lat and long from those points.
Another option, possibly preferable, would be to transform the boundary and then pull out the individual vertices.
then pull out the lat long of the vertices with: