pbugnion / gmaps

Google maps for Jupyter notebooks
https://jupyter-gmaps.readthedocs.io/en/stable/
Other
760 stars 146 forks source link

Add support for google maps styles #330

Open krystofcelba opened 4 years ago

krystofcelba commented 4 years ago

Add possibility to set map style using JSON formatted string documented here.

Addresses #161 #124

Example:

import gmaps
gmaps.configure(api_key="AI...g")
fig = gmaps.figure(styles='''[{
            "featureType": "road",
            "elementType": "geometry",
            "stylers": [
                {
                    "visibility": "on"
                },
                {
                    "color": "#000000"
                }
            ]
    }]''')
fig

Or also possible to set style after initialization:

fig.styles = '''[{
            "featureType": "road",
            "elementType": "geometry",
            "stylers": [
                {
                    "visibility": "on"
                },
                {
                    "color": "#000000"
                }
            ]
    }]'''

image

timcoote commented 3 years ago

Am I correct in thinking that this PR could be used to remove layers, such as POI (like this: https://bit.ly/3mNJClg) ?