Changes to Web appbuilder search widget code to configure geocoder search to trigger layer popup

06-16-2021 05:42 PM
by Anonymous User
Not applicable



The code below allows me to trigger a popup for a layer in my web map instead of the default search result popup when using the geocoder search although it does not always work because the function processes before the layer has refreshed even with the extra setTimeout included. The layer has to refresh in order for it to work. How do I make a promise to not run the function until the layer has refreshed instead of using the setTimeout?


This the link to my web map: 

This is the link to the layer: 


setTimeout(lang.hitch(this, function(){
          var mpPt;
          if(result.feature.geometry.type === "point"){mpPt = result.feature.geometry;}

          else{mpPt = result.feature.geometry.getExtent().getCenter();}
          var scrPt =;
"click", { 
            bubbles: true, 
            cancelable: true, 
            mapPoint: mpPt,
            screenPoint: scrPt


0 Kudos
0 Replies