fromUrl

Creates an ImageryProvider which provides 2D global tiled imagery from Google 2D Tiles.

// Use your own Google api key
GoogleMaps.defaultApiKey = "your-api-key";

const googleTilesProvider = Google2DImageryProvider.fromUrl({
mapType: "satellite"
});
// Google 2D roadmap overlay with custom styles
GoogleMaps.defaultApiKey = "your-api-key";

const googleTileProvider = Google2DImageryProvider.fromUrl({
overlayLayerType: "layerRoadmap",
styles: [
{
stylers: [{ hue: "#00ffe6" }, { saturation: -20 }],
},
{
featureType: "road",
elementType: "geometry",
stylers: [{ lightness: 100 }, { visibility: "simplified" }],
},
],
});

Return

A promise that resolves to the created Google2DImageryProvider.

See also