Select to view content in your preferred language

identify

147
1
Jump to solution
08-30-2024 10:48 AM
ForrestLin
Frequent Contributor
I use identify to identify feature when click on map:
 
import * as identify from "@arcgis/core/rest/identify.js";
 
view.on("click", (event: ViewClickEvent) => {
     const params = new IdentifyParameters({
                   geometry: event.mapPoint
                   // .....
             });
      identify.identify(url, params);
});
 

Is it possible to know a feature that is already identified, so that identify.identify won't be called when clicked on it again?

When I click on it again, I want show it's popup.

Thanks.

Forrest

 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
ForrestLin
Frequent Contributor

I got a solution: use hitTest

view.on("click", (eventViewClickEvent=> {
     view.hitTest(event).then(({ results }) => {
          if (results.length == 0) {
               const params = new IdentifyParameters({
                   geometry: event.mapPoint
                   // .....
             });
              identify.identify(urlparams);
           }
        });
});
 

View solution in original post

0 Kudos
1 Reply
ForrestLin
Frequent Contributor

I got a solution: use hitTest

view.on("click", (eventViewClickEvent=> {
     view.hitTest(event).then(({ results }) => {
          if (results.length == 0) {
               const params = new IdentifyParameters({
                   geometry: event.mapPoint
                   // .....
             });
              identify.identify(urlparams);
           }
        });
});
 
0 Kudos