forked from sentinel-hub/custom-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example1.html
72 lines (59 loc) · 1.96 KB
/
example1.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge, chrome=1" />
<title>Sentinel Hub WMS services with Leaflet</title>
<style>
html,
body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}
#devTestingDemo {
height: 100%;
width: 100%;
}
</style>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.2.0/leaflet.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.2.0/leaflet.js"></script>
</head>
<body>
<div id="devTestingDemo"></div>
<script>
// OpenStreetMap
let osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
});
// Sentinel Hub WMS service
// tiles generated using EPSG:3857 projection - Leaflet takes care of that
let baseUrl = "https://services.sentinel-hub.com/ogc/wms/bfbfc449-320a-4a56-b493-61c9d4fc67e8";
let sentinelHub = L.tileLayer.wms(baseUrl, {
tileSize: 512,
attribution: '© <a href="http://www.sentinel-hub.com/" target="_blank">Sentinel Hub</a>',
maxcc:20,
minZoom:6,
maxZoom:16,
preset:"IW-DV-VV-LINEAR-GAMMA0-ORTHORECTIFIED",
layers:"IW-DV-VV-LINEAR-GAMMA0-ORTHORECTIFIED",
time:"2018-06-01/2019-03-30",
evalscripturl:"https://raw.githubusercontent.com/sentinel-hub/custom-scripts/master/sentinel-1/seldom_and_regular_water_surface_detection/seldom_and_regular_water_surface_detection.js",
temporal: true,
});
let baseMaps = {
'OpenStreetMap': osm
};
let overlayMaps = {
'Sentinel Hub WMS': sentinelHub
}
let map = L.map('devTestingDemo', {
center: [39.31969083394751, -94.8281478881836], // lat/lng in EPSG:4326
zoom: 12,
layers: [osm, sentinelHub]
});
L.control.layers(baseMaps, overlayMaps).addTo(map);
</script>
</body>
</html>