[OpenLayers-Users] what is the Point.distanceTo(Point) return value??

plen peteralen at earthlink.net
Thu Nov 29 12:38:22 EST 2007


Hello,

I have two Point coordinates that I want to find out what the distance
between them is.  I saw that the OpenLayers.Geometry.Point class has a
distanceTo function.  This is what I tried....

var SWpoint = new OpenLayers.Geometry.Point(SWlng, SWlat);
var NEpoint = new OpenLayers.Geometry.Point(NElng, NElat);
var dist = SWpoint.distanceTo(NEpoint);
alert(dist);

The variable "dist" does seem to have a value but I do not know what it is. 
It returned value is not large enough to be miles or meters so I am not sure
if I am using it incorrectly or this is not how I would get the distance
between two geocoords.

Thoughs?

Thanks - Peter
-- 
View this message in context: http://www.nabble.com/what-is-the-Point.distanceTo%28Point%29-return-value---tf4898790.html#a14030985
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list