-
Notifications
You must be signed in to change notification settings - Fork 820
/
index.js
Latest commit
25 lines (23 loc) · 623 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
// [START maps_programmatic_load]
import { Loader } from "@googlemaps/js-api-loader";
let map;
const additionalOptions = {};
// [START maps_programmatic_load_promise]
const loader = new Loader({
apiKey: "YOUR_API_KEY",
version: "weekly",
...additionalOptions,
});
loader.load().then(async () => {
const { Map } = await google.maps.importLibrary( "maps" );
map = new Map(document.getElementById( "map" ), {
center: { lat: -34.397, lng: 150.644 },
zoom: 8,
});
});
// [END maps_programmatic_load]