-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
88 lines (70 loc) · 3.14 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!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>
body { margin: 0; }
canvas { width: 100%; height: 100% }
</style>
<style type="text/css">
body {
overflow:hidden;
}
</style>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.5.1/dat.gui.min.js"></script>
</head>
<body>
<script src="dist/itowns2.js"> </script>
<script type="text/javascript">
var initCenter = { lon:2.3465, lat: 48.88, alt: 25000000};
// iTowns namespace defined here
itowns.viewer.createSceneGlobe(initCenter) ;
// THIS IS AN EXAMPLE OF INTERFACE TO INTERACT WITH ITOWNS
var Menu = function() {
this.CloudsIR = false;
this.RealisticLighting = false;
this.StreetLevelImagery = false;
this.KML = false;
this.Layer = "OrthoGeoportail";
this.api = function(){
itowns.viewer.launchCommandApi();
};
};
var text = new Menu();
var gui = new dat.GUI();
gui.close();
gui.add(text, 'Layer', [ 'OrthoGeoportail', 'DarkMatterOSM' ] ).onChange(function(newValue) {
var layer, baseUrl;
switch(newValue){
case "OrthoGeoportail": layer = "ORTHOIMAGERY.ORTHOPHOTOS";
baseUrl = "http://wxs.ign.fr/";
break;
case "DarkMatterOSM" : layer = "dark_all/";
baseUrl = "http://a.basemaps.cartocdn.com/";
break;
}
itowns.viewer.setLayerAtLevel(baseUrl,layer,0); // set layer at level n (0 -> top)
});
gui.add(text, 'CloudsIR').onChange(function(newValue) {
itowns.viewer.showClouds(newValue);
});
gui.add(text, 'RealisticLighting').onChange(function(newValue) {
itowns.viewer.setRealisticLightingOn(newValue);
});
gui.add(text, 'KML').onChange(function(newValue) {
itowns.viewer.showKML(newValue);
});
gui.add(text, 'api');
gui.add(text, 'StreetLevelImagery').onChange(function(newValue) {
itowns.viewer.setStreetLevelImageryOn(newValue);
});
</script>
</body>
</html>