&gt;&gt;The error returned is <b>polygonFeature.intersects</b> is
not a function<br>have you tried polygonFeature.geometry.intersects() instead?<br><br><div class="gmail_quote">On Wed, Nov 4, 2009 at 1:45 PM, Brad Spencer <span dir="ltr">&lt;<a href="mailto:brad@cubewerx.com.au">brad@cubewerx.com.au</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">








<div link="blue" vlink="purple" lang="EN-US">

<div>

<p class="MsoNormal">Guys, I have created a vector polygon as follows:</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">var parcel01 = new
OpenLayers.Geometry.LinearRing(pointList);</p>

<p class="MsoNormal">polygonFeature = new OpenLayers.Feature.Vector( new
OpenLayers.Geometry.Polygon([parcel01]));</p>

<p class="MsoNormal">vectorLayer.addFeatures([polygonFeature]);</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">I then am parsing a list of external points to include only
those that are inside the polygon on the map as vector markers.</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">I have tried the following with no success:</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">If (polygonFeature.intersects(new
OpenLayers.Geometry.Point(p[0], p[1]))) {// include code…}</p>

<p class="MsoNormal">and </p>

<p class="MsoNormal">If (polygonFeature.containsPoint(new
OpenLayers.Geometry.Point(p[0], p[1]))) {// include code…}</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">Where p[0] = x-coords in Sphericalmercator</p>

<p class="MsoNormal">And p[1] = y-coord in SphericalMercator.</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">The error returned is <b>polygonFeature.intersects</b> is
not a function. I can verify that the polygon is being created.</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">Is there something I am missing here? I am using OL version
2.8.</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">Does anyone have a simple example of point-in-polygon working?</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">Cheers,</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal"> </p>

<p class="MsoNormal"><b><span style="font-size: 16pt;">Brad Spencer</span></b></p>

<p class="MsoNormal">General Manager</p>

<p class="MsoNormal">NuMaps</p>

<p class="MsoNormal">tel: 02 9481 7024</p>

<p class="MsoNormal">mob: 0404 841 131</p>

<p class="MsoNormal"><a href="http://www.numaps.com.au" target="_blank">www.numaps.com.au</a></p>

<p class="MsoNormal"><a href="mailto:brad@numaps.com.au" target="_blank">brad@numaps.com.au</a></p>

<p class="MsoNormal"> </p>

<p class="MsoNormal"> </p>

</div>

</div>


<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
<br></blockquote></div><br>