1

I am not able to find out how to get lat-lon values of all the points in the drawn line in the openlayer vector layer, like this openlayer-example. please help me where to search...?

2 Answers 2

1

http://dev.openlayers.org/releases/OpenLayers-2.9/doc/apidocs/files/OpenLayers-js.html

Get layer instance(OpenLayers.Layer.Vector) from map.layers array. Iterate over features(OpenLayers.Feature.Vector) in layer.features. Access geometry(OpenLayers.Geometry) of feature using feature.geometry. This can be any type of geometry. For line the type is OpenLayers.Geometry.LineString. Use getVertices function to get array of all points(OpenLayer.Geometry.Point) in teh line.

Sign up to request clarification or add additional context in comments.

1 Comment

your link has expired
0

you can get by using feature.getGeometry().getCoordinates()

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.