[OpenLayers-Users] Is drawing lines (canvas.drawLine) in Internet Explorer possible?

Pfirter Lukas lp at rpag.ch
Thu Apr 12 04:37:34 EDT 2007


Hello Nick.
Thanks for thedvice, it actually worked to return the distance between 2 points:

OpenLayers.Util.distVincenty(new OpenLayers.LonLat(7,47),new OpenLayers.LonLat(8,47))

But as soon as I try to calculate with these values, JavaScript returns a "NaN".... For example:

OpenLayers.Util.distVincenty(new OpenLayers.LonLat(7,47),new OpenLayers.LonLat(8,47))+OpenLayers.Util.distVincenty(new OpenLayers.LonLat(7,47),new OpenLayers.LonLat(8,47))

It also doesn't work with parseFloat(). How can I add different distances to one big distance?

By the way: This function is not documented in Util:
http://openlayers.org/doc/reference.html#OpenLayers.Util

Thank you.
Lucas


-----Ursprüngliche Nachricht-----
Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im Auftrag von Nick Whitelegg
Gesendet: Mittwoch, 11. April 2007 17:47
An: users at openlayers.org
Betreff: Re: [OpenLayers-Users] Is drawing lines (canvas.drawLine) in Internet Explorer possible?

>Is it possible to get the distance between markers in km? Haven't seen
that anywhere. 
There is a function called OpenLayers.Util.distVincenty() which takes two LonLat objects and calculates the distance in km between them.

var d =  OpenLayers.Util.distVincenty (pos1,pos2);

Nick
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070412/3ef0d2ac/attachment.html


More information about the Users mailing list