generated from HandsOnDataViz/leaflet-maps-with-google-sheets
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
executable file
·148 lines (102 loc) · 4.93 KB
/
index.html
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="./favicon.png">
<title>Loading the map...</title>
<!-- jQuery-->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
<!-- Load Leaflet CSS and JS-->
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin="" />
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"
integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script>
<!-- PapaParse -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/papaparse.min.js"></script>
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css">
<script src="https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/js/fontawesome.min.js"></script>
<!-- leaflet-providers-->
<script src="https://unpkg.com/[email protected]/leaflet-providers.js"></script>
<!-- Leaflet.awesome-markers v2.0.4, manually updated to svg to allow hex and material icons -->
<link rel="stylesheet" type="text/css" href="scripts/Leaflet.awesome-markers/dist/leaflet.awesome-markers.css">
<script type="text/javascript" src="scripts/Leaflet.awesome-markers/dist/leaflet.awesome-markers.js"></script>
<!-- Leaflet Markercluster -->
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/MarkerCluster.css">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/MarkerCluster.Default.css">
<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/leaflet.markercluster.js"></script>
<!-- Leaflet Markercluster layer support -->
<script src="https://unpkg.com/[email protected]/dist/leaflet.markercluster.layersupport.js"></script>
<!-- Leaflet control geocoder -->
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/Control.Geocoder.css" />
<script src="https://unpkg.com/[email protected]/dist/Control.Geocoder.js"></script>
<!-- Locate Control -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet-locatecontrol/0.72.0/L.Control.Locate.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet-locatecontrol/0.72.0/L.Control.Locate.min.js"></script>
<!-- jQuery-CSV -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-csv/1.0.11/jquery.csv.min.js"></script>
<!-- Custom style sheet -->
<link rel="stylesheet" type="text/css" href="style.css">
<!-- DataTables -->
<script src="https://cdn.datatables.net/1.10.22/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.22/css/jquery.dataTables.min.css" />
<!-- Material Icons -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Include the Singular Overlay JavaSrcipt library -->
<script src="https://app.singular.live/libs/singularoverlay/1.0.0/singularoverlay.js"></script>
</head>
<body>
<div class="loader">Loading...</div>
<div id="map"></div>
<table id="maptable" class="display"></table>
<script type="text/javascript">
var map = L.map('map', {
attributionControl: false,
zoomControl: false,
scrollWheelZoom: true,
tap: false
}).setView([41.76,-72.69], 11); // default center is overridden by Google Sheet options and points
//image overlay
var imageUrl = 'https://foxholestats.com/images/WorldMapControl.webp',
imageBounds = [[82.6, -180], [-82.6, 180]];
L.imageOverlay(imageUrl, imageBounds).addTo(map);
var imageUrl = 'media/SUBREGIONS.png',
imageBounds = [[82.6, -180], [-82.6, 180]];
L.imageOverlay(imageUrl, imageBounds).addTo(map);
//Coordinate Finder
var marker = L.marker([82.118384, -209.882813], {
draggable: true,
}).addTo(map);
marker.bindPopup('LatLng Marker').openPopup();
marker.on('dragend', function(e) {
marker.getPopup().setContent(marker.getLatLng().toString()).openOn(map);
});
// Storm Colors:
//THUNDER WATCH
// "#FFFF00"
//THUNDER ADVISORY
// "#FF9900"
//THUNDER WARNING
// "#FF0000"
//WINTER WARNING
// "#ff69b4"
//WINTER WATCH
// "#e692f8"
//WINTER ADVISORY
// "#7b68ee"
// hex radius: 2800000
// Storm Circles
// L.circle([0, 0], {radius: 2800000,
// fill: true,
// color: "#FFFF00"})
// .addTo(map);
</script>
</script>
<script type="text/javascript" src="./google-doc-url.js"></script>
<script type="text/javascript" src="./scripts/constants.js"></script>
<script type="text/javascript" src="./scripts/palette.js"></script>
<script type="text/javascript" src="./scripts/polylabel.js"></script>
<script type="text/javascript" src="./scripts/map.js"></script>
</body>
</html>