Skip to content

Updating popupInfo (Map) via the PopupManager info property returns an AttributeError #2295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Clubdebambos opened this issue May 26, 2025 · 2 comments
Labels

Comments

@Clubdebambos
Copy link

Describe the bug
I should be able to set the popupInfo for a layer in a WebMap using the PopupManager info property as per the docs here

Instead I get an AttributeError

To Reproduce
Steps to reproduce the behavior:

A simplified version below where the .info should accept the PopupInfo object extracted from the .info itself.

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)

popup_info = webmap.content.popup(index=2).info

## I would generally edit some components here, the error is the same regardless
## The .info should accept the original PopupInfo without error

webmap.content.popup(index=2).info = popup_info ## error here

status = webmap.update()

print(status)

error:

AttributeError: 'MapContent' object has no attribute '_map'

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

Expected behavior
The .info should accept the PopupInfo object without error.

Platform (please complete the following information):

  • OS: Window 11 Home
  • Browser Chrome
  • Python API Version 2.4.0

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

@nanaeaubry
Copy link
Contributor

@Clubdebambos Thanks for finding this, sorry for the inconvenience but you can use the edit method as a workaround for now

@Clubdebambos
Copy link
Author

Hi @nanaeaubry, the edit method is not all encompassing. It does not cater for ReleatedRecordsInfo, hence the need to be able to update via the .info with a PopupInfo object. The workaround is to edit the JSON Definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants