-
Notifications
You must be signed in to change notification settings - Fork 840
Expand file tree
/
Copy pathindex.ts
More file actions
39 lines (34 loc) · 936 Bytes
/
index.ts
File metadata and controls
39 lines (34 loc) · 936 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
31
32
33
34
35
36
37
38
39
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
// [START maps_js_local_context_basic]
let map: google.maps.Map;
function initMap() {
// [START maps_js_local_context_basic_instantiation]
const localContextMapView = new google.maps.localContext.LocalContextMapView({
element: document.getElementById("map"),
placeTypePreferences: [
{ type: "restaurant" },
{ type: "tourist_attraction" },
],
maxPlaceCount: 12,
});
// [END maps_js_local_context_basic_instantiation]
map = localContextMapView.map!;
// [START maps_js_local_context_basic_set_options]
map.setOptions({
center: { lat: 51.507307, lng: -0.08114 },
zoom: 14,
});
// [END maps_js_local_context_basic_set_options]
}
declare global {
interface Window {
initMap: () => void;
}
}
window.initMap = initMap;
// [END maps_js_local_context_basic]
export {};