You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been having some issues using the distanceTo function on linestring geometries. I'm not sure this is a misunderstanding on my part or problems in the OL library.
An example:
varfeat1,feat2,wkt1,wkt2;varwkt=newOpenLayers.Format.WKT();wkt1='LINESTRING(0 0, 10 0)';wkt2='LINESTRING(11 0, 20 0)';feat1=wkt.read(wkt1);feat2=wkt.read(wkt2);vardist=feat1.geometry.distanceTo(feat2.geometry);console.log(dist);// would expect this to be 1? In fact returns 0
In fact any start X for the second line with a Y of 0 returns a distance of 0.
I've been having some issues using the distanceTo function on linestring geometries. I'm not sure this is a misunderstanding on my part or problems in the OL library.
An example:
In fact any start X for the second line with a Y of 0 returns a distance of 0.
Also the docs at http://dev.openlayers.org/releases/OpenLayers-2.13.1/doc/apidocs/files/OpenLayers/Geometry/LineString-js.html#OpenLayers.Geometry.LineString.distanceTo states that this function "Calculate the closest distance between two geometries (on the x-y plane)" - however it appears to simply find the distance between the two closest vertices of the line geometries?
The text was updated successfully, but these errors were encountered: