Select to view content in your preferred language

add zoom action when select feature

310
1
11-20-2022 02:49 AM
DasheEbra
Frequent Contributor

I use ArcGIS API for Javascript to build app, now I built have a list of selections and map, I want to zoom on selected feature when select it.

my code same as this URL

0 Kudos
1 Reply
BlakeTerhune
MVP Regular Contributor

You could watch for when the popup is visible, then zoom to the selected feature.

 

reactiveUtils.watch(
 () => view.popup.visible,
 () => {
   console.log(`Popup visible: ${visible}`);
 });

Edit:

Here is another possible solution

Solved: Zoom to selected feature using JavaScript - Esri Community