<?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 Popup not pointing to feature and zoom to throws an error in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-not-pointing-to-feature-and-zoom-to-throws/m-p/1221345#M78992</link>
    <description>&lt;P&gt;I want to activate pop up for a selected feature, move the map to show the popup location, and then if i choose to use the zoom to function to go to the feature.&lt;/P&gt;&lt;P&gt;Unfortunately it throws an error:&amp;nbsp;&lt;SPAN&gt;"Cannot center at a location without a target and view."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what i have so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fl = this.view?.map.findLayerById(data.featureLayerGroup.id);
fl.queryFeatures({ where: "id = '" + data.id + "'" }).then(results =&amp;gt; {
      if (results.features.length) {
        this.view?.popup.open({
          features: results.features
        });
      }
    }
    );&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I been going through the docs but cannot find the solution&lt;/P&gt;</description>
    <pubDate>Wed, 12 Oct 2022 23:36:27 GMT</pubDate>
    <dc:creator>Aeseir</dc:creator>
    <dc:date>2022-10-12T23:36:27Z</dc:date>
    <item>
      <title>Popup not pointing to feature and zoom to throws an error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-not-pointing-to-feature-and-zoom-to-throws/m-p/1221345#M78992</link>
      <description>&lt;P&gt;I want to activate pop up for a selected feature, move the map to show the popup location, and then if i choose to use the zoom to function to go to the feature.&lt;/P&gt;&lt;P&gt;Unfortunately it throws an error:&amp;nbsp;&lt;SPAN&gt;"Cannot center at a location without a target and view."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what i have so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fl = this.view?.map.findLayerById(data.featureLayerGroup.id);
fl.queryFeatures({ where: "id = '" + data.id + "'" }).then(results =&amp;gt; {
      if (results.features.length) {
        this.view?.popup.open({
          features: results.features
        });
      }
    }
    );&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I been going through the docs but cannot find the solution&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 23:36:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-not-pointing-to-feature-and-zoom-to-throws/m-p/1221345#M78992</guid>
      <dc:creator>Aeseir</dc:creator>
      <dc:date>2022-10-12T23:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Popup not pointing to feature and zoom to throws an error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-not-pointing-to-feature-and-zoom-to-throws/m-p/1221377#M78993</link>
      <description>&lt;P&gt;Figured it out, simple yet couldn't find it in docs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want the popup to point to the feature at hand, you need to ensure the query returns the geometry AND&amp;nbsp;&lt;SPAN&gt;updateLocationEnabled is enabled.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;new code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fl = this.view?.map.findLayerById(data.featureLayerGroup.id);
fl.queryFeatures({ where: "id = '" + data.id + "'", returnGeometry: true  }).then(results =&amp;gt; {
      if (results.features.length) {
        this.view?.popup.open({
          features: results.features,
          updateLocationEnabled: true
        });
      }
    }
    );&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 13 Oct 2022 02:57:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-not-pointing-to-feature-and-zoom-to-throws/m-p/1221377#M78993</guid>
      <dc:creator>Aeseir</dc:creator>
      <dc:date>2022-10-13T02:57:18Z</dc:date>
    </item>
  </channel>
</rss>

