We want to find whether a Point lies inside a Polygon.
var point = new esri.geometry.Point(-85.91,25.68,this.parent.esriMap.spatialReference);
var polygon = new esri.geometry.Polygon(this.parent.esriMap.spatialReference);
polygon .addRing([contains the lat and long]);
boolean result=polygon .contains(point);
The moment I add the contains method call (polygon .contains(point);
), I get an error stating that ESRIMapViewer does not have a constructor. ESRIMapViewer.js is the file which contains the above code.
Best Answer
i've posted a working sample here
are you sure that the SpatialReference you are digging out of your map is WGS84 and not WebMercator?