forked from iTowns/itowns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
74 lines (61 loc) · 3.35 KB
/
index.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
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>Globe</title>
<style type="text/css">
html {height: 100%}
body { margin: 0; overflow:hidden; height:100%}
#viewerDiv {
margin : auto auto;
width: 100%;
height: 100%;
padding: 0;
}
#menuDiv {position: absolute; top:0px; margin-left: 0px;}
</style>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="examples/GUI/dat.gui/dat.gui.min.js"></script>
</head>
<body>
<div id="viewerDiv"></div>
<script src="examples/GUI/GuiTools.js"></script>
<script src="dist/itowns.js"></script>
<script src="dist/debug.js"></script>
<script type="text/javascript">
/* global itowns,document,GuiTools*/
var positionOnGlobe = { longitude: 2.351323, latitude: 48.856712, altitude: 25000000 };
// iTowns namespace defined here
var viewerDiv = document.getElementById('viewerDiv');
var globeView = new itowns.GlobeView(viewerDiv, positionOnGlobe);
var menuGlobe = new GuiTools('menuDiv', globeView);
menuGlobe.view = globeView;
var promises = []
promises.push(itowns.Fetcher.json('examples/layers/JSONLayers/Ortho.json').then(function(result) { return globeView.addLayer(result); }));
promises.push(itowns.Fetcher.json('examples/layers/JSONLayers/OrthosCRS.json').then(function(result) { return globeView.addLayer(result); }));
promises.push(itowns.Fetcher.json('examples/layers/JSONLayers/ScanEX.json').then(function(result) { return globeView.addLayer(result); }));
promises.push(itowns.Fetcher.json('examples/layers/JSONLayers/Region.json').then(function(result) { return globeView.addLayer(result); }));
promises.push(itowns.Fetcher.json('examples/layers/JSONLayers/WORLD_DTM.json').then(function(result) { return globeView.addLayer(result); }));
promises.push(itowns.Fetcher.json('examples/layers/JSONLayers/IGN_MNT_HIGHRES.json').then(function(result) { return globeView.addLayer(result); }));
menuGlobe.addGUI('RealisticLighting', false,
function(newValue) { globeView.setRealisticLightingOn(newValue); });
Promise.all(promises).then(function () {
menuGlobe.addImageryLayersGUI(globeView.getLayers(function (l) { return l.type === 'color'; }));
menuGlobe.addElevationLayersGUI(globeView.getLayers(function(l) { return l.type === 'elevation'; }));
console.info('menuGlobe initialized');
}).catch( function (e) { console.error(e) });
globeView.addEventListener(itowns.GLOBE_VIEW_EVENTS.GLOBE_INITIALIZED, function () {
// eslint-disable-next-line no-console
console.info('Globe initialized');
});
const d = new debug.Debug(globeView, menuGlobe.gui);
debug.createTileDebugUI(menuGlobe.gui, globeView, globeView.wgs84TileLayer, d);
window.globeView = globeView;
</script>
</body>
</html>