Select to view content in your preferred language

Find what Polygons are Selected in the Web View

297
1
Jump to solution
10-10-2022 01:07 AM
PaulAnderson2k
Emerging Contributor

This sandbox shows you how to draw polygons:

Sandbox | Sample Code | ArcGIS API for JavaScript 4.24 | ArcGIS Developers

However, I can shift click them to select them.  Here I have selected 2 out of the 3.  

PaulAnderson2k_0-1665389044662.png

 

Is it possible to find out what polygons you have selected?

 

 

0 Kudos
1 Solution

Accepted Solutions
UndralBatsukh
Esri Regular Contributor

Hey there, 

You can listen to Sketch widget's update event  and its payload returns array of selected graphics. 

 

sketch.on("update", (event)=>{
  console.log("selected graphics for update", event.graphics);
});

View solution in original post

1 Reply
UndralBatsukh
Esri Regular Contributor

Hey there, 

You can listen to Sketch widget's update event  and its payload returns array of selected graphics. 

 

sketch.on("update", (event)=>{
  console.log("selected graphics for update", event.graphics);
});