Skip to content

Map image layer within a web map item does not return 'layers' #2469

@PRichardson-CORE

Description

@PRichardson-CORE

Describe the bug
Map image layer within a web map does not return sub layers if the layer has not been configured with anything in the web map. The web map specification does not hydrate the web map item for these map image layers if there is no configuration, and requires an extra call to the map image layer item to get the sub layers.

To Reproduce
Steps to reproduce the behavior:

Add a map image layer with multiple layers within it to a new web map and save (do nothing else). Then run the below snippet.

from arcgis.gis import GIS
gis = GIS()
wm_item = gis.content.get('<itemid>')
lyrs = wm_item.get_data()['operationalLayers']
for operational_lyr in lyrs:
	if 'layers' in operational_lyr:
		# this should be unreachable
		print(operational_lyr['layers'])

Then, to compare behavior, go back to that web map in map viewer and enable popups on one of the sublayers. Re-run the snippet above and it will have the 'layers' key returned.

error:
N/A

Expected behavior
The map image layer in the web map item should have the 'layers' returned without having to manually configure anything on the sublayer first in Map Viewer.

Platform (please complete the following information):

  • OS: Windows
  • Browser: Edge
  • Python API Version [e.g. 1.6.2]: 2.4.1.1

Additional context
If you cannot get the sublayers from the map image layer via the web map item, you cannot update that sublayer in that specific web map without manually configuring one of the sublayers in Map Viewer first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions