> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> On Behalf Of Lance Dyas
> Sent: Monday, August 20, 2007 8:34 AM
> To: Chris Hardin
> Cc: [email protected]; Erik Uzureau
> Subject: Re: [OpenLayers-Users] Measure Distance? Ruler?
>
> There is accurate distance measurement using the Vincenty distance
> formula...
> Haverine is umm simulating the earth as sphere and is not accurate.
> What Open Layers lacks is a gui for measurement.
> _______________________________________________
> Users mailing list
> [email protected]
> http://openlayers.org/mailman/listinfo/users
So is there any reason that the following function won't work? I have been
using it in my app and it seems to be accurate... At least as far as I can
tell.
//Add a control,
var c =
new OpenLayers.Control.DrawFeature(vlayer,
OpenLayers.Handler.Path, {'displayClass' : 'olControlDrawFeaturePath'} );
c.featureAdded = this.measureLine;
this.addControls(c);
//function for doing measure
measureLine: function (feature){
if(this.lastFeature)
vectorLayer.eraseFeatures(this.lastFeature);
feature.state = OpenLayers.State.INSERT;
printDistance(feature.geometry.getLength());
this.lastFeature = feature;
},
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed. If
you have received this email in error please notify the sender. This message
contains confidential information and is intended only for the individual
named. If you are not the named addressee you should not disseminate,
distribute or copy this e-mail.
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users