On Thu, Aug 07, 2008 at 10:22:33AM +0200, Jone Lura wrote: > Hi, > > 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: http://dev.openlayers.org/apidocs/files/OpenLayers/Feature/Vector-js.html#OpenLayers.Feature.Vector.geometry Which (if it's a LineString) inherits from Collection, and therefore has components: http://dev.openlayers.org/apidocs/files/OpenLayers/Geometry/Collection-js.html#OpenLayers.Geometry.Collection.components Regards, -- Christopher Schmidt MetaCarta _______________________________________________ Users mailing list [email protected] http://openlayers.org/mailman/listinfo/users
