āœŠšŸæ Black Lives Matter. Please consider donating to Black Girls Code today.
šŸ‡ Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

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