<?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 goTo issues with zooming in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-issues-with-zooming/m-p/1141985#M76290</link>
    <description>&lt;P&gt;I try to understand the folowing error :&lt;BR /&gt;&lt;STRONG&gt;TypeError: Cannot read properties of null (reading 'targetGeometry')&lt;/STRONG&gt;&lt;BR /&gt;in my code.&lt;BR /&gt;I just define a featurelayer :&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;const secteur = new FeatureLayer({&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; url: "&lt;A href="https://sig.gironde.fr/arcgis/rest/services/Colleges_rentree_2022/FeatureServer/1" target="_blank" rel="noopener"&gt;https://sig.gironde.fr/arcgis/rest/services/Colleges_rentree_2022/FeatureServer/1&lt;/A&gt;",&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; title:"Secteurs des collèges",&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; definitionExpression: expr,&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; popupTemplate: popup,&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; labelingInfo: [labelClass]&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; map.add(secteur);&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; secteur.when(() =&amp;gt; {&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; zoomToLayer(secteur);&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;and this function :&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;function zoomToLayer(layer) {&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return layer.queryExtent().then((response) =&amp;gt; {&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; view.goTo(response.extent)&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The definition expression retrieves a single polygon in the view without zooming on it.&lt;BR /&gt;Where have I to define a target geometry ?&lt;BR /&gt;Thank's for some help&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 09 Feb 2022 07:15:13 GMT</pubDate>
    <dc:creator>Olivier_MOUGEL</dc:creator>
    <dc:date>2022-02-09T07:15:13Z</dc:date>
    <item>
      <title>goTo issues with zooming</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-issues-with-zooming/m-p/1141985#M76290</link>
      <description>&lt;P&gt;I try to understand the folowing error :&lt;BR /&gt;&lt;STRONG&gt;TypeError: Cannot read properties of null (reading 'targetGeometry')&lt;/STRONG&gt;&lt;BR /&gt;in my code.&lt;BR /&gt;I just define a featurelayer :&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;const secteur = new FeatureLayer({&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; url: "&lt;A href="https://sig.gironde.fr/arcgis/rest/services/Colleges_rentree_2022/FeatureServer/1" target="_blank" rel="noopener"&gt;https://sig.gironde.fr/arcgis/rest/services/Colleges_rentree_2022/FeatureServer/1&lt;/A&gt;",&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; title:"Secteurs des collèges",&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; definitionExpression: expr,&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; popupTemplate: popup,&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; labelingInfo: [labelClass]&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; map.add(secteur);&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; secteur.when(() =&amp;gt; {&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; zoomToLayer(secteur);&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;and this function :&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;function zoomToLayer(layer) {&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return layer.queryExtent().then((response) =&amp;gt; {&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; view.goTo(response.extent)&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The definition expression retrieves a single polygon in the view without zooming on it.&lt;BR /&gt;Where have I to define a target geometry ?&lt;BR /&gt;Thank's for some help&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 09 Feb 2022 07:15:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-issues-with-zooming/m-p/1141985#M76290</guid>
      <dc:creator>Olivier_MOUGEL</dc:creator>
      <dc:date>2022-02-09T07:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: goTo issues with zooming</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-issues-with-zooming/m-p/1142167#M76300</link>
      <description>&lt;P&gt;I am going to guess that your basemap is a different spatial reference than your service. When you query against the service, the SR will be the original SR of the service. You can. request the geometries to be converted to match your map like this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function zoomToLayer(layer) {
  // create query from layer
  const query = layer.createQuery();
  // ask for SR to match the View
  query.outSpatialReference = view.spatialReference;
  return layer.queryExtent(query).then((response) =&amp;gt; {
    view.goTo(response.extent)
  });
}&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 09 Feb 2022 16:05:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-issues-with-zooming/m-p/1142167#M76300</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2022-02-09T16:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: goTo issues with zooming</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-issues-with-zooming/m-p/1142530#M76308</link>
      <description>&lt;P&gt;Thank's a lot. It's true I use a local SR for my feature layer&amp;nbsp;&lt;BR /&gt;Have a nice day&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 08:02:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-issues-with-zooming/m-p/1142530#M76308</guid>
      <dc:creator>Olivier_MOUGEL</dc:creator>
      <dc:date>2022-02-10T08:02:27Z</dc:date>
    </item>
  </channel>
</rss>

