-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathdemo.js
More file actions
31 lines (25 loc) · 715 Bytes
/
demo.js
File metadata and controls
31 lines (25 loc) · 715 Bytes
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
30
/**
* @license
* Copyright 2026 Google LLC. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
// Import the needed libraries.
import { setOptions, importLibrary } from '@googlemaps/js-api-loader';
const API_KEY = 'AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8';
async function initMap() {
// Set loader options.
setOptions({
key: API_KEY,
v: 'weekly',
});
// Load the Maps library.
const { Map } = (await importLibrary('maps'));
// Set map options.
const mapOptions = {
center: { lat: 48.8566, lng: 2.3522 },
zoom: 3,
};
// Declare the map.
const map = new Map(document.getElementById('map'), mapOptions);
}
initMap();