From 627adcbc4960f924eed5e032afa7828b82feb7d6 Mon Sep 17 00:00:00 2001 From: Renaud Michaelis Date: Mon, 24 Jun 2024 19:23:58 +0200 Subject: [PATCH] Cesium style --- doc/conf_db.md | 3 ++- .../static-ngeo/js/olcs/Lux3DManager.js | 9 ++++++++- geoportal/vars.yaml | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/doc/conf_db.md b/doc/conf_db.md index 62ee7b726..80867fe7a 100644 --- a/doc/conf_db.md +++ b/doc/conf_db.md @@ -132,10 +132,11 @@ Layers displayed by default on first activation of 3D mode can be defined via th `ol3d_options` can hand over options to the creation of the Cesium 3d tileset. The parameters are defined as a JSON dict. -There are 3 luxembourg custom parameters: +There are 4 luxembourg custom parameters: - heightOffset - latOffset - longOffset +- cesium3DTileStyle The other parameters can be any parameters accepted by [Cesium tilesets](https://cesium.com/learn/cesiumjs/ref-doc/Cesium3DTileset.html) diff --git a/geoportal/geoportailv3_geoportal/static-ngeo/js/olcs/Lux3DManager.js b/geoportal/geoportailv3_geoportal/static-ngeo/js/olcs/Lux3DManager.js index 09cc7a5c0..4d47538ae 100644 --- a/geoportal/geoportailv3_geoportal/static-ngeo/js/olcs/Lux3DManager.js +++ b/geoportal/geoportailv3_geoportal/static-ngeo/js/olcs/Lux3DManager.js @@ -344,9 +344,16 @@ const exports = class extends ngeoOlcsManager { // if (this.isMeshLayer(layer)) { // terrainProvider = this.noTerrainProvider; // } - + let cesium3DTileStyle = undefined; + if (cs3d_options.cesium3DTileStyle !== undefined) { + cesium3DTileStyle = cs3d_options.cesium3DTileStyle; + delete cs3d_options.cesium3DTileStyle; + } const tileset = new Cesium.Cesium3DTileset(cs3d_options); + if (cesium3DTileStyle !== undefined) { + tileset.style = new Cesium.Cesium3DTileStyle (cesium3DTileStyle); + } this.tilesets3d.push(tileset); this.ol3d.getCesiumScene().primitives.add(tileset); // Adjust a tileset's height from the globe's surface. diff --git a/geoportal/vars.yaml b/geoportal/vars.yaml index c5bfd125a..d7fcb3ed2 100644 --- a/geoportal/vars.yaml +++ b/geoportal/vars.yaml @@ -295,7 +295,7 @@ vars: - {name: ogc_info_srs} - {name: ogc_query_layers, type: list} - {name: ol3d_defaultlayer, type: boolean} - - {name: ol3d_options, type: json, error_message: 'ol3d_options must be valid JSON and may contain the following options: heightOffset, latOffset, longOffset, as well as any options that can be given to Cesium.Cesium3DTileset'} + - {name: ol3d_options, type: json, error_message: 'ol3d_options must be valid JSON and may contain the following options: heightOffset, latOffset, longOffset,cesium3DTileStyle as well as any options that can be given to Cesium.Cesium3DTileset'} - {name: ol3d_type, type: string, regex: 'data|terrain|mesh', error_message: 'ol3d_type must be data, terrain or mesh ####### comment: type: regex does not work correctly with get_typed in c2cgeoportal, so a non validated string is used :-('} - {name: page_title} - {name: print_img}