[OpenLayers-Users] Problem using containsPoint or intersects
Brian Walawender
Brian.Walawender at noaa.gov
Mon Jan 26 13:13:41 EST 2009
Christopher,
That worked. Thank you very much.
bw
-----Original Message-----
From: Christopher Schmidt [mailto:crschmidt at metacarta.com]
Sent: Monday, January 26, 2009 12:11 PM
To: Brian Walawender
Cc: users at openlayers.org
Subject: Re: [OpenLayers-Users] Problem using containsPoint or intersects
On Mon, Jan 26, 2009 at 11:37:27AM -0600, Brian Walawender wrote:
> var warnPoly = new OpenLayers.Feature.Vector(new
> OpenLayers.Geometry.Polygon([linearRing]));
>
> var checkPoint = new OpenLayers.Geometry.Point(x, y);
> isIn = warnPoly.containsPoint(checkPoint);
>
> Unfortunately I get an error stating that containsPoint is not a function.
> I've also tried intersects with no success either.
Intersects (and containsPoint) are geometry methods, not feature
methods. Try warnPoly.geometry.intersects(checkPoint).
Regards,
--
Christopher Schmidt
MetaCarta
More information about the Users
mailing list