googlemaps / googlemaps/google-maps-services-python

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

Ouverte
#514 2 commentaires 4 réactions 0 personnes assignées Voir sur GitHub
triage me type: bug
Langage dominant
Python
Étoiles
5k
Forks
1.4k
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

I am trying to create a static map with different styles. I would like to turn some poi features off and others on. However, the current approach only accepts a dict and only renders one feature set.

In here (https://github.com/googlemaps/google-maps-services-python/blob/master/googlemaps/maps.py), style is supposed to accept list of dict. However, convert (https://github.com/googlemaps/google-maps-services-python/blob/master/googlemaps/convert.py#L208) only accepts a dict.

---

#### Steps to reproduce

#### Code example

```python
for chunk in gmaps.static_map(
size=(1024, 1024),
center=base_address_location,
style=[
{
"feature": "poi.business",
"visibility": "off",
},
{
"feature": "poi.schools",
"visibility": "off",
},
{
"feature": "poi.restaurants",
"visibility": "on",
},
],
zoom=15,
format="png",
markers=marker,
maptype="roadmap",
):
if chunk:
f.write(chunk)
f.close()
```

#### Stack trace
```
raise TypeError(
TypeError: Expected a dict for components, but got list
```

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.