Select to view content in your preferred language

How can I capture information of a point on the map

450
1
Jump to solution
03-18-2022 08:37 AM
stiven
by
Emerging Contributor

When I select a point on the map, a popUp opens that shows information about that point, I need to capture that information to use that data, but I don't know how to do that in JavaScript

0 Kudos
1 Solution

Accepted Solutions
YObaidat
Occasional Contributor

You can user hitTest method to capture graphic when user clicks on the view
view.hitTest(event, opts).then((result)=>{

const graphic = response.results[0].graphic;

});

See this sample: https://developers.arcgis.com/javascript/latest/sample-code/view-hittest/

View solution in original post

0 Kudos
1 Reply
YObaidat
Occasional Contributor

You can user hitTest method to capture graphic when user clicks on the view
view.hitTest(event, opts).then((result)=>{

const graphic = response.results[0].graphic;

});

See this sample: https://developers.arcgis.com/javascript/latest/sample-code/view-hittest/

0 Kudos