Skip to content

fix(maps): support list of dicts for static_map style - #556

Open
M-Colley wants to merge 1 commit into
googlemaps:masterfrom
M-Colley:fix/issue-514-static-map-style-list
Open

M-Colley wants to merge 1 commit into
googlemaps:masterfrom
M-Colley:fix/issue-514-static-map-style-list

Conversation

@M-Colley

@M-Colley M-Colley commented Dec 2, 2026

Copy link
Copy Markdown

Passing a list of style dictionaries to static_map raises TypeError: Expected a dict for components, but got list because static_map passes style directly to convert.components. Fixes #514.

Updated static_map in googlemaps/maps.py to convert each dictionary in convert.as_list(style) via convert.components so single-dict and list-of-dict style arguments serialize as style query parameters. Added regression tests in tests/test_maps.py covering list-of-dict styles, single-dict styles, and invalid non-dict inputs.

Ran python -m pytest tests/test_maps.py tests/test_convert.py -o addopts= -W default (22 passed in 0.11s).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Static maps style only accepts a dict instead of a list of dict

1 participant