Skip to content

Map object | MapContent object | update_layer() method not working in 2.4.3 #2510

@Clubdebambos

Description

@Clubdebambos

Describe the bug
In 2.4.2 the Map object, MapContent object, update_layer() worked just fine. In 2.4.3, the same workflows fail to run.

The layer is not a group layer or a layer in a group.

To Reproduce
Steps to reproduce the behavior:

from arcgis.gis import GIS
from arcgis.map import Map

agol = GIS("home")

wm_item = agol.content.get("WM_ITEM_ID")

webmap = Map(wm_item)

options_dict = {
    "title" : "National Inventory of Architectural Heritage (NIAH)"
}

## fails here
webmap.content.update_layer(
    index=0,
    options=options_dict
)

webmap.update()

error:

Traceback (most recent call last):
  File "C:\ArcGISAFP_03\Python_Scripts\Completed\07_Layer_Settings\rename_layer.py", line 61, in <module>
    webmap.content.update_layer(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        index=lyr_index,
        ^^^^^^^^^^^^^^^^
        options=options_dict
        ^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\map\map_widget.py", line 2230, in update_layer
    self._helper.update_layer(
    ~~~~~~~~~~~~~~~~~~~~~~~~~^
        index,
        ^^^^^^
    ...<5 lines>...
        form,
        ^^^^^
    )
    ^
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\map\_utils.py", line 1972, in update_layer
    if isinstance(layer, group_layer.BaseGroup):
                         ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'bool' object has no attribute 'BaseGroup'

Screenshots
If applicable, add screenshots to help explain your problem.

Image

Expected behavior
The above is simply attempting to rename a layer. Worked perfect in 2.4.2 and fails in 2.4.3

Platform (please complete the following information):

  • OS: Windows 11
  • Browser: Chrome / Edge
  • Python API Version: 2.4.3

Additional context
Add any other context about the problem here, attachments etc.

Metadata

Metadata

Assignees

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