For now I am trying to create a webmap with the ArcGIS API (4.x) for JavaScript. I have a bit understanding of the workings of JavaScript, however I couldn't find code in which it's possible to select a feature (let's say a building) on the web map and return a string when selecting on this feature (such as the name of selected feature. I want to use the string of the name (e.g.) for another action.
-
Welcome to GIS SE; thanks for taking the tour. Please edit your question to include your code thus far and indicate what's not working.Andy– Andy2019年02月18日 16:33:30 +00:00Commented Feb 18, 2019 at 16:33
1 Answer 1
Setup the click event (view.on("pointer-down", function(event) { ... });
), and in that click event use view.hitTest(event).then(function(hitTestResponse) { ... });
and within that function, you can get the attributes. A good example is here. Good luck!
Explore related questions
See similar questions with these tags.