-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
97 lines (89 loc) · 2.5 KB
/
Copy pathindex.html
File metadata and controls
97 lines (89 loc) · 2.5 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>GoogleMaps</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="controls" class="nicebox">
<div>
<select id="census-variable">
<option
value=
>
Cost of Living
</option>
<option
value=
>
</option>
<option
value=
>
</option>
<option
value=
>
</option>
<option
value=
>
</option>
</select>
</div>
<div id="legend">
<div id="census-min">min</div>
<div class="color-key"><span id="data-caret">◆</span></div>
<div id="census-max">max</div>
</div>
</div>
<div id="data-box" class="nicebox">
<label id="data-label" for="data-value"></label>
<span id="data-value"></span>
</div>
<div id="map"></div>
<script defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyC75kqs_RD694ILnPBt0cOAsyzQwpSBfaU&callback=initMap"
></script>
<script src="script.js"></script>
<script>function initMap() {
var options = {
center: myLngLat,
zoom: 4,
styles: mapStyle,
};
var map = new google.maps.Map(document.getElementById('map'), options)
var geoCoder = new google.maps.Geocoder();
var marker = new google.maps.Marker({
position: myLngLat,
map:map,
draggable: true
});
map.data.loadGeoJson('https://s3.amazonaws.com/rawstore.datahub.io/23f420f929e0e09c39d916b8aaa166fb.geojson');
map.data.setStyle({
fillColor: 'green',
strokeWeight: 0.7,
strokeColor: 'white',
strokeOpacity: 0.4
});
map.data.addListener('mouseover', function(e) {
map.data.overrideStyle(e.feature, {strokeWeight: 2.5, strokeOpacity: 1})
map.data.addListener('mouseout', function(e) {
map.data.overrideStyle(e.feature, {strokeWeight: 0.7, strokeOpacity: 0.4})
});
});
map.data.addListener('click', function(e) {
lat = e.latLng.lng();
lng = e.latLng.lat();
console.log(lat, lng);
});
loadMapShapes();
}
</script>
<script type="module" src="./script.js">import { Dataset } from './data.js';</script>
</body>
</html>