-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
66 lines (64 loc) · 2.43 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
<html>
<head>
<title>CreekMap</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css"
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
crossorigin=""/>
<style type="text/css">
body {
padding: 0;
margin: 0;
}
#map {
position: absolute;
top:0;
left: 0;
width: 100vw;
height:100%;
}
</style>
<script src="https://unpkg.com/leaflet@1.5.1/dist/leaflet.js"
integrity="sha512-GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og=="
crossorigin=""></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
</head>
<body>
<div id="map"></div>
<script type="text/javascript">
// SM_URL = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
OSM_ATTRIB = '© <a href="https://openstreetmap.org/copyright">OpenStreetMap</a> contributors';
var southWest = L.latLng(37.4345,-122.3636),
northEast = L.latLng(37.9431,-121.8445),
bounds = L.latLngBounds(southWest, northEast);
// L.tileLayer(SM_URL, {attribution: OSM_ATTRIB,maxZoom: 18}).addTo(map)
var creeksLayer = L.tileLayer('https://kueda.github.io/creekmap/tiles/{z}/{x}/{y}.png', {
"attribution": "Creek data from the <a href='https://museumca.org/creeks/'>Oaklnd Museum of California</a>",
"center": "-122.1738,37.7478,13",
"bounds": bounds,
"minzoom": "12",
"version": "1.0.0",
"maxzoom": "16",
"name": "Creek Map"
})
var stamenTonerLite = L.tileLayer('https://stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}.png', {
attribution: 'Map tiles by <a href="https://stamen.com">Stamen Design</a>, <a href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
subdomains: 'abcd',
minZoom: 0,
maxZoom: 20
});
var map = L.map('map', {
minZoom: 12,
maxZoom: 16,
layers: [creeksLayer,stamenTonerLite]
}).setView([37.8027, -122.2587], 13)
stamenTonerLite.setOpacity(0.5)
creeksLayer.bringToFront()
// map.addLayer(creeksLayer)
// L.control.layers({
// 'Base': googleLayer
// }, {
// 'Creeks': creeksLayer
// }).addTo(map)
</script>
</body>
</html>