Hi
in my case i have some graphic points and i'm looking for filtering points based on geometry
for example
assigning color to graphic points
if point is inside los angeles then green color
else red color
no idea how to validate point geometry with area
Any suggestions?
Thanks
Solved! Go to Solution.
Hi,
Depends on how you are loading the points, you can check point within polygon using the following method;
Polygon | API Reference | ArcGIS API for JavaScript 3.27
let boolean = PolygonFeature.contains(PointFeature); //This returns a boolean that will let you know if the point lies within a polygon.
you can use this to set attributes to the point feature and then use Unique Value Renderer, or you can run a loop to check condition and then change the color of the point using setColor or setSymbol methods.
Hi,
Depends on how you are loading the points, you can check point within polygon using the following method;
Polygon | API Reference | ArcGIS API for JavaScript 3.27
let boolean = PolygonFeature.contains(PointFeature); //This returns a boolean that will let you know if the point lies within a polygon.
you can use this to set attributes to the point feature and then use Unique Value Renderer, or you can run a loop to check condition and then change the color of the point using setColor or setSymbol methods.
I tried with
var polygon = new Polygon(new SpatialReference({ wkid: 4326 }));
polygon.addRing([[-180, -90], [-180, 90], [180, 90], [180, -90], [-180, -90]]);
let boolean = polygon.contains(amspoint);
how to create a ring of my selected method or else can I pass layer directly