<?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 Re: Zooming 2 Layers in WebMap with ArcGIS using Python? in ArcGIS Enterprise Portal Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/zooming-2-layers-in-webmap-with-arcgis-using/m-p/651850#M8888</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/368894"&gt;Vitor Ribeiro&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you know the extent, you can call&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.update(item_properties={'extent': extent})&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.gis.toc.html#item"&gt;https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.gis.toc.html#item&lt;/A&gt;&lt;/P&gt;&lt;PRE class="" style="color: #4c4c4c; background-color: #ffffff; font-size: 17px; margin-bottom: 1.55rem;"&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Aug 2019 02:29:29 GMT</pubDate>
    <dc:creator>DerrickWong</dc:creator>
    <dc:date>2019-08-01T02:29:29Z</dc:date>
    <item>
      <title>Zooming 2 Layers in WebMap with ArcGIS using Python?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/zooming-2-layers-in-webmap-with-arcgis-using/m-p/651847#M8885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV class="" style="color: #242729; background-color: #f9f8f6; border: 0px; padding: 0px 15px 0px 0px;"&gt;&lt;DIV class="" data-post-id="330570" style="color: #bbc0c4 !important; border: 0px; font-weight: inherit; font-size: 13px; margin: -2px;"&gt;&lt;DIV class="" data-value="0" style="color: #6a737c !important; border: 0px; font-weight: inherit; font-size: 1.61538rem !important; margin: 2px;"&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #242729; background-color: #f9f8f6; border: 0px;"&gt;&lt;DIV class="" style="border: 0px; font-weight: inherit; margin: 0px 0px 5px;"&gt;&lt;P style="border: 0px; font-weight: inherit; margin: 0px 0px 1em;"&gt;I am using the ArcGIS library in Python.&lt;/P&gt;&lt;P style="border: 0px; font-weight: inherit; margin: 0px 0px 1em;"&gt;I was able to create a WebMap with the command&lt;/P&gt;&lt;PRE class="" style="color: #393318; background-color: #eff0f1; border: 0px; font-weight: inherit; margin: 0px 0px 1em; padding: 12px 8px;"&gt;&lt;CODE style="background-color: #eff0f1; border: 0px; font-weight: inherit;"&gt;&lt;SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: 13px;"&gt;WebMap&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt;()&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P style="border: 0px; font-weight: inherit; margin: 0px 0px 1em;"&gt;I added some Layers on it with the command&lt;/P&gt;&lt;PRE class="" style="color: #393318; background-color: #eff0f1; border: 0px; font-weight: inherit; margin: 0px 0px 1em; padding: 12px 8px;"&gt;&lt;CODE style="background-color: #eff0f1; border: 0px; font-weight: inherit;"&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt;add_layer &lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt;()&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P style="border: 0px; font-weight: inherit; margin: 0px 0px 1em;"&gt;I added property on Web Map&lt;/P&gt;&lt;P style="border: 0px; font-weight: inherit; margin: 0px 0px 1em;"&gt;and saved my changes.&lt;/P&gt;&lt;P style="border: 0px; font-weight: inherit; margin: 0px 0px 1em;"&gt;But I didn't have Extent (Zoom to layer) in my filtered Layers&lt;/P&gt;&lt;P style="border: 0px; font-weight: inherit; margin: 0px 0px 1em;"&gt;I would like to get the extent of the filtered layer to pass the extent in the webmap, does anyone know any way?&lt;/P&gt;&lt;P style="border: 0px; font-weight: inherit; margin: 0px 0px 1em;"&gt;Library -&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://esri.github.io/arcgis-python-api/apidoc/html/index.html" rel="nofollow noreferrer" style="color: #1d4d5c; border: 0px; font-weight: inherit; text-decoration: underline;"&gt;https://esri.github.io/arcgis-python-api/apidoc/html/index.html&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jul 2019 02:18:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/zooming-2-layers-in-webmap-with-arcgis-using/m-p/651847#M8885</guid>
      <dc:creator>VitorRibeiro</dc:creator>
      <dc:date>2019-07-31T02:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Zooming 2 Layers in WebMap with ArcGIS using Python?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/zooming-2-layers-in-webmap-with-arcgis-using/m-p/651848#M8886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/368894"&gt;Vitor Ribeiro&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should be able to grab the extent from the layer object that is returned from a search:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's a sample code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from arcgis.gis import GIS&lt;BR /&gt;gis = GIS("https://ABC.maps.arcgis.com", "USERNAME", "PASSWORD")&lt;BR /&gt;search_result = gis.content.search('title:LayerOfInterest', item_type = 'Feature Service')&lt;/P&gt;&lt;P&gt;if len(search_result) &amp;gt; 0:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;layer = search_result[0] #assuming we want the first layer.&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;print(layer.extent)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached is a screenshot of the code running on my AGOL with the results displayed in the output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jul 2019 02:57:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/zooming-2-layers-in-webmap-with-arcgis-using/m-p/651848#M8886</guid>
      <dc:creator>DerrickWong</dc:creator>
      <dc:date>2019-07-31T02:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Zooming 2 Layers in WebMap with ArcGIS using Python?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/zooming-2-layers-in-webmap-with-arcgis-using/m-p/651849#M8887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #f8f9fa; font-size: 16px;"&gt;This form works, but returns something empty. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #f8f9fa; font-size: 16px;"&gt;These steps I followed to child Web Map with my desired information. The biggest problem is zooming to the extent of Filtered Layers. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #f8f9fa; font-size: 16px;"&gt;- I created WebMap () &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #f8f9fa; font-size: 16px;"&gt;- Add 2 layers to wb &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #f8f9fa; font-size: 16px;"&gt;- I gave a definitionExpression on my layers (as shown in print) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #f8f9fa; font-size: 16px;"&gt;- Set up webmap_item_properties with title&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #f8f9fa; font-size: 16px;"&gt; - snippet and tags&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #f8f9fa; font-size: 16px;"&gt; - I finally saved the Web Map &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #f8f9fa; font-size: 16px;"&gt;Unfortunately the extent of the Map is too far away, showing the entire globe of the basemap. I would like to know if it is possible to zoom the moment you filter in definitionExpression? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #f8f9fa; font-size: 16px;"&gt;Here's a screenshot of my Jupyter Notebook&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #f8f9fa; font-size: 16px;"&gt;&lt;SPAN&gt;In the empty line was my sql, but I had personal information and could not publish, but it was working&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #f8f9fa; font-size: 16px;"&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/454887_problema_zoom_layer.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jul 2019 11:43:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/zooming-2-layers-in-webmap-with-arcgis-using/m-p/651849#M8887</guid>
      <dc:creator>VitorRibeiro</dc:creator>
      <dc:date>2019-07-31T11:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: Zooming 2 Layers in WebMap with ArcGIS using Python?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/zooming-2-layers-in-webmap-with-arcgis-using/m-p/651850#M8888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/368894"&gt;Vitor Ribeiro&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you know the extent, you can call&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.update(item_properties={'extent': extent})&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.gis.toc.html#item"&gt;https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.gis.toc.html#item&lt;/A&gt;&lt;/P&gt;&lt;PRE class="" style="color: #4c4c4c; background-color: #ffffff; font-size: 17px; margin-bottom: 1.55rem;"&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2019 02:29:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/zooming-2-layers-in-webmap-with-arcgis-using/m-p/651850#M8888</guid>
      <dc:creator>DerrickWong</dc:creator>
      <dc:date>2019-08-01T02:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Zooming 2 Layers in WebMap with ArcGIS using Python?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/zooming-2-layers-in-webmap-with-arcgis-using/m-p/1038704#M10702</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/159842"&gt;@DerrickWong&lt;/a&gt;&amp;nbsp;i'm calling the extent of the feature im interested, but when i publish the webmap the zoom is still at global level. How could i fix it?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 16:26:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/zooming-2-layers-in-webmap-with-arcgis-using/m-p/1038704#M10702</guid>
      <dc:creator>Carlode_Stefano</dc:creator>
      <dc:date>2021-03-19T16:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Zooming 2 Layers in WebMap with ArcGIS using Python?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/zooming-2-layers-in-webmap-with-arcgis-using/m-p/1039174#M10709</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/217020"&gt;@Carlode_Stefano&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How are you publishing the web map and where are you viewing it from?&lt;/P&gt;&lt;P&gt;If using the&amp;nbsp;map widget from Jupyter Notebook, you can configure the desired zoom level via the attribute&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;zoomlevel&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;If you are using Publish Item, you can specify the extent in the&amp;nbsp;&lt;SPAN&gt;layerInfo object.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Alternatively, you can always open up the web map in Portal/AGOL and change the extent/zoom and save the changes manually.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Derrick&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 03:50:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/zooming-2-layers-in-webmap-with-arcgis-using/m-p/1039174#M10709</guid>
      <dc:creator>DerrickWong</dc:creator>
      <dc:date>2021-03-22T03:50:30Z</dc:date>
    </item>
  </channel>
</rss>

