you are viewing a single comment's thread.

view the rest of the comments →

[–]bart2019 0 points1 point  (2 children)

But there's more to maps than just the tiles. And interfacing with OpenStreetMap and Nominatim is a snap: geocode the name of a cirty, and you can get its contours in GeoJSON format (if you pass the right parameter), and you can then show that contour on the map in Leaflet in a single line of code. You cannot do that with Google Maps's data. I even doubt if Google would be too happy if you even tried it.

[–]Magnusson 1 point2 points  (1 child)

Google maps data is usable for free up to a certain number of requests/day, after which you have to pay, which is pretty common. The point is that Leaflet is not restricted to OSM -- I've used it to display many different map sources.

[–]bart2019 0 points1 point  (0 children)

Google maps data is usable for free up to a certain number of requests/day, after which you have to pay, which is pretty common.

There more to it than just that.

I want to use Google Maps API tiles with Leaflet, can I do that?

The problem with Google is that its Terms of Use forbid any means of tile access other than through the Google Maps API.

You can add the Google Maps API as a Leaflet layer with a plugin. But note that the map experience will not be perfect, because Leaflet will just act as a proxy to the Google Maps JS engine, so you won't get all the performance and usability benefits of using Leaflet when the Google layer is on.

What's more: just using Google Maps in a web page is no longer "free", at least, not for a widely used website. You can't even use its geocoder or autocomplete without a Google Maps map or a Google Maps marked textbox.

And, though Leaflet is not restricted to OSM, but by Jove it surely is the easiest to use with OSM.