<?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: How to toggle visibility of item/layer in a feature service using ArcGIS API for Python (ver. 1. in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-toggle-visibility-of-item-layer-in-a/m-p/1001953#M5210</link>
    <description>Hi Philip, I know this is an old thread but I thought I'd respond anyway so at least a possible solution is posted. I'm using ArcGIS Python API ver 1.8.1 The process to do it is: #Get the list of layers from a web map from arcgis.mapping import WebMap wm = WebMap(wm_item) #List Layers wm.layers #Turn Layer visibility off for lyr in wm.layers: lyr.visibility = False</description>
    <pubDate>Mon, 16 Nov 2020 23:00:44 GMT</pubDate>
    <dc:creator>DavinWalker2</dc:creator>
    <dc:date>2020-11-16T23:00:44Z</dc:date>
    <item>
      <title>How to toggle visibility of item/layer in a feature service using ArcGIS API for Python (ver. 1.2.5)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-toggle-visibility-of-item-layer-in-a/m-p/847481#M3724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Question:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;With the ArcGIS API for Python (ver. 1.2.5), how can I turn on items/layers (i.e., toggle visibility or make visible) on my org account ***.maps.arcgis.com (in feature services that I am have sufficient privilege for)? Do I use the something included in the ContentManager or in some other module/package/etc.? It appears this is possible with the Javascript API, possibly with SDKs, and I can not tell if this is already possible with other types of content via the API.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I am using ArcGIS python API (ver. 1.2.5 implies py3) to create feature layers on my arcgis.com org account (from layers of Map Images on hosted one of our own enterprise Arc Servers) and I can not determine how to enable/disable visibility of the feature layers that I am creating.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Backstory:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Some of the Map Images that I work with on our enterprise Arc Server (from which I am creating feature layers with aforementioned visibility issue) hve sufficient quantity of layers to warrant turning all the (Map Image) layers off by default (done with the arcpy code that created them). The subsequent/derived problem I face is that the feature layers I am creating on our org account on arcgis.com site has each layer/item also turned off (i.e., not visible) (except in mobile browsers, curiously, though not too surprisingly).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Preemptive:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;For the curious few who are wondering why I don't just use similar code to that which created the Map Images, I would state that the code that created the original Map Images used Arcpy (py2) and uses a line of code, as follows:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for lyr in arcpy.mapping.ListLayers(mxd, "", df):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;# Turn off layer (make non-visible)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lyr.visible = False&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I am looking for a Python API solution, not an arcpy solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Cultural Considerations:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I am a programmer who reads API documentation and I tend work with to the sad neglect of my mouse, a GUI and point-and-click methods (though I welcome all comments). Please consider me slightly new to GIS and my knowledge/exposure has tended to be 99.42% code-based and thus slightly illiterate in ArcMap terminology&amp;nbsp; (terminology which is often different in each of this multitude of APIS/languages).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2018 19:40:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-toggle-visibility-of-item-layer-in-a/m-p/847481#M3724</guid>
      <dc:creator>PhilipFrancis</dc:creator>
      <dc:date>2018-08-07T19:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to toggle visibility of item/layer in a feature service using ArcGIS API for Python (ver. 1.</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-toggle-visibility-of-item-layer-in-a/m-p/1001953#M5210</link>
      <description>Hi Philip, I know this is an old thread but I thought I'd respond anyway so at least a possible solution is posted. I'm using ArcGIS Python API ver 1.8.1 The process to do it is: #Get the list of layers from a web map from arcgis.mapping import WebMap wm = WebMap(wm_item) #List Layers wm.layers #Turn Layer visibility off for lyr in wm.layers: lyr.visibility = False</description>
      <pubDate>Mon, 16 Nov 2020 23:00:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-toggle-visibility-of-item-layer-in-a/m-p/1001953#M5210</guid>
      <dc:creator>DavinWalker2</dc:creator>
      <dc:date>2020-11-16T23:00:44Z</dc:date>
    </item>
  </channel>
</rss>

