-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathleaflet.html
More file actions
73 lines (61 loc) · 2.78 KB
/
Copy pathleaflet.html
File metadata and controls
73 lines (61 loc) · 2.78 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
<!DOCTYPE html>
<html>
<head>
<title>Leaflet Layers Control Example</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.5/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.5/leaflet.js"></script>
<style>
html, body {
height: 100%;
}
#map {
height: 100%;
}
</style>
</head>
<body style="height: 100%">
<div id="map" style="width: 100%"></div>
<script>
var cities = new L.LayerGroup();
L.marker([39.61, -105.02]).bindPopup('This is Littleton, CO.').addTo(cities),
L.marker([39.74, -104.99]).bindPopup('This is Denver, CO.').addTo(cities),
L.marker([39.73, -104.8]).bindPopup('This is Aurora, CO.').addTo(cities),
L.marker([39.77, -105.23]).bindPopup('This is Golden, CO.').addTo(cities);
var nlcdUrl = 'http://localhost:8888/tms/C2SO5IA/{z}/{x}/{y}.png?breaks=nlcd';
var elevationUrl = 'http://localhost:8888/tms/GVWWZ5Y/{z}/{x}/{y}.png';
var nlcdFocalUrl = 'http://localhost:8888/tms/ZMW45WI/{z}/{x}/{y}.png?breaks=nlcd';
var nlcdForestMaskUrl = 'http://localhost:8888/tms/DCSDYMY/{z}/{x}/{y}.png?breaks=nlcd';
var roughnessUrl = 'http://localhost:8888/tms/QF3NRRA/{z}/{x}/{y}.png?breaks=tr';
var baseMbUrl = 'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6IjZjNmRjNzk3ZmE2MTcwOTEwMGY0MzU3YjUzOWFmNWZhIn0.Y8bhBaUMqFiPrDRW9hieoQ';
var base = new L.TileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_nolabels/{z}/{x}/{y}.png', {
attribution: 'Raster Foundry | Map data © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://cartodb.com/attributions">CartoDB</a>',
maxZoom: 18
});
var layerOpacity = 0.5;
var nlcd = L.tileLayer(nlcdUrl, {maxNativeZoom: 13, opacity: layerOpacity});
var elevation = L.tileLayer(elevationUrl, {maxNativeZoom: 13});
var nlcd_focal = L.tileLayer(nlcdFocalUrl, {maxNativeZoom: 13, opacity: layerOpacity});
var nlcd_forest = L.tileLayer(nlcdForestMaskUrl, {maxNativeZoom: 13, opacity: layerOpacity});
var roughness = L.tileLayer(roughnessUrl, {maxNativeZoom: 13});
var map = L.map('map', {
center: [39.9500, -75.1667],
zoom: 12,
layers: [nlcd]
});
map.addLayer(base)
var baseLayers = {
"nlcd": nlcd,
"elevation": elevation,
"nlcd_focal": nlcd_focal,
"nlcd_forest": nlcd_forest,
"Roughness": roughness
};
var overlays = {
"Cities": cities
};
L.control.layers(baseLayers, overlays).addTo(map);
</script>
</body>
</html>