-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpolygon.html
43 lines (40 loc) · 1.42 KB
/
polygon.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
<!DOCTYPE HTML>
<html>
<head>
<script src="http://www.webglearth.com/v2/api.js"></script>
<script>
function initialize() {
var earth = new WE.map('earth_div');
WE.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',{
attribution: '© OpenStreetMap contributors'
}).addTo(earth);
var polygonA = WE.polygon([[49.5608, 5.811], [49.986, 5.723],
[50.190, 6.086], [49.781, 6.536], [49.468, 6.372], [49.560, 5.811]]
);
polygonA.addTo(earth);
var polygonB = WE.polygon([[46.15700, 5.9765625], [47.010, 6.525],
[47.480, 6.965], [47.805, 8.613], [47.442, 9.645], [47.085, 9.459],
[46.957, 10.447], [46.225, 10.140], [46.422, 9.272], [45.844, 9.030],
[46.445, 8.360], [45.935, 7.811], [45.851, 7.141], [46.430, 6.734],
[46.157, 5.976]], {
color: '#ff0',
opacity: 1,
fillColor: '#f00',
fillOpacity: 0.1,
editable: true,
weight: 2
}).addTo(earth);
earth.setView([48, 6], 5);
}
</script>
<style>
html, body{padding: 0; margin: 0;}
#earth_div{top: 0; right: 0; bottom: 0; left: 0;
background-color: #000; position: absolute !important;}
</style>
<title>WebGL Earth API: Polygon</title>
</head>
<body onload="initialize()">
<div id="earth_div"></div>
</body>
</html>