diff --git a/examples/3dtiles_25d.html b/examples/3dtiles_25d.html index 16fb4cfacd..70333f5370 100644 --- a/examples/3dtiles_25d.html +++ b/examples/3dtiles_25d.html @@ -6,7 +6,7 @@ - +
diff --git a/examples/3dtiles_basic.html b/examples/3dtiles_basic.html index 3dff817953..ff6ea098ba 100644 --- a/examples/3dtiles_basic.html +++ b/examples/3dtiles_basic.html @@ -7,7 +7,7 @@ - +
diff --git a/examples/3dtiles_batch_table.html b/examples/3dtiles_batch_table.html index 4e074f8cd3..707ed21b31 100644 --- a/examples/3dtiles_batch_table.html +++ b/examples/3dtiles_batch_table.html @@ -7,7 +7,7 @@ - +
diff --git a/examples/3dtiles_ion.html b/examples/3dtiles_ion.html index 3ef10b4227..ca6a74368b 100644 --- a/examples/3dtiles_ion.html +++ b/examples/3dtiles_ion.html @@ -18,7 +18,7 @@ - +
diff --git a/examples/3dtiles_pointcloud.html b/examples/3dtiles_pointcloud.html index 1d07c34bab..06a5296978 100644 --- a/examples/3dtiles_pointcloud.html +++ b/examples/3dtiles_pointcloud.html @@ -7,7 +7,7 @@ - +
diff --git a/examples/customColorLayerEffect.html b/examples/customColorLayerEffect.html index fea09d46d8..66a8d1176c 100644 --- a/examples/customColorLayerEffect.html +++ b/examples/customColorLayerEffect.html @@ -7,7 +7,7 @@ - +
diff --git a/examples/effects_split.html b/examples/effects_split.html index de753803e5..8e6806b106 100644 --- a/examples/effects_split.html +++ b/examples/effects_split.html @@ -27,7 +27,7 @@ - +
diff --git a/examples/effects_stereo.html b/examples/effects_stereo.html index 99c7d40f76..4c4ad47bde 100644 --- a/examples/effects_stereo.html +++ b/examples/effects_stereo.html @@ -8,7 +8,7 @@ - +
diff --git a/examples/entwine_3d_loader.html b/examples/entwine_3d_loader.html index 1b9f303a41..10d41ae806 100644 --- a/examples/entwine_3d_loader.html +++ b/examples/entwine_3d_loader.html @@ -14,7 +14,7 @@ - +
Specify the URL of a Entwine Point Tree to load: diff --git a/examples/entwine_simple_loader.html b/examples/entwine_simple_loader.html index 2951b21bdc..4e2b1c07af 100644 --- a/examples/entwine_simple_loader.html +++ b/examples/entwine_simple_loader.html @@ -14,7 +14,7 @@ - +
Specify the URL of a Entwine Point Tree to load: @@ -31,7 +31,7 @@ +
diff --git a/examples/js/GUI/GuiTools.js b/examples/js/GUI/GuiTools.js index cf2ce0b012..c9a79cbefa 100644 --- a/examples/js/GUI/GuiTools.js +++ b/examples/js/GUI/GuiTools.js @@ -4,46 +4,47 @@ * Description: Classe pour créer un menu. */ -/* global dat, itowns */ +/* global lil, itowns */ -dat.GUI.prototype.removeFolder = function removeFolder(name) { - const folder = this.__folders[name]; +lil.GUI.prototype.findFolderByTitle = function findFolderByTitle(name) { + return this.folders.find(f => f.$title.innerText === name); +}; + +lil.GUI.prototype.removeFolder = function removeFolder(name) { + const folder = this.findFolderByTitle(name); if (!folder) { return; } - folder.close(); - this.__ul.removeChild(folder.domElement.parentNode); - delete this.__folders[name]; - this.onResize(); + folder.destroy(); }; -dat.GUI.prototype.colorLayerFolder = function colorLayerFolder(name, value) { - const folder = this.__folders[name]; +lil.GUI.prototype.colorLayerFolder = function colorLayerFolder(name, value) { + const folder = this.findFolderByTitle(name); if (!folder) { return; } - const title = folder.__ul.getElementsByClassName('title')[0]; + const title = folder.$title; if (title.style) { title.style.background = value; } }; -dat.GUI.prototype.hasFolder = function hasFolder(name) { - return this.__folders[name]; -}; - function GuiTools(domId, view, w) { if (view) { const width = w || 245; const element = document.createElement('div'); element.id = 'menuDiv'; - this.gui = new dat.GUI({ autoPlace: false, width: width }); + this.gui = new lil.GUI({ autoPlace: false, width: width }); + this.gui.close(); element.appendChild(this.gui.domElement); document.body.appendChild(element); this.colorGui = this.gui.addFolder('Color Layers'); this.elevationGui = this.gui.addFolder('Elevation Layers'); this.geoidGui = this.gui.addFolder('Geoid Layers'); + this.elevationGui.close(); + this.colorGui.close(); + this.geoidGui.close(); this.elevationGui.hide(); this.colorGui.hide(); this.geoidGui.hide(); @@ -80,9 +81,9 @@ GuiTools.prototype.addLayersGUI = function fnAddLayersGUI() { }; GuiTools.prototype.addImageryLayerGUI = function addImageryLayerGUI(layer) { - if (this.colorGui.hasFolder(layer.id)) { return; } this.colorGui.show(); const folder = this.colorGui.addFolder(layer.id); + folder.close(); folder.add({ visible: layer.visible }, 'visible').onChange((function updateVisibility(value) { layer.visible = value; this.view.notifyChange(layer); @@ -98,9 +99,9 @@ GuiTools.prototype.addImageryLayerGUI = function addImageryLayerGUI(layer) { }; GuiTools.prototype.addElevationLayerGUI = function addElevationLayerGUI(layer) { - if (this.elevationGui.hasFolder(layer.id)) { return; } this.elevationGui.show(); const folder = this.elevationGui.addFolder(layer.id); + folder.close(); folder.add({ frozen: layer.frozen }, 'frozen').onChange(function refreshFrozenGui(value) { layer.frozen = value; }); @@ -111,9 +112,9 @@ GuiTools.prototype.addElevationLayerGUI = function addElevationLayerGUI(layer) { }; GuiTools.prototype.addGeoidLayerGUI = function addGeoidLayerGUI(layer) { - if (this.geoidGui.hasFolder(layer.id)) { return; } this.geoidGui.show(); const folder = this.geoidGui.addFolder(layer.id); + folder.close(); folder.add({ frozen: layer.frozen }, 'frozen').onChange(function refreshFrozenGui(value) { layer.frozen = value; }); diff --git a/examples/laz_dragndrop.html b/examples/laz_dragndrop.html index 369b940ac9..efe128f6e0 100644 --- a/examples/laz_dragndrop.html +++ b/examples/laz_dragndrop.html @@ -6,7 +6,7 @@ - +
diff --git a/examples/mars.html b/examples/mars.html index 8e673b398e..8b1c6bc5d5 100644 --- a/examples/mars.html +++ b/examples/mars.html @@ -7,7 +7,7 @@ - +
diff --git a/examples/misc_camera_animation.html b/examples/misc_camera_animation.html index 19fe727a13..b6223db44b 100644 --- a/examples/misc_camera_animation.html +++ b/examples/misc_camera_animation.html @@ -8,7 +8,7 @@ - +
diff --git a/examples/misc_camera_traveling.html b/examples/misc_camera_traveling.html index 3e4c57821f..b407a428f0 100644 --- a/examples/misc_camera_traveling.html +++ b/examples/misc_camera_traveling.html @@ -7,7 +7,7 @@ - +
diff --git a/examples/misc_clamp_ground.html b/examples/misc_clamp_ground.html index 1e5317d0c8..cda019c2d9 100644 --- a/examples/misc_clamp_ground.html +++ b/examples/misc_clamp_ground.html @@ -6,7 +6,7 @@ - +
diff --git a/examples/misc_collada.html b/examples/misc_collada.html index 02e22f8f75..238aeda67b 100644 --- a/examples/misc_collada.html +++ b/examples/misc_collada.html @@ -9,7 +9,7 @@ - +
diff --git a/examples/misc_colorlayer_visibility.html b/examples/misc_colorlayer_visibility.html index 22129be348..1f2f0da47a 100644 --- a/examples/misc_colorlayer_visibility.html +++ b/examples/misc_colorlayer_visibility.html @@ -7,7 +7,7 @@ - +
diff --git a/examples/misc_compare_25d_3d.html b/examples/misc_compare_25d_3d.html index 35ce1658eb..2583567f6f 100644 --- a/examples/misc_compare_25d_3d.html +++ b/examples/misc_compare_25d_3d.html @@ -45,7 +45,7 @@ - +
diff --git a/examples/misc_custom_controls.html b/examples/misc_custom_controls.html index fba92648d9..9dde4ddaf8 100644 --- a/examples/misc_custom_controls.html +++ b/examples/misc_custom_controls.html @@ -7,7 +7,7 @@ - +
diff --git a/examples/misc_custom_label.html b/examples/misc_custom_label.html index 0057e2d812..c40cde528a 100644 --- a/examples/misc_custom_label.html +++ b/examples/misc_custom_label.html @@ -25,7 +25,7 @@ - +
diff --git a/examples/misc_georeferenced_images.html b/examples/misc_georeferenced_images.html index dd9b112ff9..20c66d56d9 100644 --- a/examples/misc_georeferenced_images.html +++ b/examples/misc_georeferenced_images.html @@ -17,7 +17,7 @@ - + diff --git a/examples/misc_instancing.html b/examples/misc_instancing.html index a134b9fb3c..3fef8ac14d 100644 --- a/examples/misc_instancing.html +++ b/examples/misc_instancing.html @@ -6,7 +6,7 @@ - +
diff --git a/examples/misc_orthographic_camera.html b/examples/misc_orthographic_camera.html index 4e8d255991..cbeab54182 100644 --- a/examples/misc_orthographic_camera.html +++ b/examples/misc_orthographic_camera.html @@ -8,7 +8,7 @@ - +
diff --git a/examples/plugins_drag_n_drop.html b/examples/plugins_drag_n_drop.html index 7f15835ba1..f2f73361c0 100644 --- a/examples/plugins_drag_n_drop.html +++ b/examples/plugins_drag_n_drop.html @@ -6,7 +6,7 @@ - +
diff --git a/examples/plugins_pyramidal_tiff.html b/examples/plugins_pyramidal_tiff.html index 4c9c4f9341..db6767ad07 100644 --- a/examples/plugins_pyramidal_tiff.html +++ b/examples/plugins_pyramidal_tiff.html @@ -6,7 +6,7 @@ - +
diff --git a/examples/plugins_vrt.html b/examples/plugins_vrt.html index 3dc448883d..23e2c67ae7 100644 --- a/examples/plugins_vrt.html +++ b/examples/plugins_vrt.html @@ -6,7 +6,7 @@ - + diff --git a/examples/potree_25d_map.html b/examples/potree_25d_map.html index 1be0029a7e..9137feb098 100644 --- a/examples/potree_25d_map.html +++ b/examples/potree_25d_map.html @@ -34,7 +34,7 @@
- + @@ -52,7 +52,7 @@ viewerDiv = document.getElementById('viewerDiv'); viewerDiv.style.display = 'block'; - debugGui = new dat.GUI(); + debugGui = new lil.GUI(); // TODO: do we really need to disable logarithmicDepthBuffer ? view = new itowns.View('EPSG:3946', viewerDiv); diff --git a/examples/potree_3d_map.html b/examples/potree_3d_map.html index 2df2b1a1e8..25d481a221 100644 --- a/examples/potree_3d_map.html +++ b/examples/potree_3d_map.html @@ -32,7 +32,7 @@
- + @@ -46,7 +46,7 @@ viewerDiv = document.getElementById('viewerDiv'); viewerDiv.style.display = 'block'; - debugGui = new dat.GUI(); + debugGui = new lil.GUI(); var placement = { coord: new itowns.Coordinates('EPSG:4326', 4.631512, 43.675626), diff --git a/examples/source_file_from_fetched_data.html b/examples/source_file_from_fetched_data.html index 69fa79bc7d..6ed01c5960 100644 --- a/examples/source_file_from_fetched_data.html +++ b/examples/source_file_from_fetched_data.html @@ -6,7 +6,7 @@ - +
diff --git a/examples/source_file_from_format.html b/examples/source_file_from_format.html index 5cf7b2a885..d14226e7cb 100644 --- a/examples/source_file_from_format.html +++ b/examples/source_file_from_format.html @@ -6,7 +6,7 @@ - +
diff --git a/examples/source_file_from_methods.html b/examples/source_file_from_methods.html index e4223b1f46..d24d84c1fc 100644 --- a/examples/source_file_from_methods.html +++ b/examples/source_file_from_methods.html @@ -6,7 +6,7 @@ - +
diff --git a/examples/source_file_from_parsed_data.html b/examples/source_file_from_parsed_data.html index 387fd99184..3e7b871870 100644 --- a/examples/source_file_from_parsed_data.html +++ b/examples/source_file_from_parsed_data.html @@ -6,7 +6,7 @@ - +
diff --git a/examples/source_file_geojson_3d.html b/examples/source_file_geojson_3d.html index 13990d4e60..30cd323166 100644 --- a/examples/source_file_geojson_3d.html +++ b/examples/source_file_geojson_3d.html @@ -6,7 +6,7 @@ - +
diff --git a/examples/source_file_geojson_raster.html b/examples/source_file_geojson_raster.html index aee01d1316..675f26a40d 100644 --- a/examples/source_file_geojson_raster.html +++ b/examples/source_file_geojson_raster.html @@ -6,7 +6,7 @@ - +
diff --git a/examples/source_file_geojson_raster_2.html b/examples/source_file_geojson_raster_2.html index d21c5dfd13..35e278c101 100644 --- a/examples/source_file_geojson_raster_2.html +++ b/examples/source_file_geojson_raster_2.html @@ -6,7 +6,7 @@ - +
diff --git a/examples/source_file_gpx_raster.html b/examples/source_file_gpx_raster.html index 54fc0b9768..a9f7a0d328 100644 --- a/examples/source_file_gpx_raster.html +++ b/examples/source_file_gpx_raster.html @@ -6,7 +6,7 @@ - +
diff --git a/examples/source_file_kml_raster.html b/examples/source_file_kml_raster.html index 7ff9ba5207..5bdc6ccfc3 100644 --- a/examples/source_file_kml_raster.html +++ b/examples/source_file_kml_raster.html @@ -6,7 +6,7 @@ - +
diff --git a/examples/source_file_kml_raster_usgs.html b/examples/source_file_kml_raster_usgs.html index db83222b2b..248e3c8d8e 100644 --- a/examples/source_file_kml_raster_usgs.html +++ b/examples/source_file_kml_raster_usgs.html @@ -6,7 +6,7 @@ - +
diff --git a/examples/source_file_shapefile.html b/examples/source_file_shapefile.html index d77eb6eb92..277564ed0c 100644 --- a/examples/source_file_shapefile.html +++ b/examples/source_file_shapefile.html @@ -6,7 +6,7 @@ - +
diff --git a/examples/source_stream_wfs_3d.html b/examples/source_stream_wfs_3d.html index acc4ba88c2..008076cde9 100644 --- a/examples/source_stream_wfs_3d.html +++ b/examples/source_stream_wfs_3d.html @@ -7,7 +7,7 @@ - +
diff --git a/examples/source_stream_wfs_raster.html b/examples/source_stream_wfs_raster.html index 204b442738..96c0f63e51 100644 --- a/examples/source_stream_wfs_raster.html +++ b/examples/source_stream_wfs_raster.html @@ -7,7 +7,7 @@ - +
diff --git a/examples/vector_tile_3d_mesh.html b/examples/vector_tile_3d_mesh.html index 6b1ea81186..0399065d1e 100644 --- a/examples/vector_tile_3d_mesh.html +++ b/examples/vector_tile_3d_mesh.html @@ -9,7 +9,7 @@ - +
diff --git a/examples/vector_tile_3d_mesh_mapbox.html b/examples/vector_tile_3d_mesh_mapbox.html index 270f27372a..83140f34f6 100644 --- a/examples/vector_tile_3d_mesh_mapbox.html +++ b/examples/vector_tile_3d_mesh_mapbox.html @@ -10,7 +10,7 @@ - +
diff --git a/examples/vector_tile_dragndrop.html b/examples/vector_tile_dragndrop.html index 90ac847049..1a9928279d 100644 --- a/examples/vector_tile_dragndrop.html +++ b/examples/vector_tile_dragndrop.html @@ -7,7 +7,7 @@ - +
diff --git a/examples/vector_tile_raster_2d.html b/examples/vector_tile_raster_2d.html index e19408da11..ebee61e664 100644 --- a/examples/vector_tile_raster_2d.html +++ b/examples/vector_tile_raster_2d.html @@ -9,7 +9,7 @@ - +
diff --git a/examples/vector_tile_raster_3d.html b/examples/vector_tile_raster_3d.html index a753784a0e..51479581a2 100644 --- a/examples/vector_tile_raster_3d.html +++ b/examples/vector_tile_raster_3d.html @@ -8,7 +8,7 @@ - +
diff --git a/examples/view_25d_map.html b/examples/view_25d_map.html index 0ed8d0e3f8..9aba1cf043 100644 --- a/examples/view_25d_map.html +++ b/examples/view_25d_map.html @@ -8,7 +8,7 @@ - +
diff --git a/examples/view_3d_map.html b/examples/view_3d_map.html index cd3f4f17cd..9f3c1c9d17 100644 --- a/examples/view_3d_map.html +++ b/examples/view_3d_map.html @@ -9,7 +9,7 @@ - +
diff --git a/examples/view_3d_mns_map.html b/examples/view_3d_mns_map.html index dcc600e366..22729612a2 100644 --- a/examples/view_3d_mns_map.html +++ b/examples/view_3d_mns_map.html @@ -9,7 +9,7 @@ - +
diff --git a/examples/view_immersive.html b/examples/view_immersive.html index 4757f57d0d..38b9518785 100644 --- a/examples/view_immersive.html +++ b/examples/view_immersive.html @@ -18,7 +18,7 @@
- + +
diff --git a/examples/widgets_minimap.html b/examples/widgets_minimap.html index 6ce99f6cd4..6950956579 100644 --- a/examples/widgets_minimap.html +++ b/examples/widgets_minimap.html @@ -13,7 +13,7 @@ can be found here : https://raw.githubusercontent.com/iTowns/itowns/master/examples/css/widgets.css --> - + diff --git a/examples/widgets_navigation.html b/examples/widgets_navigation.html index c96c6552d6..d8c6b088b9 100644 --- a/examples/widgets_navigation.html +++ b/examples/widgets_navigation.html @@ -13,7 +13,7 @@ can be found here : https://raw.githubusercontent.com/iTowns/itowns/master/examples/css/widgets.css --> - +
diff --git a/examples/widgets_scale.html b/examples/widgets_scale.html index 22fd41c12b..e0a4516a9f 100644 --- a/examples/widgets_scale.html +++ b/examples/widgets_scale.html @@ -13,7 +13,7 @@ can be found here : https://raw.githubusercontent.com/iTowns/itowns/master/examples/css/widgets.css --> - + diff --git a/examples/widgets_searchbar.html b/examples/widgets_searchbar.html index 5af4a201d0..b1dd5f2a80 100644 --- a/examples/widgets_searchbar.html +++ b/examples/widgets_searchbar.html @@ -13,7 +13,7 @@ can be found here : https://raw.githubusercontent.com/iTowns/itowns/master/examples/css/widgets.css --> - + diff --git a/test/functional/GlobeControls.js b/test/functional/GlobeControls.js index bccf81257c..e8fa507e98 100644 --- a/test/functional/GlobeControls.js +++ b/test/functional/GlobeControls.js @@ -28,11 +28,8 @@ describe('GlobeControls with globe example', function _() { }; // Hide GUI : - debugMenu.gui.remove(cRL); - minimap.hide(); - navigation.hide(); - searchbar.hide(); - scale.hide(); + debugMenu.gui.close(); + // Hide GUI : }); middleWidth = await page.evaluate(() => window.innerWidth / 2); diff --git a/utils/debug/Debug.js b/utils/debug/Debug.js index 97420a456b..bbd4798911 100644 --- a/utils/debug/Debug.js +++ b/utils/debug/Debug.js @@ -47,6 +47,7 @@ function Debug(view, datDebugTool, chartDivContainer) { // DEBUG CONTROLS const gui = datDebugTool.addFolder('Debug Tools'); + gui.close(); const state = { displayCharts: false, diff --git a/utils/debug/GeometryDebug.js b/utils/debug/GeometryDebug.js index b6547bf76c..9e4c05cda8 100644 --- a/utils/debug/GeometryDebug.js +++ b/utils/debug/GeometryDebug.js @@ -34,6 +34,7 @@ export default { createGeometryDebugUI(datDebugTool, view, layer) { const gui = datDebugTool.addFolder(`Layer ${layer.id}`); + gui.close(); gui.add(layer, 'visible').name('Visible').onChange(() => view.notifyChange(layer)); gui.add(layer, 'opacity', 0, 1).name('Opacity').onChange(() => view.notifyChange(layer)); return gui; diff --git a/utils/debug/PotreeDebug.js b/utils/debug/PotreeDebug.js index 5c235e9c07..1026692afe 100644 --- a/utils/debug/PotreeDebug.js +++ b/utils/debug/PotreeDebug.js @@ -4,6 +4,7 @@ export default { initTools(view, layer, datUi) { const update = () => view.notifyChange(layer, true); layer.debugUI = datUi.addFolder(`${layer.id}`); + layer.debugUI.close(); layer.debugUI.add(layer, 'visible').name('Visible').onChange(update); layer.debugUI.add(layer, 'sseThreshold').name('SSE threshold').onChange(update); @@ -20,6 +21,7 @@ export default { layer.dbgDisplayParents = true; const styleUI = layer.debugUI.addFolder('Styling'); + styleUI.close(); if (layer.material.mode != undefined) { styleUI.add(layer.material, 'mode', PNTS_MODE).name('Display mode').onChange(update); styleUI.add(layer, 'maxIntensityRange', 0, 1).name('Intensity max').onChange(update); @@ -42,6 +44,7 @@ export default { // UI const debugUI = layer.debugUI.addFolder('Debug'); + debugUI.close(); debugUI.add(layer.bboxes, 'visible').name('Display Bounding Boxes').onChange(update); debugUI.add(layer, 'dbgStickyNode').name('Sticky node name').onChange(update); debugUI.add(layer, 'dbgDisplaySticky').name('Display sticky node').onChange(update);