<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Changes to Web appbuilder search widget code to configure geocoder search to trigger layer popup in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changes-to-web-appbuilder-search-widget-code-to/m-p/1069181#M73520</link>
    <description>&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This the link to my web map:&amp;nbsp;&lt;A href="https://lacounty.maps.arcgis.com/home/webmap/viewer.html?webmap=c852a8eb23d74122851917613c9c5102" target="_blank" rel="noopener"&gt;https://lacounty.maps.arcgis.com/home/webmap/viewer.html?webmap=c852a8eb23d74122851917613c9c5102&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the link to the layer:&amp;nbsp;&lt;A href="https://arcgis.gis.lacounty.gov/arcgis/rest/services/LACounty_Dynamic/CAMS/MapServer/1" target="_blank" rel="noopener"&gt;https://arcgis.gis.lacounty.gov/arcgis/rest/services/LACounty_Dynamic/CAMS/MapServer/1&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;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 = this.map.toScreen(mpPt);
          this.map.emit("click", { 
            bubbles: true, 
            cancelable: true, 
            mapPoint: mpPt,
            screenPoint: scrPt
          });
        }),1200);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Jun 2021 00:42:05 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-06-17T00:42:05Z</dc:date>
    <item>
      <title>Changes to Web appbuilder search widget code to configure geocoder search to trigger layer popup</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changes-to-web-appbuilder-search-widget-code-to/m-p/1069181#M73520</link>
      <description>&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This the link to my web map:&amp;nbsp;&lt;A href="https://lacounty.maps.arcgis.com/home/webmap/viewer.html?webmap=c852a8eb23d74122851917613c9c5102" target="_blank" rel="noopener"&gt;https://lacounty.maps.arcgis.com/home/webmap/viewer.html?webmap=c852a8eb23d74122851917613c9c5102&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the link to the layer:&amp;nbsp;&lt;A href="https://arcgis.gis.lacounty.gov/arcgis/rest/services/LACounty_Dynamic/CAMS/MapServer/1" target="_blank" rel="noopener"&gt;https://arcgis.gis.lacounty.gov/arcgis/rest/services/LACounty_Dynamic/CAMS/MapServer/1&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;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 = this.map.toScreen(mpPt);
          this.map.emit("click", { 
            bubbles: true, 
            cancelable: true, 
            mapPoint: mpPt,
            screenPoint: scrPt
          });
        }),1200);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 00:42:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changes-to-web-appbuilder-search-widget-code-to/m-p/1069181#M73520</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-06-17T00:42:05Z</dc:date>
    </item>
  </channel>
</rss>

