-
Notifications
You must be signed in to change notification settings - Fork 820
/
index.ts
Latest commit
29 lines (25 loc) · 735 Bytes
/
index.ts
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
26
27
28
29
/**
* @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: google.maps.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" ) as google.maps.MapsLibrary;
map = new Map(document.getElementById( "map" ) as HTMLElement, {
center: { lat: -34.397, lng: 150.644 },
zoom: 8,
});
});
// [END maps_programmatic_load_promise]
// [END maps_programmatic_load]
export {};