Hello I am trying to check if a polygon contains all points. Currently I could do with single point, but unable to do with multipoint. Is looping the best way possible or I am missing on alternatives.
if(polygon.rings.length > 0){
polygon.removeRing(polygon.rings.length-1);
}
myFeatureLayer.queryFeatures(query).then(function (response) {
if (response.features.length > 0) {
polygon.addRing(response.features[0].geometry["rings"][0]);
if (response.features[0].geometry["rings"]) {
view.graphics.add(polygonGraphic);
if(forecastLatLonX && forecastLatLonX.length > 0){
var pointX = new Point({
latitude: forecastLatLonX[0][1],
longitude: forecastLatLonX[0][0]
});
const contains = polygon.contains(pointX);
console.log("contains", contains);
}
view.graphics.add(pointGraphic);
}
}
});