-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmap-tiler.html
33 lines (31 loc) · 1.05 KB
/
map-tiler.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
<!DOCTYPE HTML>
<html>
<head>
<script src="http://www.webglearth.com/v2/api.js"></script>
<script>
function initialize() {
var bounds = [[35.98245136, -112.26379395], [36.13343831, -112.10998535]];
var earth = new WE.map('earth_div');
earth.setView([36.057944835, 112.18688965], 1);
var osm = WE.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',{
attribution: '© OpenStreetMap contributors'
}).addTo(earth);
var grandcanyon = WE.tileLayer('http://tileserver.maptiler.com/grandcanyon/{z}/{x}/{y}.png', {
bounds: bounds,
minZoom: 10,
maxZoom: 16
});
grandcanyon.addTo(earth);
earth.panInsideBounds(bounds);
}
</script>
<style>
html, body{padding: 0; margin: 0;}
#earth_div{top: 0; right: 0; bottom: 0; left: 0; position: absolute !important;}
</style>
<title>WebGL Earth API: Maps rendered with MapTiler</title>
</head>
<body onload="initialize()">
<div id="earth_div"></div>
</body>
</html>