-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWorldHospitals.html
139 lines (112 loc) · 6.2 KB
/
WorldHospitals.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
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>World Hospitals</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css"
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
crossorigin=""/>
<!-- Make sure you put this AFTER Leaflet's CSS -->
<script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js"
integrity="sha512-gZwIG9x3wUXg2hdXF6+rVkLF/0Vi9U8D2Ntg4Ga5I5BZpVkVxlJWbSQtXPSiUTtC0TjtGOmxa1AJPuV0CPthew=="
crossorigin=""></script>
<!-- <script src="heatmap.min.js"></script> -->
<script src="./JS/leaflet-heat.js"></script>
<link rel="stylesheet" href="./dist/MarkerCluster.css" />
<link rel="stylesheet" href="./dist/MarkerCluster.Default.css" />
<script src="./dist/leaflet.markercluster.js"></script>
<script src="./JS/WorldHospitalscoords.js" type="text/javascript"></script>
<script src="./JS/leaflet-sidebar.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.1/dist/leaflet.css" />
<!--[if lte IE 8]><link rel="stylesheet" href="https://cdn.leafletjs.com/leaflet-0.7.2/leaflet.ie.css" /><![endif]-->
<link rel="stylesheet" href="./CSS/leaflet-sidebar.css" />
<style>
#mapid { min-height: 100%; height: 100%; width: 100%; }
html, body { height: 100%; margin:0; }
</style>
</head>
<body>
<!-- Sidebar -->
<div id="sidebar" class="sidebar collapsed">
<!-- Nav tabs -->
<div class="sidebar-tabs">
<ul role="tablist">
<li><a href="#home" role="tab"><i class="fa fa-bars"></i></a></li>
<!--<li><a href="#profile" role="tab"><i class="fa fa-user"></i></a></li>-->
<!--<li class="disabled"><a href="#messages" role="tab"><i class="fa fa-envelope"></i></a></li>-->
<li><a href="https://github.com/LFGaming/WorldHospitals" role="tab" target="_blank"><i class="fa fa-github"></i></a></li>
</ul>
<ul role="tablist">
<li><a href="#settings" role="tab"><i class="fa fa-gear"></i></a></li>
</ul>
</div>
<!-- Tab panes -->
<div class="sidebar-content">
<div class="sidebar-pane" id="home">
<h1 class="sidebar-header">
sidebar-v2
<span class="sidebar-close"><i class="fa fa-caret-left"></i></span>
</h1>
<p>This is a map of the world where eventually we want all the hospitals market with a marker.</p>
</div>
<div class="sidebar-pane" id="profile">
<h1 class="sidebar-header">Profile<span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
</div>
<div class="sidebar-pane" id="messages">
<h1 class="sidebar-header">Messages<span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
</div>
<div class="sidebar-pane" id="settings">
<h1 class="sidebar-header">Settings<span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
</div>
</div>
</div>
<div id="mapid" class="sidebar-map"></div>
<script>
// var mymap = L.map('mapid', {layers: [tLayer, markerz]}).setView([52.07344, 5.13814], 13);
// L.control.layers(baseLayers, overlays).addTo(mymap);
var tLayer = L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoibGZnYW1pbmciLCJhIjoiY2tkNmM1azJ2MDU4ZDJ5dGc2YzIxZTZvaSJ9.xL24tk-KhvpMokUWxhEPGA', {
maxZoom: 18,
attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, ' +
'<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="https://www.mapbox.com/">Mapbox</a>, ' +
'<a href="https://github.com/LFGaming/WorldHospitals">Github</a>',
id: 'mapbox/streets-v11',
tileSize: 512,
zoomOffset: -1
}) //.addTo(mymap);
/* L.marker([52.09744, 5.13334]).addTo(mymap)
.bindPopup("<b>Hello world!</b><br />I am a popup.").openPopup(); */
var popup = L.popup();
function onMapClick(e) {
popup
.setLatLng(e.latlng)
.setContent("You clicked the map at " + e.latlng.toString())
.openOn(mymap);
}
var heat = L.heatLayer(hospitalsheat, {radius: 15});
var markers = new L.MarkerClusterGroup() //.bindPopup("<b>Hello world!</b><br>I am a popup.").openPopup();
var grayscale = L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoibGZnYW1pbmciLCJhIjoiY2tkNmM1azJ2MDU4ZDJ5dGc2YzIxZTZvaSJ9.xL24tk-KhvpMokUWxhEPGA', {id: 'mapbox/light-v9', tileSize: 512, zoomOffset: -1});
var streets = L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoibGZnYW1pbmciLCJhIjoiY2tkNmM1azJ2MDU4ZDJ5dGc2YzIxZTZvaSJ9.xL24tk-KhvpMokUWxhEPGA', {id: 'mapbox/streets-v11', tileSize: 512, zoomOffset: -1});
var baseLayers = {
"Grayscale": grayscale,
"Streets": streets
};
var overlays = {
"Hospitals": markers,
"Heatmap": heat
};
var x,y;
for (i in hospitalscoords) {
x = hospitalscoords[i][0];
y = hospitalscoords[i][1];
markers.addLayer(new L.Marker([x,y]));
};
var mymap = L.map('mapid', {layers: [tLayer, markers]}).setView([52.07344, 5.13814], 13);
L.control.layers(baseLayers, overlays).addTo(mymap);
mymap.on('click', onMapClick);
var sidebar = L.control.sidebar('sidebar').addTo(mymap);
</script>
</body>
</html>