<?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: Enable popup in Web Map in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/enable-popup-in-web-map/m-p/814852#M2637</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/181623" target="_blank"&gt;Krish V&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the code to enable popups of layers in a webmap using ArcGIS API for Python:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; WebMap
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; json

item &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"webmap id"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
item_data &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; item&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get_data&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
layers &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; item_data&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'operationalLayers'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; layer &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; layers&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;update&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'disablePopup'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

item_properties &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"text"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; json&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dumps&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;item_data&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
item&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;update&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;item_properties&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;item_properties&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
web_map &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; WebMap&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;item&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
web_map&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 09:36:56 GMT</pubDate>
    <dc:creator>MehdiPira1</dc:creator>
    <dc:date>2021-12-12T09:36:56Z</dc:date>
    <item>
      <title>Enable popup in Web Map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/enable-popup-in-web-map/m-p/814850#M2635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to Enable popup in Web Map using ArcGIS API for Python?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/506874_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Krish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2020 14:37:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/enable-popup-in-web-map/m-p/814850#M2635</guid>
      <dc:creator>KrishV</dc:creator>
      <dc:date>2020-09-14T14:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Enable popup in Web Map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/enable-popup-in-web-map/m-p/814851#M2636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's possible, but not directly through the Python API. You'd want to get the web map JSON, modify it to your liking, and use the item.update() function from the API to apply the changes. More on this below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/211499"&gt;Configure Popup Attributes Programmatically with ArcGIS API for Python&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/web-map-specification/objects/popupInfo/" title="https://developers.arcgis.com/web-map-specification/objects/popupInfo/"&gt;popupInfo | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/python/api-reference/arcgis.mapping.toc.html?highlight=webmap#arcgis.mapping.WebMap.update" title="https://developers.arcgis.com/python/api-reference/arcgis.mapping.toc.html?highlight=webmap#arcgis.mapping.WebMap.update"&gt;arcgis.mapping module — arcgis 1.8.2 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2020 20:05:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/enable-popup-in-web-map/m-p/814851#M2636</guid>
      <dc:creator>GeoJosh</dc:creator>
      <dc:date>2020-09-14T20:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Enable popup in Web Map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/enable-popup-in-web-map/m-p/814852#M2637</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/181623" target="_blank"&gt;Krish V&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the code to enable popups of layers in a webmap using ArcGIS API for Python:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; WebMap
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; json

item &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"webmap id"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
item_data &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; item&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get_data&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
layers &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; item_data&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'operationalLayers'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; layer &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; layers&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;update&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'disablePopup'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

item_properties &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"text"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; json&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dumps&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;item_data&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
item&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;update&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;item_properties&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;item_properties&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
web_map &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; WebMap&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;item&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
web_map&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:36:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/enable-popup-in-web-map/m-p/814852#M2637</guid>
      <dc:creator>MehdiPira1</dc:creator>
      <dc:date>2021-12-12T09:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: Enable popup in Web Map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/enable-popup-in-web-map/m-p/814853#M2638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/360701"&gt;Mehdi Pira&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code you provided is running successfully but It &lt;STRONG&gt;doesn't change&lt;/STRONG&gt; anything in the webmap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" height="331" src="https://community.esri.com/legacyfs/online/506927_pastedImage_1.png" width="317" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Krish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2020 03:09:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/enable-popup-in-web-map/m-p/814853#M2638</guid>
      <dc:creator>KrishV</dc:creator>
      <dc:date>2020-09-15T03:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: Enable popup in Web Map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/enable-popup-in-web-map/m-p/814854#M2639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/181623"&gt;Krish V&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;I reckon there is a bug in ArcGIS API for Python at the moment for enabling popups when a layer first time is added to a webmap.&lt;/P&gt;&lt;P&gt;To do a workaround, I just found out that you need to first enable popups manually and save the web map. Then when you run the code with&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;CODE style="border: 0px; font-weight: inherit;"&gt;layer&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;update&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;{&lt;/SPAN&gt;&lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit;"&gt;'disablePopup'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #990000; border: 0px; font-weight: inherit;"&gt;True&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;}&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;which makes all popups disabled. After that, set 'disablePopup' to&amp;nbsp; False and run the code again. This fixes the enabling and disabling popups via the code.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2020 03:28:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/enable-popup-in-web-map/m-p/814854#M2639</guid>
      <dc:creator>MehdiPira1</dc:creator>
      <dc:date>2020-09-15T03:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Enable popup in Web Map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/enable-popup-in-web-map/m-p/1143547#M7115</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/migrated-users/360701" target="_blank"&gt;Mehdi Pira&lt;/A&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I have the same issues as&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/181623" target="_blank"&gt;Krish V&lt;/A&gt;&lt;SPAN&gt;‌. You recommended manually enabling the pop-ups first, but in our project we need to do this 400+ times, so this is not a very sustainable workflow. Has there been s solution developed that allows you to do this programmatically?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you, Maria&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 11:13:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/enable-popup-in-web-map/m-p/1143547#M7115</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-02-14T11:13:56Z</dc:date>
    </item>
  </channel>
</rss>

