Skip to content
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

Add support for google maps styles #330

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

krystofcelba
Copy link

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
Copy link

timcoote commented Dec 5, 2020

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

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.

2 participants