forked from sommergeo/geo77_leaflet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathearthquakes_5.html
78 lines (66 loc) · 2.69 KB
/
earthquakes_5.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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- set the charset -->
<meta charset="utf-8">
<!-- set make the map responsive -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="initial-scale=1,user-scalable=no,maximum-scale=1,width=device-width">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- set the title shown in the browser tab -->
<title>Earthquake Map</title>
<!-- Links to the leaflet CSS and JS -->
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
crossorigin=""/>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"
integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
crossorigin=""></script>
<!-- External data -->
<script src="earthquake_points.js"></script>
<!-- styles for elements html and body: fullscreen -->
<style>
html, body {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
}
</style>
</head>
<body>
<!-- set the div element containing the map -->
<div id="mapid" style="width: 100%; height: 100%; padding: 0; margin: 0;"></div>
<script>
// Create Leaflet map
var mymap = L.map('mapid').setView([51.5, 11.5], 6);
// Add basemaps
// basemap 1:
var osm_basemap = L.tileLayer('https://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png', {
attribution: '<a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(mymap);
// basemap 2:
var otm_basemap = L.tileLayer('https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', {
attribution: '<a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: © <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)'
});
// basemap 3:
var osmint_basemap = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(mymap);
// Basemap dictonary
var basemaps = {
"Open Street Map DE": osm_basemap,
"Open Topo Map": otm_basemap,
"Open Street Map INT": osmint_basemap
};
// Add earthquake points
var overlay_eq_points = L.geoJSON(eq_points).addTo(mymap);
// Layer control
var legend = L.control.layers(basemaps,null,{collapsed: false}).addTo(mymap);
// Scale
var scale = L.control.scale({maxWidth: 150, metric: true, imperial: true}).addTo(mymap);
</script>
</body>
</html>