[OpenLayers-Users] Measure Distance? Ruler?

Lee Keel lee.keel at uai.com
Mon Aug 20 09:40:42 EDT 2007


> -----Original Message-----
> From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org]
> On Behalf Of Lance Dyas
> Sent: Monday, August 20, 2007 8:34 AM
> To: Chris Hardin
> Cc: users at openlayers.org; 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
> Users at openlayers.org
> 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.



More information about the Users mailing list