-
Notifications
You must be signed in to change notification settings - Fork 824
/
Copy pathindex.ts
39 lines (34 loc) · 936 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
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_layer_data_style]
let map: google.maps.Map;
function initMap(): void {
map = new google.maps.Map(document.getElementById("map") as HTMLElement, {
zoom: 4,
center: { lat: -28, lng: 137 },
});
// [START maps_layer_data_style_script_snippet_load]
// Load GeoJSON.
map.data.loadGeoJson(
"https://storage.googleapis.com/mapsdevsite/json/google.json"
);
// [END maps_layer_data_style_script_snippet_load]
// [START maps_layer_data_style_script_snippet_style]
// Set the stroke width, and fill color for each polygon
map.data.setStyle({
fillColor: "green",
strokeWeight: 1,
});
// [END maps_layer_data_style_script_snippet_style]
}
declare global {
interface Window {
initMap: () => void;
}
}
window.initMap = initMap;
// [END maps_layer_data_style]
export {};