-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Using GoogleMaps Tile instead of default folium map tiles #2079
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
Comments
Not sure what you are talking about really, and I don't have an API key so I can't verify. Are you sure the url you use is correct? You are likely not supposed to put those numbers into the url. Instead it should look something like this: If there is an issue here, it's likely in somewhere between Leaflet and the Google API. Not much we can do in Folium. |
I guess the question then becomes - are Leaflet plugins supported by Folium? I see a lot of Google Maps related plugins at https://leafletjs.com/plugins.html such as https://gitlab.com/IvanSanchez/Leaflet.GridLayer.GoogleMutant. Also, Google returns one tile at a time - which means we have to fetch a lot of high resolution X-Y tiles to compose the map for a given location at a given Zoom. |
I agree with @Conengmo that there are a few issues in the code sample you sent us. You might want to try the following first: You should not hardcode the The other issue (the older style tiles) is highly unlikely to be Folium related. Folium is just a thin wrapper around Leaflet. As stated, we just pass a url string to Leaflet to tell it where to fetch the tiles. I know this is a hard ask, but for issues like this, I want to see a working example in pure Leaflet before accepting this as a Folium issue. |
Thank you @Conengmo and @hansthen - the following worked
It would be great to add them to official documentation because there are many versions floating around on random youtube videos :) |
Good to hear it worked! And thanks for the suggestion, I opened a PR to expand our documentation on this topic a little bit. |
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Expected behavior
Map1 shouldn't work at all without credentials but it does open something weird - a grid of copies of the desired tile's thumbnail. Probably a google authentication error? The tiles are of the newer upcoming style.
Map2 gives the same error - a grid of copies of the desired tile's thumbnail. The tiles are of the current, older style.
This is likely a folium error?
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
Possible solutions
List any solutions you may have come up with.
folium is maintained by volunteers. Can you help making a fix for this issue?
The text was updated successfully, but these errors were encountered: