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.
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).
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:
for lyr in arcpy.mapping.ListLayers(mxd, "", df):
# Turn off layer (make non-visible)
lyr.visible = False
I am looking for a Python API solution, not an arcpy solution.
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 (terminology which is often different in each of this multitude of APIS/languages).