-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathleaflet.html
79 lines (69 loc) · 2.68 KB
/
leaflet.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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Add a WMS source-Leaflet</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<!-- this form is more secure -->
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ==" crossorigin="" />
<script src="https://unpkg.com/[email protected]/dist/leaflet.js" integrity="sha512-/Nsx9X4HebavoBvEBuyp3I7od5tA0UzAxs+j83KgC8PU0kgB4XiK4Lfe4y4cgBtaRJQEIFCW+oC506aPT2L1zw==" crossorigin=""></script>
<!-- <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" /> -->
<!-- <script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script> -->
<style>
body {
margin: 0;
padding: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
</style>
</head>
<body>
<div id='map'></div>
<script>
//lat and long swapped in leaflet.
var map = L.map('map').setView([40.6892, -74.5447], 8);
//alternate way to load map
// var map = L.map('map',{
// container: 'map',
// style: 'mapbox://styles/mapbox/light-v9',
// zoom: 8,
// center: [ 40.6892,-74.5447]
// });
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoiZGF2ZWlzbSIsImEiOiJCdjUxT0FzIn0.V9oIk_wUc4uZu7UBblR8mw', {
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>',
maxZoom: 18,
id: 'mapbox.streets'
}).addTo(map);
var NAExposureIndex = L.tileLayer.wms('https://gis.nemac.org/nfwf?', {
layers: 'NA_ExposureIndex',
format: 'image/png',
transparent: true,
crs: L.CRS.EPSG3857
}, 'aeroway-taxiway'),
//is there a way to do the aeroway-taxiway overlay like in mapbox?
NAThreatIndex = L.tileLayer.wms('https://gis.nemac.org/nfwf?', {
layers: 'NA_ThreatIndex_Ramp',
format: 'image/png',
transparent: true,
crs: L.CRS.EPSG3857
}, 'aeroway-taxiway'),
NAAssetIndex = L.tileLayer.wms('https://gis.nemac.org/nfwf?', {
layers: 'NA_AssetIndex',
format: 'image/png',
transparent: true,
crs: L.CRS.EPSG3857
}, 'aeroway-taxiway');
var baseMaps = {
"NA Asset Index": NAAssetIndex,
"NA Threat Index": NAThreatIndex,
"NA Exposure Index": NAExposureIndex
};
L.control.layers(baseMaps).addTo(map);
</script>
</body>
</html>