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
[email protected]
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users