<?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 function zooming only to one geometry in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-function-zooming-only-to-one-geometry/m-p/1169668#M77197</link>
    <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;Im trying to do the goto function for serval geometry but it seems it zooming only to the last geometry in the array,&lt;/P&gt;&lt;P&gt;not really sure why and how to handle it&lt;/P&gt;&lt;P&gt;that's the Array of Geometry im passing, in not getting any errors&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="eyalj_0-1651490084783.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/40290i7620C983CB543ED3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="eyalj_0-1651490084783.png" alt="eyalj_0-1651490084783.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 02 May 2022 11:18:36 GMT</pubDate>
    <dc:creator>eyalj</dc:creator>
    <dc:date>2022-05-02T11:18:36Z</dc:date>
    <item>
      <title>goTo function zooming only to one geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-function-zooming-only-to-one-geometry/m-p/1169668#M77197</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;Im trying to do the goto function for serval geometry but it seems it zooming only to the last geometry in the array,&lt;/P&gt;&lt;P&gt;not really sure why and how to handle it&lt;/P&gt;&lt;P&gt;that's the Array of Geometry im passing, in not getting any errors&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="eyalj_0-1651490084783.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/40290i7620C983CB543ED3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="eyalj_0-1651490084783.png" alt="eyalj_0-1651490084783.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2022 11:18:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-function-zooming-only-to-one-geometry/m-p/1169668#M77197</guid>
      <dc:creator>eyalj</dc:creator>
      <dc:date>2022-05-02T11:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: goTo function zooming only to one geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-function-zooming-only-to-one-geometry/m-p/1169700#M77199</link>
      <description>&lt;P&gt;What does your code look like? This modified &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=intro-graphics" target="_self"&gt;sample&lt;/A&gt; works properly&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;html&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta charset="utf-8" /&amp;gt;
    &amp;lt;meta
      name="viewport"
      content="initial-scale=1,maximum-scale=1,user-scalable=no"
    /&amp;gt;
    &amp;lt;title&amp;gt;Intro to graphics | Sample | ArcGIS API for JavaScript 4.23&amp;lt;/title&amp;gt;

    &amp;lt;link
      rel="stylesheet"
      href="https://js.arcgis.com/4.23/esri/themes/light/main.css"
    /&amp;gt;
    &amp;lt;script src="https://js.arcgis.com/4.23/"&amp;gt;&amp;lt;/script&amp;gt;

    &amp;lt;style&amp;gt;
      html,
      body,
      #viewDiv {
        padding: 0;
        margin: 0;
        height: 100%;
        width: 100%;
      }
    &amp;lt;/style&amp;gt;

    &amp;lt;script&amp;gt;
      require(["esri/Map", "esri/views/MapView", "esri/Graphic"], (
        Map,
        MapView,
        Graphic
      ) =&amp;gt; {
        const map = new Map({
          basemap: "hybrid"
        });

        const view = new MapView({
          center: [-80, 35],
          container: "viewDiv",
          map: map,
          zoom: 3
        });

        /***************************
         * Create a polygon graphic
         ***************************/

        // Create a polygon geometry
        const polygon = {
          type: "polygon", // autocasts as new Polygon()
          rings: [
            [-64.78, 32.3],
            [-66.07, 18.45],
            [-80.21, 25.78],
            [-64.78, 32.3]
          ]
        };
        
        const polygon1 = {
          type: "polygon", // autocasts as new Polygon()
          rings: [
            [-84.78, 32.3],
            [-86.07, 18.45],
            [-90.21, 25.78],
            [-84.78, 32.3]
          ]
        };      

        // Create a symbol for rendering the graphic
        const fillSymbol = {
          type: "simple-fill", // autocasts as new SimpleFillSymbol()
          color: [227, 139, 79, 0.8],
          outline: {
            // autocasts as new SimpleLineSymbol()
            color: [255, 255, 255],
            width: 1
          }
        };

        // Add the geometry and symbol to a new graphic
        const polygonGraphic = new Graphic({
          geometry: polygon,
          symbol: fillSymbol
        });
        // Add the geometry and symbol to a new graphic
        const polygonGraphic1 = new Graphic({
          geometry: polygon1,
          symbol: fillSymbol
        });
        // Add the graphics to the view's graphics layer
        view.graphics.addMany([polygonGraphic, polygonGraphic1]);
        
        view.graphics.on("after-add",()=&amp;gt;{
          view.goTo({
            target: [polygonGraphic.geometry, polygonGraphic1.geometry]
          })
        });
        
        view.graphics.addMany([polygonGraphic, polygonGraphic1]);
      });
    &amp;lt;/script&amp;gt;
  &amp;lt;/head&amp;gt;

  &amp;lt;body&amp;gt;
    &amp;lt;div id="viewDiv"&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 02 May 2022 13:53:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-function-zooming-only-to-one-geometry/m-p/1169700#M77199</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2022-05-02T13:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: goTo function zooming only to one geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-function-zooming-only-to-one-geometry/m-p/1169705#M77200</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;view.goTo(geometryArr);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;GeometryArry is the array in the first pictrue&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;And that's&amp;nbsp;the view&lt;/SPAN&gt;&lt;P&gt;&amp;nbsp;notice that it works it just zooming to one of the geometry in the array instead of all of them&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 02 May 2022 14:10:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-function-zooming-only-to-one-geometry/m-p/1169705#M77200</guid>
      <dc:creator>eyalj</dc:creator>
      <dc:date>2022-05-02T14:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: goTo function zooming only to one geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-function-zooming-only-to-one-geometry/m-p/1169706#M77201</link>
      <description>&lt;P&gt;Can you provide a codepen showing the issue?&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/" target="_blank"&gt;https://codepen.io/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;No way to tell without seeing it in action. It could be a bad geometry, spatial reference mismatch, or something else.&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2022 14:16:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-function-zooming-only-to-one-geometry/m-p/1169706#M77201</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2022-05-02T14:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: goTo function zooming only to one geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-function-zooming-only-to-one-geometry/m-p/1245648#M79780</link>
      <description>&lt;P&gt;No, you are not very right. Only this simple example works and that's it. I have exactly the same problem, I already opened a topic on this forum. So no one answered. There is a bug, some kind of malfunction, and this must be recognized. When a lot of graphs are added, the view.goTu gets lost where to go and shows everything incorrectly, and this is putting it mildly.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 16:33:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-function-zooming-only-to-one-geometry/m-p/1245648#M79780</guid>
      <dc:creator>DimaY</dc:creator>
      <dc:date>2023-01-05T16:33:17Z</dc:date>
    </item>
  </channel>
</rss>

