itowns 2.36.2 → 2.38.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +30 -17
- package/README.md +12 -1
- package/changelog.md +138 -0
- package/dist/debug.js +1 -1
- package/dist/debug.js.LICENSE.txt +2 -2
- package/dist/debug.js.map +1 -1
- package/dist/itowns.js +1 -1
- package/dist/itowns.js.LICENSE.txt +2 -2
- package/dist/itowns.js.map +1 -1
- package/dist/itowns_widgets.js +2 -0
- package/dist/itowns_widgets.js.map +1 -0
- package/examples/config.json +28 -6
- package/examples/css/example.css +21 -1
- package/examples/css/widgets.css +360 -0
- package/examples/geoid_geoidLayer.html +102 -0
- package/examples/images/code-logo.svg +43 -0
- package/examples/index.html +5 -5
- package/examples/itowns-potree.html +252 -0
- package/examples/js/GUI/GuiTools.js +17 -0
- package/examples/mars.html +0 -1
- package/examples/misc_orthographic_camera.html +7 -19
- package/examples/source_file_from_fetched_data.html +90 -0
- package/examples/source_file_from_format.html +85 -0
- package/examples/source_file_from_methods.html +87 -0
- package/examples/source_file_from_parsed_data.html +104 -0
- package/examples/source_file_geojson_raster.html +21 -45
- package/examples/source_file_gpx_raster.html +28 -36
- package/examples/source_file_kml_raster.html +1 -4
- package/examples/source_file_shapefile.html +39 -34
- package/examples/source_stream_wfs_25d.html +21 -13
- package/examples/source_stream_wfs_3d.html +21 -12
- package/examples/source_stream_wfs_raster.html +20 -20
- package/examples/vector_tile_3d_mesh.html +155 -0
- package/examples/vector_tile_raster_3d.html +0 -5
- package/examples/view_25d_map.html +6 -19
- package/examples/view_2d_map.html +6 -19
- package/examples/view_3d_map.html +106 -81
- package/examples/view_immersive.html +13 -14
- package/examples/widgets_minimap.html +124 -0
- package/examples/widgets_navigation.html +124 -0
- package/examples/widgets_scale.html +96 -0
- package/examples/widgets_searchbar.html +124 -0
- package/lib/Controls/GlobeControls.js +13 -0
- package/lib/Controls/PlanarControls.js +11 -43
- package/lib/Converter/Feature2Mesh.js +203 -45
- package/lib/Converter/convertToTile.js +13 -4
- package/lib/Core/3DTiles/C3DTBoundingVolume.js +4 -1
- package/lib/Core/Deprecated/Undeprecator.js +1 -1
- package/lib/Core/Feature.js +60 -34
- package/lib/Core/Geographic/Extent.js +1 -1
- package/lib/Core/Geographic/GeoidGrid.js +143 -0
- package/lib/Core/MainLoop.js +137 -63
- package/lib/Core/Math/Ellipsoid.js +1 -1
- package/lib/Core/Prefab/Globe/SkyShader.js +3 -1
- package/lib/Core/Prefab/Planar/PlanarLayer.js +3 -1
- package/lib/Core/Style.js +1 -1
- package/lib/Core/TileGeometry.js +3 -1
- package/lib/Core/TileMesh.js +32 -22
- package/lib/Core/View.js +81 -15
- package/lib/Layer/ElevationLayer.js +6 -2
- package/lib/Layer/FeatureGeometryLayer.js +36 -7
- package/lib/Layer/GeoidLayer.js +142 -0
- package/lib/Layer/GeometryLayer.js +6 -54
- package/lib/Layer/InfoLayer.js +1 -1
- package/lib/Layer/Layer.js +1 -1
- package/lib/Layer/LayerUpdateStrategy.js +1 -1
- package/lib/Layer/OrientedImageLayer.js +1 -0
- package/lib/Layer/PotreeLayer.js +3 -1
- package/lib/Layer/RasterLayer.js +3 -1
- package/lib/Layer/ReferencingLayerProperties.js +50 -0
- package/lib/Layer/TiledGeometryLayer.js +3 -1
- package/lib/Main.js +214 -174
- package/lib/MainBundle.js +1 -1
- package/lib/Parser/B3dmParser.js +5 -3
- package/lib/Parser/GDFParser.js +118 -0
- package/lib/Parser/GTXParser.js +92 -0
- package/lib/Parser/GeoJsonParser.js +29 -7
- package/lib/Parser/ISGParser.js +121 -0
- package/lib/Parser/LASParser.js +3 -1
- package/lib/Parser/VectorTileParser.js +4 -3
- package/lib/Parser/XbilParser.js +1 -1
- package/lib/Parser/deprecated/LegacyGLTFLoader.js +1 -1
- package/lib/Process/3dTilesProcessing.js +2 -2
- package/lib/Process/FeatureProcessing.js +38 -86
- package/lib/Process/LayeredMaterialNodeProcessing.js +16 -7
- package/lib/Process/ObjectRemovalHelper.js +4 -0
- package/lib/Provider/3dTilesProvider.js +2 -7
- package/lib/Provider/Fetcher.js +4 -1
- package/lib/Provider/TileProvider.js +18 -2
- package/lib/Provider/URLBuilder.js +1 -1
- package/lib/Renderer/Camera.js +33 -12
- package/lib/Renderer/ColorLayersOrdering.js +3 -1
- package/lib/Renderer/LayeredMaterial.js +34 -9
- package/lib/Renderer/OBB.js +22 -25
- package/lib/Renderer/OrientedImageMaterial.js +8 -5
- package/lib/Renderer/PointsMaterial.js +6 -6
- package/lib/Renderer/RasterTile.js +1 -1
- package/lib/Renderer/RenderMode.js +3 -1
- package/lib/Renderer/Shader/ShaderChunk.js +5 -1
- package/lib/Renderer/Shader/ShaderUtils.js +4 -2
- package/lib/Renderer/c3DEngine.js +9 -6
- package/lib/Source/C3DTilesSource.js +3 -1
- package/lib/Source/EntwinePointTileSource.js +3 -1
- package/lib/Source/FileSource.js +8 -1
- package/lib/Source/PotreeSource.js +3 -1
- package/lib/Source/Source.js +15 -10
- package/lib/Source/VectorTilesSource.js +5 -0
- package/lib/Source/WFSSource.js +9 -3
- package/lib/Source/WMTSSource.js +3 -1
- package/lib/ThreeExtended/{WebGL.js → capabilities/WebGL.js} +8 -7
- package/lib/ThreeExtended/loaders/GLTFLoader.js +88 -39
- package/lib/Utils/CameraUtils.js +11 -1
- package/lib/Utils/DEMUtils.js +4 -2
- package/lib/Utils/FeaturesUtils.js +8 -4
- package/lib/Utils/gui/Main.js +39 -0
- package/lib/Utils/gui/Minimap.js +197 -0
- package/lib/Utils/gui/Navigation.js +322 -0
- package/lib/Utils/gui/Scale.js +154 -0
- package/lib/Utils/gui/Searchbar.js +299 -0
- package/lib/Utils/gui/Widget.js +119 -0
- package/package.json +32 -27
- package/examples/js/Scale.js +0 -40
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
/* ---------- GENERIC WIDGET SETTINGS : ----------------------------------------------------------------------------- */
|
|
2
|
+
|
|
3
|
+
/* Define widget position according to its position settings. */
|
|
4
|
+
.top-widget {
|
|
5
|
+
top: 10px;
|
|
6
|
+
}
|
|
7
|
+
.bottom-widget {
|
|
8
|
+
bottom: 10px;
|
|
9
|
+
}
|
|
10
|
+
.left-widget {
|
|
11
|
+
left: 10px;
|
|
12
|
+
}
|
|
13
|
+
.right-widget {
|
|
14
|
+
right: 10px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
/* ---------- NAVIGATION WIDGET SETTINGS : -------------------------------------------------------------------------- */
|
|
20
|
+
|
|
21
|
+
#widgets-navigation {
|
|
22
|
+
position: absolute;
|
|
23
|
+
z-index: 10;
|
|
24
|
+
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* Define navigation menu flex direction according to its position and direction settings */
|
|
30
|
+
.column-widget.top-widget {
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
}
|
|
33
|
+
.column-widget.bottom-widget {
|
|
34
|
+
flex-direction: column-reverse;
|
|
35
|
+
}
|
|
36
|
+
.row-widget.left-widget {
|
|
37
|
+
flex-direction: row;
|
|
38
|
+
}
|
|
39
|
+
.row-widget.right-widget {
|
|
40
|
+
flex-direction: row-reverse;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* Define spacing between each navigation widgets according to position and direction settings. */
|
|
44
|
+
#widgets-navigation.column-widget.top-widget > *:not(:first-child),
|
|
45
|
+
#widgets-navigation.column-widget.bottom-widget > *:not(:last-child) {
|
|
46
|
+
margin-top: 5px;
|
|
47
|
+
}
|
|
48
|
+
#widgets-navigation.column-widget.top-widget > *:not(:last-child),
|
|
49
|
+
#widgets-navigation.column-widget.bottom-widget > *:not(:first-child) {
|
|
50
|
+
margin-bottom: 5px;
|
|
51
|
+
}
|
|
52
|
+
#widgets-navigation.row-widget.left-widget > *:not(:first-child),
|
|
53
|
+
#widgets-navigation.row-widget.right-widget > *:not(:last-child) {
|
|
54
|
+
margin-left: 5px;
|
|
55
|
+
}
|
|
56
|
+
#widgets-navigation.row-widget.left-widget > *:not(:last-child),
|
|
57
|
+
#widgets-navigation.row-widget.right-widget > *:not(:first-child) {
|
|
58
|
+
margin-right: 5px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
/* ---------- NAVIGATION BUTTON BAR : ------------------------------------------------------------------------------- */
|
|
64
|
+
|
|
65
|
+
/* Define button-bar flex direction according to widget position and direction settings. */
|
|
66
|
+
#widgets-navigation .widget-button-bar {
|
|
67
|
+
display: flex;
|
|
68
|
+
}
|
|
69
|
+
#widgets-navigation.column-widget.top-widget .widget-button-bar {
|
|
70
|
+
flex-direction: column;
|
|
71
|
+
}
|
|
72
|
+
#widgets-navigation.column-widget.bottom-widget .widget-button-bar {
|
|
73
|
+
flex-direction: column-reverse;
|
|
74
|
+
}
|
|
75
|
+
#widgets-navigation.row-widget.left-widget .widget-button-bar {
|
|
76
|
+
flex-direction: row;
|
|
77
|
+
}
|
|
78
|
+
#widgets-navigation.row-widget.right-widget .widget-button-bar {
|
|
79
|
+
flex-direction: row-reverse;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
/* ---------- BUTTONS GENERIC STYLE : ------------------------------------------------------------------------------- */
|
|
85
|
+
|
|
86
|
+
#widgets-navigation .widget-button {
|
|
87
|
+
background-color: #313336bb;
|
|
88
|
+
border: 1px solid #222222;
|
|
89
|
+
padding: 0;
|
|
90
|
+
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
|
|
95
|
+
font-weight: 900;
|
|
96
|
+
font-size: 15px;
|
|
97
|
+
}
|
|
98
|
+
#widgets-navigation .widget-button:hover {
|
|
99
|
+
cursor: pointer;
|
|
100
|
+
}
|
|
101
|
+
#widgets-navigation .widget-button:active {
|
|
102
|
+
background-color: #222222;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
/* ---------- BUTTONS SHAPE AND POSITION WITHIN BUTTON-BAR : -------------------------------------------------------- */
|
|
108
|
+
|
|
109
|
+
#widgets-navigation .widget-button-bar > .widget-button {
|
|
110
|
+
height: 30px;
|
|
111
|
+
width: 30px;
|
|
112
|
+
|
|
113
|
+
color: white;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* Buttons shape and position within a column direction widget group. */
|
|
117
|
+
#widgets-navigation.column-widget.top-widget .widget-button-bar > .widget-button:first-child:not(:only-child),
|
|
118
|
+
#widgets-navigation.column-widget.bottom-widget .widget-button-bar > .widget-button:last-child:not(:only-child) {
|
|
119
|
+
border-radius: 7px 7px 0 0;
|
|
120
|
+
}
|
|
121
|
+
#widgets-navigation.column-widget.top-widget .widget-button-bar > .widget-button:last-child:not(:only-child),
|
|
122
|
+
#widgets-navigation.column-widget.bottom-widget .widget-button-bar > .widget-button:first-child:not(:only-child) {
|
|
123
|
+
border-radius: 0 0 7px 7px;
|
|
124
|
+
}
|
|
125
|
+
#widgets-navigation.column-widget.top-widget .widget-button-bar > .widget-button:not(:last-child),
|
|
126
|
+
#widgets-navigation.column-widget.bottom-widget .widget-button-bar > .widget-button:not(:first-child) {
|
|
127
|
+
margin-bottom: -1px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* Buttons shape and position within a row direction widget group. */
|
|
131
|
+
#widgets-navigation.row-widget.left-widget .widget-button-bar > .widget-button:first-child:not(:only-child),
|
|
132
|
+
#widgets-navigation.row-widget.right-widget .widget-button-bar > .widget-button:last-child:not(:only-child) {
|
|
133
|
+
border-radius: 7px 0 0 7px;
|
|
134
|
+
}
|
|
135
|
+
#widgets-navigation.row-widget.left-widget .widget-button-bar > .widget-button:last-child:not(:only-child),
|
|
136
|
+
#widgets-navigation.row-widget.right-widget .widget-button-bar > .widget-button:first-child:not(:only-child) {
|
|
137
|
+
border-radius: 0 7px 7px 0;
|
|
138
|
+
}
|
|
139
|
+
#widgets-navigation.row-widget.left-widget .widget-button-bar > .widget-button:not(:last-child),
|
|
140
|
+
#widgets-navigation.row-widget.right-widget .widget-button-bar > .widget-button:not(:first-child) {
|
|
141
|
+
margin-right: -1px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* Buttons shape and position within a single button button-bar. */
|
|
145
|
+
#widgets-navigation .widget-button-bar > .widget-button:only-child {
|
|
146
|
+
border-radius: 7px;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
/* ---------- SPECIFIC SHAPE AND POSITION FOR ZOOM-IN AND ZOOM-OUT BUTTON-BAR AND BUTTONS : ------------------------- */
|
|
152
|
+
|
|
153
|
+
#zoom-button-bar {
|
|
154
|
+
display: flex;
|
|
155
|
+
}
|
|
156
|
+
#widgets-navigation.column-widget #zoom-button-bar {
|
|
157
|
+
flex-direction: column;
|
|
158
|
+
}
|
|
159
|
+
#widgets-navigation.row-widget #zoom-button-bar {
|
|
160
|
+
flex-direction: row-reverse;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* Zoom buttons shape and position within a COLUMN direction widget group. */
|
|
164
|
+
#widgets-navigation.column-widget #zoom-button-bar > .widget-button:first-child:not(:only-child) {
|
|
165
|
+
border-radius: 7px 7px 0 0;
|
|
166
|
+
}
|
|
167
|
+
#widgets-navigation.column-widget #zoom-button-bar > .widget-button:last-child:not(:only-child) {
|
|
168
|
+
border-radius: 0 0 7px 7px;
|
|
169
|
+
}
|
|
170
|
+
#widgets-navigation.column-widget.bottom-widget #zoom-button-bar > .widget-button:not(:last-child) {
|
|
171
|
+
margin-top: 0;
|
|
172
|
+
margin-bottom: -1px;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/* Zoom buttons shape and position within a ROW direction navigation menu. */
|
|
176
|
+
#widgets-navigation.row-widget #zoom-button-bar > .widget-button:first-child:not(:only-child) {
|
|
177
|
+
border-radius: 0 7px 7px 0;
|
|
178
|
+
}
|
|
179
|
+
#widgets-navigation.row-widget #zoom-button-bar > .widget-button:last-child:not(:only-child) {
|
|
180
|
+
border-radius: 7px 0 0 7px;
|
|
181
|
+
}
|
|
182
|
+
#widgets-navigation.row-widget.left-widget #zoom-button-bar > .widget-button:not(:last-child) {
|
|
183
|
+
margin-right: 0;
|
|
184
|
+
margin-left: -1px;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/* Zoom button shape and position if user decides to show only one of the two zoom buttons. */
|
|
188
|
+
#widgets-navigation #zoom-button-bar > .widget-button:only-child {
|
|
189
|
+
border-radius: 7px;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/* Style of zoom buttons content. */
|
|
193
|
+
#widgets-navigation .widget-zoom-button-logo {
|
|
194
|
+
width: 50%;
|
|
195
|
+
height: 50%;
|
|
196
|
+
|
|
197
|
+
background-image: url('https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/GUI/widget-logo.svg');
|
|
198
|
+
background-size: 100%;
|
|
199
|
+
}
|
|
200
|
+
#widgets-navigation #zoom-out-logo {
|
|
201
|
+
background-position: center -100%;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
/* ---------- SPECIFIC COMPASS SETTINGS : --------------------------------------------------------------------------- */
|
|
207
|
+
|
|
208
|
+
#widgets-navigation #compass {
|
|
209
|
+
width: 60px;
|
|
210
|
+
height: 60px;
|
|
211
|
+
|
|
212
|
+
border-radius: 50%;
|
|
213
|
+
|
|
214
|
+
background-image: url('https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/GUI/compass.svg');
|
|
215
|
+
background-repeat: no-repeat;
|
|
216
|
+
background-size: auto 90%;
|
|
217
|
+
background-position: center;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
/* ---------- MINIMAP WIDGET SETTINGS : ----------------------------------------------------------------------------- */
|
|
223
|
+
|
|
224
|
+
#widgets-minimap {
|
|
225
|
+
position: absolute;
|
|
226
|
+
z-index: 10;
|
|
227
|
+
|
|
228
|
+
border: 1px solid #222222;
|
|
229
|
+
border-radius: 7px;
|
|
230
|
+
overflow: hidden;
|
|
231
|
+
|
|
232
|
+
user-select: none;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
#widgets-minimap #cursor-wrapper {
|
|
236
|
+
position: absolute;
|
|
237
|
+
z-index: 11;
|
|
238
|
+
|
|
239
|
+
display: flex;
|
|
240
|
+
align-items: center;
|
|
241
|
+
justify-content: center;
|
|
242
|
+
|
|
243
|
+
width: 100%;
|
|
244
|
+
height: 100%;
|
|
245
|
+
|
|
246
|
+
font-size: 40px;
|
|
247
|
+
color: #222222;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
/* ---------- SCALE WIDGET SETTINGS : ------------------------------------------------------------------------------- */
|
|
253
|
+
|
|
254
|
+
#widgets-scale {
|
|
255
|
+
user-select: none;
|
|
256
|
+
|
|
257
|
+
position: absolute;
|
|
258
|
+
z-index: 10;
|
|
259
|
+
padding: 0 10px;
|
|
260
|
+
box-sizing: border-box;
|
|
261
|
+
|
|
262
|
+
display: flex;
|
|
263
|
+
align-items: center;
|
|
264
|
+
|
|
265
|
+
border: 1px solid #ffffffcc;
|
|
266
|
+
border-radius: 0 0 7px 7px;
|
|
267
|
+
border-top: none;
|
|
268
|
+
|
|
269
|
+
background-image: linear-gradient(#31333600, #313336ff);
|
|
270
|
+
|
|
271
|
+
color: #ffffff;
|
|
272
|
+
font-family: 'Open Sans', sans-serif;
|
|
273
|
+
font-size: 15px;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
#widgets-scale.left-widget {
|
|
277
|
+
justify-content: flex-start;
|
|
278
|
+
}
|
|
279
|
+
#widgets-scale.right-widget {
|
|
280
|
+
justify-content: flex-end;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
/* ---------- SEARCHBAR WIDGET SETTINGS : --------------------------------------------------------------------------- */
|
|
286
|
+
|
|
287
|
+
#widgets-searchbar {
|
|
288
|
+
position: absolute;
|
|
289
|
+
z-index: 10;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
#widgets-searchbar > form {
|
|
293
|
+
display: flex;
|
|
294
|
+
flex-direction: column;
|
|
295
|
+
margin: 0;
|
|
296
|
+
border-radius: 7px;
|
|
297
|
+
}
|
|
298
|
+
#widgets-searchbar.top-widget > form {
|
|
299
|
+
flex-direction: column;
|
|
300
|
+
}
|
|
301
|
+
#widgets-searchbar.bottom-widget > form {
|
|
302
|
+
flex-direction: column-reverse;
|
|
303
|
+
}
|
|
304
|
+
#widgets-searchbar > form.focus {
|
|
305
|
+
box-shadow: 0 0 10px #222222;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
/* ---------- SEARCHBAR INPUT AND SUGGESTIONS : --------------------------------------------------------------------- */
|
|
311
|
+
|
|
312
|
+
#widgets-searchbar:not(.bottom-widget) form > *:last-child:not(:only-child),
|
|
313
|
+
#widgets-searchbar.bottom-widget form > *:first-child:not(:only-child) {
|
|
314
|
+
border-radius: 0 0 7px 7px;
|
|
315
|
+
}
|
|
316
|
+
#widgets-searchbar:not(.bottom-widget) form > *:first-child:not(:only-child),
|
|
317
|
+
#widgets-searchbar.bottom-widget form > *:last-child:not(:only-child) {
|
|
318
|
+
border-radius: 7px 7px 0 0;
|
|
319
|
+
}
|
|
320
|
+
#widgets-searchbar form > *:only-child {
|
|
321
|
+
border-radius: 7px;
|
|
322
|
+
}
|
|
323
|
+
#widgets-searchbar:not(.bottom-widget) form > *:not(:first-child):not(:last-child) {
|
|
324
|
+
border-bottom: none;
|
|
325
|
+
}
|
|
326
|
+
#widgets-searchbar.bottom-widget form > *:not(:first-child):not(:last-child) {
|
|
327
|
+
border-top: none;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
#widgets-searchbar form > * {
|
|
331
|
+
box-sizing: border-box;
|
|
332
|
+
width: 100%;
|
|
333
|
+
padding: 0 10px;
|
|
334
|
+
background-color: #313336bb;
|
|
335
|
+
border: 1px solid #222222;
|
|
336
|
+
color: #ffffff;
|
|
337
|
+
font-family: Arial;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
#widgets-searchbar form > input::placeholder {
|
|
341
|
+
color: #ffffff80;
|
|
342
|
+
}
|
|
343
|
+
#widgets-searchbar form > input:focus {
|
|
344
|
+
outline: none !important;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
#widgets-searchbar form > div {
|
|
348
|
+
display: flex;
|
|
349
|
+
align-items: center;
|
|
350
|
+
}
|
|
351
|
+
#widgets-searchbar form > div.active {
|
|
352
|
+
background-color: #222222;
|
|
353
|
+
}
|
|
354
|
+
#widgets-searchbar form > div:hover {
|
|
355
|
+
cursor: pointer;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
#widgets-searchbar form > div > p {
|
|
359
|
+
margin: 8px 0;
|
|
360
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<title>Itowns - GeoidLayer</title>
|
|
4
|
+
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
|
|
8
|
+
<link rel="stylesheet" type="text/css" href="css/example.css">
|
|
9
|
+
<link rel="stylesheet" type="text/css" href="css/LoadingScreen.css">
|
|
10
|
+
|
|
11
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.7.6/dat.gui.min.js"></script>
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
<div id="viewerDiv"></div>
|
|
15
|
+
|
|
16
|
+
<!-- Import iTowns source code -->
|
|
17
|
+
<script src="../dist/itowns.js"></script>
|
|
18
|
+
<script src="../dist/debug.js"></script>
|
|
19
|
+
<!-- Import iTowns LoadingScreen and GuiTools pluggins -->
|
|
20
|
+
<script src="js/GUI/LoadingScreen.js"></script>
|
|
21
|
+
<script src="js/GUI/GuiTools.js"></script>
|
|
22
|
+
|
|
23
|
+
<script type="text/javascript">
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
// ---------- CREATE A GlobeView FOR SUPPORTING DATA VISUALIZATION : ----------
|
|
28
|
+
|
|
29
|
+
// Define camera initial position
|
|
30
|
+
const placement = {
|
|
31
|
+
coord: new itowns.Coordinates('EPSG:4326', 2.351323, 48.856712),
|
|
32
|
+
range: 25000000,
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// `viewerDiv` contains iTowns' rendering area (`<canvas>`)
|
|
36
|
+
const viewerDiv = document.getElementById('viewerDiv');
|
|
37
|
+
|
|
38
|
+
// Create a GlobeView
|
|
39
|
+
const view = new itowns.GlobeView(viewerDiv, placement);
|
|
40
|
+
|
|
41
|
+
// Setup loading screen and debug menu
|
|
42
|
+
setupLoadingScreen(viewerDiv, view);
|
|
43
|
+
const debugMenu = new GuiTools('menuDiv', view);
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
// ---------- DISPLAY CONTEXTUAL DATA : ----------
|
|
48
|
+
|
|
49
|
+
// Add one imagery layer to the scene. This layer's properties are defined in a json file, but it could be
|
|
50
|
+
// defined as a plain js object. See `Layer` documentation for more info.
|
|
51
|
+
itowns.Fetcher.json('layers/JSONLayers/Ortho.json').then((config) => {
|
|
52
|
+
config.source = new itowns.WMTSSource(config.source);
|
|
53
|
+
view.addLayer(
|
|
54
|
+
new itowns.ColorLayer(config.id, config),
|
|
55
|
+
).then(debugMenu.addLayerGUI.bind(debugMenu));
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// Add two elevaion layers, each with a different level of detail. Here again, each layer's properties are
|
|
59
|
+
// defined in a json file.
|
|
60
|
+
function addElevationLayerFromConfig(config) {
|
|
61
|
+
config.source = new itowns.WMTSSource(config.source);
|
|
62
|
+
view.addLayer(
|
|
63
|
+
new itowns.ElevationLayer(config.id, config),
|
|
64
|
+
).then(debugMenu.addLayerGUI.bind(debugMenu));
|
|
65
|
+
}
|
|
66
|
+
itowns.Fetcher.json('layers/JSONLayers/WORLD_DTM.json').then(addElevationLayerFromConfig);
|
|
67
|
+
itowns.Fetcher.json('layers/JSONLayers/IGN_MNT_HIGHRES.json').then(addElevationLayerFromConfig);
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
// ---------- DISPLAY GEOID HEIGHT DATA : ----------
|
|
72
|
+
|
|
73
|
+
// As both ElevationLayers data consist in altitudes, and as iTowns GlobeView displays elevation data as
|
|
74
|
+
// ellipsoid heights, we must add a GeoidLayer to display the altitudes correctly.
|
|
75
|
+
|
|
76
|
+
// Define the source of a geoid height grid, which serves as a conversion grid between altitudes and
|
|
77
|
+
// ellipsoid heights.
|
|
78
|
+
const geoidSource = new itowns.FileSource({
|
|
79
|
+
url: 'https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/altitude-conversion-grids/' +
|
|
80
|
+
'RAF20_float.gtx',
|
|
81
|
+
crs: 'EPSG:4326',
|
|
82
|
+
format: 'application/gtx',
|
|
83
|
+
});
|
|
84
|
+
// Specify the type geoid height data are encoded with. See GTXParser documentation at
|
|
85
|
+
// http://www.itowns-project.org/itowns/docs/#api/Parser/GTXParser for more.
|
|
86
|
+
geoidSource.dataType = 'float';
|
|
87
|
+
|
|
88
|
+
// Create a Layer to support geoid height data and add it to the view.
|
|
89
|
+
const geoidLayer = new itowns.GeoidLayer('geoid', {
|
|
90
|
+
source: geoidSource,
|
|
91
|
+
});
|
|
92
|
+
view.addLayer(geoidLayer).then(debugMenu.addLayerGUI.bind(debugMenu));
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
// ---------- DEBUG TOOLS : ----------
|
|
97
|
+
|
|
98
|
+
debug.createTileDebugUI(debugMenu.gui, view);
|
|
99
|
+
|
|
100
|
+
</script>
|
|
101
|
+
</body>
|
|
102
|
+
</html>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<svg
|
|
3
|
+
width="24px"
|
|
4
|
+
height="24px"
|
|
5
|
+
viewBox="0 0 24 24"
|
|
6
|
+
fill="#000000"
|
|
7
|
+
version="1.1"
|
|
8
|
+
id="svg6"
|
|
9
|
+
sodipodi:docname="code-logo.svg"
|
|
10
|
+
inkscape:version="1.1.2 (76b9e6a115, 2022-02-25)"
|
|
11
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
12
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
13
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
14
|
+
xmlns:svg="http://www.w3.org/2000/svg">
|
|
15
|
+
<defs
|
|
16
|
+
id="defs10" />
|
|
17
|
+
<sodipodi:namedview
|
|
18
|
+
id="namedview8"
|
|
19
|
+
pagecolor="#ffffff"
|
|
20
|
+
bordercolor="#666666"
|
|
21
|
+
borderopacity="1.0"
|
|
22
|
+
inkscape:pageshadow="2"
|
|
23
|
+
inkscape:pageopacity="0.0"
|
|
24
|
+
inkscape:pagecheckerboard="0"
|
|
25
|
+
showgrid="false"
|
|
26
|
+
inkscape:zoom="32"
|
|
27
|
+
inkscape:cx="10.78125"
|
|
28
|
+
inkscape:cy="13.359375"
|
|
29
|
+
inkscape:window-width="1920"
|
|
30
|
+
inkscape:window-height="1020"
|
|
31
|
+
inkscape:window-x="1920"
|
|
32
|
+
inkscape:window-y="28"
|
|
33
|
+
inkscape:window-maximized="1"
|
|
34
|
+
inkscape:current-layer="svg6" />
|
|
35
|
+
<path
|
|
36
|
+
fill="none"
|
|
37
|
+
d="M0 0h24v24H0V0z"
|
|
38
|
+
id="path2" />
|
|
39
|
+
<path
|
|
40
|
+
d="M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"
|
|
41
|
+
id="path4"
|
|
42
|
+
style="fill:#ffffff" />
|
|
43
|
+
</svg>
|
package/examples/index.html
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
<div id="main">
|
|
13
13
|
<iframe id="content" class="scroll-section" frameborder="0" height="100%"></iframe>
|
|
14
|
-
<
|
|
14
|
+
<button id="view-source" class="text" title="View source"></button>
|
|
15
15
|
</div>
|
|
16
16
|
|
|
17
17
|
<nav class="scroll-section">
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
iframe.src = url.replace('index.html', '');
|
|
51
51
|
iframe.focus();
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
document.getElementById('view-source').
|
|
53
|
+
let viewSrc = `https://github.com/iTowns/itowns/blob/master/examples/${
|
|
54
|
+
window.location.hash.substr(1) || 'view_3d_map'
|
|
55
|
+
}.html`;
|
|
56
|
+
document.getElementById('view-source').onclick = () => { window.open(viewSrc); };
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
function initNavigation(list) {
|