Hello.,
I am currently trying to create a functionality within a Web GIS application that checks to see if a geocoded point is within a Feature Layer (polygon). I understand that the .contains method is something that can be utilized using the esri/geometry/Polygon class. Having said that, is there a way to create a Polygon object from a Feature Layer? Assuming that the feature layer is a single polygon with no subdivisions. Any help at all would be greatly appreciated. Thank you.
-Jacob
Solved! Go to Solution.
Jacob,
If it is a FeatureLayer Object and only has one feature then you just use FeatureLayer.graphics[0].geometry. You do not even have to have the Map Service as part of the map, if you use a QueryTask to query the map service and return the geometry.
To be more clear, the operation that I am trying to perform is essentially a 'Point in Polygon' operation. The only thing that I am having trouble with is how I can utilize a map service as the 'Polygon'.
Jacob,
If it is a FeatureLayer Object and only has one feature then you just use FeatureLayer.graphics[0].geometry. You do not even have to have the Map Service as part of the map, if you use a QueryTask to query the map service and return the geometry.
Okay, great. I will try this. Thanks so much for your help.