Select to view content in your preferred language

Identify related point by polygon feature

2373
2
01-18-2016 07:13 AM
MeganGosch
Deactivated User

I am trying to create the functionality so that when a user clicks on a polygon, it's related point feature is highlighted on my web app map.  There is a similar JS api located under the Geoprocessing - Point in polygon search, but it's not exactly what I'm looking for, and it's also not in a widget form.  I'm new to programming, with very limited skills, so wanted to see if anyone has created anything like this already.  Thanks!

https://developers.arcgis.com/javascript/jssamples/util_relation.html

Geoprocessing - Point in polygon search | ArcGIS API for JavaScript

0 Kudos
2 Replies
JordanBaumgardner
Frequent Contributor

I don't think there is anything out of the box. eSearch widget [ rscheitlin/eSearch · GitHub  ] is probably the closest. It allows for a search based on a geometry drawn by the user.

I think what your looking for is a Query. It can accept a geometry and return features found with in.

Query | API Reference | ArcGIS API for JavaScrip

Or possibly a relationship query.

RelationshipQuery | API Reference | ArcGIS API for JavaScript

This sample seems close - You simply replace your circle geometry with your polygon.

Select with Feature Layer | ArcGIS API for JavaScript

All of the above would take some programming.

MeganGosch
Deactivated User

Thanks, all very close.  The only issue is that each point has many polygons 1:M relationship.  So the point may actually not be in the polygon itself, but contains the attribute of the related polygon so the query has to occur on that.  I just haven't been able to figure it out. 

0 Kudos