I want to make a simple webgis apps using JS where I can select some points using arbitrary polygon. Once polygon is drawn, there is a popup showing how many points fall inside it.
Further more, I need to be able to pass this count into another app.
I have prepared:
- 2 Feature services, one being polygon and the other on point
Can anyone show me some directions ? What spatial analysis is needed for this ? Possibly intersect right ?
Hi @yockee - check out this sample Select features by rectangle. It allows you to draw a polygon on the map, and then query for features that intersect that polygon by setting the query's geometry property.
Once you get the resulting featureSet from the query, you can open the popup like so:
view.openPopup({
location: point, // point geometry for where you want the popup to open
features: queryResults.features // features returned from the query
});
Where in the codes i should insert these "view.openpopup" lines .. thanks