Add GoogleMaps layer with Google API key

Iā€™m adding Google maps layers to my application via this layout:

var layout = {
  mapbox: {
    style: "white-bg",
    layers:  [{ sourcetype:"raster", source: [ config.googleMapslayers.url + "=m&x={x}&y={y}&z={z}" ], below:"traces" }],
    center: { lat: -37.6, lon: 147.7852 },
    zoom: 6
  },

That works, but it is illegal. I would prefer to pass my API key to the Google maps server, and hit their API instead of a server directly, so I can be legal and not hit my use limit. Is there currently a way of doing that via configuration?

1 Like

Hello,

I have exactly the same question. I want use the satellite view of google map but legaly. Where can we put the API KEY of google map with dash leaflet ?

Thanks.