[OpenLayers-Users] Openlayers and draw a line with LatLon points
crschmidt at metacarta.com
Thu Aug 7 08:09:22 EDT 2008
On Thu, Aug 07, 2008 at 10:22:33AM +0200, Jone Lura wrote:
> I need to know the LatLon of the start point and end point when drawing a line, to be able to calculate the distance for the line.
> If the line contains several points, it would be nice to know the location for every click and possible store them in an array.
> How is this possible?
If you use a DrawFeature control, it typically adds a line as a feature
to the given layer, which you can access via:
layer.features[layer.features.length - 1]
Features have a geometry:
Which (if it's a LineString) inherits from Collection, and therefore
More information about the Users