<?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, zoom out a bit in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-zoom-out-a-bit/m-p/1391629#M83867</link>
    <description>&lt;P&gt;I am using view.goTo to go to an array of geometries (which happen to be the same as all the polygons drawn on a graphics layer `graphicsLayerParcelHighlight`)&lt;/P&gt;&lt;P&gt;The problem is that if I don't specify a zoom level, it's zoomed in too much. I want to back out around 2 or 3 zoom levels from whatever it would be otherwise.&lt;BR /&gt;&lt;BR /&gt;I think I could work out how to expand each of the geometries in the array, but I'm not sure if that's the most sensible way.&amp;nbsp;I'm a beginner.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;view.whenLayerView(graphicsLayerParcelHighlight).then(() =&amp;gt; {&lt;BR /&gt;&amp;nbsp; view.goTo({&lt;BR /&gt;&amp;nbsp; &amp;nbsp; target: parcelGeometryArray,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; zoom: 16&lt;BR /&gt;&amp;nbsp; });&lt;BR /&gt;});&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Wed, 06 Mar 2024 04:06:58 GMT</pubDate>
    <dc:creator>JasonWood</dc:creator>
    <dc:date>2024-03-06T04:06:58Z</dc:date>
    <item>
      <title>goTo, zoom out a bit</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-zoom-out-a-bit/m-p/1391629#M83867</link>
      <description>&lt;P&gt;I am using view.goTo to go to an array of geometries (which happen to be the same as all the polygons drawn on a graphics layer `graphicsLayerParcelHighlight`)&lt;/P&gt;&lt;P&gt;The problem is that if I don't specify a zoom level, it's zoomed in too much. I want to back out around 2 or 3 zoom levels from whatever it would be otherwise.&lt;BR /&gt;&lt;BR /&gt;I think I could work out how to expand each of the geometries in the array, but I'm not sure if that's the most sensible way.&amp;nbsp;I'm a beginner.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;view.whenLayerView(graphicsLayerParcelHighlight).then(() =&amp;gt; {&lt;BR /&gt;&amp;nbsp; view.goTo({&lt;BR /&gt;&amp;nbsp; &amp;nbsp; target: parcelGeometryArray,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; zoom: 16&lt;BR /&gt;&amp;nbsp; });&lt;BR /&gt;});&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 06 Mar 2024 04:06:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-zoom-out-a-bit/m-p/1391629#M83867</guid>
      <dc:creator>JasonWood</dc:creator>
      <dc:date>2024-03-06T04:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: goTo, zoom out a bit</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-zoom-out-a-bit/m-p/1398014#M84067</link>
      <description>&lt;P&gt;You can get the extent of all the graphics, and then &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#expand" target="_self"&gt;expand&lt;/A&gt; it a bit:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var extent = null;

graphicsLayer.graphics.forEach(function(graphic) {
	if (graphic.geometry.type == "polygon") {
		if (extent === null)
			extent = graphic.geometry.extent.clone();
		else
			extent.union(graphic.geometry.extent);
	}
});

if (extent !== null)
	view.goTo(extent.expand(1.5));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 18:01:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/goto-zoom-out-a-bit/m-p/1398014#M84067</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2024-03-19T18:01:40Z</dc:date>
    </item>
  </channel>
</rss>

