Can google map be connected as Mapbox-gl base layer?

Viewed 1308

Trying to create 3d-like google map. Hence i'm searching for something like 3d leaflet, where you can choose base layer provider (google, bing or openstreetmap)

The question is if having google map as base layer is possible with mapbox gl js?

(regardless of policy)

1 Answers

Generally speaking, if you can find a source of raster tiles in EPSG:3857, accessible by URLs that conform to the XYZ tile numbering scheme, then you can use it as a raster tile source in Mapbox-GL-JS.

From what I know of Google Maps, it mostly uses vector tiles these days, although there is some kind of raster tile service in the mix. It's in the right projection (which Google pretty much invented, after all), but I don't think it is accessible by XYZ. I see URLs that look like this:

https://www.google.com/maps/vt/pb=!1m4!1m3!1i15!2i29569!3i20111!2m3!1e0!2sm!3i450157898!3m7!2sen!5e1105!12m4!1e68!2m2!1sset!2sRoadmap!4e0!5m1!1e0!23i4111425!23i1358757!23i1358902

So, probably no, unless you can find a way around that.

And, as you suggest, doing this would certainly violate Google's terms and conditions, and possibly Mapbox's as well.

Related