-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathindex.ts
More file actions
executable file
·39 lines (34 loc) · 1.12 KB
/
index.ts
File metadata and controls
executable file
·39 lines (34 loc) · 1.12 KB
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
31
32
33
34
35
36
37
38
39
/**
* @license
* Copyright 2026 Google LLC. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
// [START maps_control_positioning]
const mapElement = document.querySelector('gmp-map') as google.maps.MapElement;
let innerMap;
async function initMap() {
// Request needed libraries.
(await google.maps.importLibrary('maps')) as google.maps.MapsLibrary;
// Get the inner map.
const innerMap = mapElement.innerMap;
// Set the map's controls options.
innerMap.setOptions({
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
position: google.maps.ControlPosition.BLOCK_START_INLINE_CENTER,
},
zoomControl: true,
zoomControlOptions: {
position: google.maps.ControlPosition.INLINE_START_BLOCK_CENTER,
},
scaleControl: true,
streetViewControl: true,
streetViewControlOptions: {
position: google.maps.ControlPosition.INLINE_START_BLOCK_START,
},
fullscreenControl: true,
});
}
initMap();
// [END maps_control_positioning]