[OpenLayers-Trac] [OpenLayers] #3520: Distance from Polygon
sometime 0 when not touching
OpenLayers
trac-20090302 at openlayers.org
Mon Sep 26 23:26:04 EDT 2011
#3520: Distance from Polygon sometime 0 when not touching
------------------------------+---------------------------------------------
Reporter: filcius | Owner: tschaub
Type: bug | Status: new
Priority: minor | Milestone: 2.12 Release
Component: Geometry.Polygon | Version: 2.11
Keywords: | State:
------------------------------+---------------------------------------------
It may be my understanding, but I think distance should not be 0 here. But
it is.
var shape1 = new OpenLayers.Geometry.Polygon([new
OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(-5, -5), new
OpenLayers.Geometry.Point(-5, 5),new OpenLayers.Geometry.Point(0, 5),new
OpenLayers.Geometry.Point(0, -5)])])
var shape2 = new OpenLayers.Geometry.Polygon([new
OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(2, 5), new
OpenLayers.Geometry.Point(5, 5),new OpenLayers.Geometry.Point(5, -5),new
OpenLayers.Geometry.Point(1, -5)])])
var distance = shape1.distanceTo(shape2,
{details:false, edge:false})
--
Ticket URL: <http://trac.openlayers.org/ticket/3520>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list