[OpenLayers-Users] Distance errors on Google maps

Peter Robins openlayers at peterrobins.co.uk
Sun Feb 1 18:24:46 EST 2009


On Sunday 01 Feb 2009, Jennifer Strahan wrote:
> Hi Peter,
>
> Back in Oct/Now I wrote to Tim Schaub asking about measurements when
> working with Spherical Mercator and he sent me a few responses that I'm
> copying below for you.

Thank you. Yes:

var point = new OpenLayers.LonLat(-8.547039046722437,42.87420777239693); 
var p1 = new OpenLayers.LonLat(-8.534868375601192,42.87483907990915);
alert(OpenLayers.Util.distVincenty(point,p1));

gives 0.996895 which is more like it.

Tim's patch looks good, but I would have thought this should be the default 
for at least the scale line calculation in spherical mercator. As it stands, 
the scale line for these maps is not much practical use.

(I would imagine this is also the problem reported in ticket #1890)



More information about the Users mailing list