>>The error returned is *polygonFeature.intersects* is not a function have you tried polygonFeature.geometry.intersects() instead?
On Wed, Nov 4, 2009 at 1:45 PM, Brad Spencer <b...@cubewerx.com.au> wrote: > Guys, I have created a vector polygon as follows: > > > > var parcel01 = new OpenLayers.Geometry.LinearRing(pointList); > > polygonFeature = new OpenLayers.Feature.Vector( new > OpenLayers.Geometry.Polygon([parcel01])); > > vectorLayer.addFeatures([polygonFeature]); > > > > I then am parsing a list of external points to include only those that are > inside the polygon on the map as vector markers. > > > > I have tried the following with no success: > > > > If (polygonFeature.intersects(new OpenLayers.Geometry.Point(p[0], p[1]))) > {// include code…} > > and > > If (polygonFeature.containsPoint(new OpenLayers.Geometry.Point(p[0], > p[1]))) {// include code…} > > > > Where p[0] = x-coords in Sphericalmercator > > And p[1] = y-coord in SphericalMercator. > > > > The error returned is *polygonFeature.intersects* is not a function. I can > verify that the polygon is being created. > > > > Is there something I am missing here? I am using OL version 2.8. > > > > Does anyone have a simple example of point-in-polygon working? > > > > Cheers, > > > > > > *Brad Spencer* > > General Manager > > NuMaps > > tel: 02 9481 7024 > > mob: 0404 841 131 > > www.numaps.com.au > > b...@numaps.com.au > > > > > > _______________________________________________ > Users mailing list > Users@openlayers.org > http://openlayers.org/mailman/listinfo/users > >
_______________________________________________ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users