@geogirafe/lib-geoportal 1.1.0-dev.2312792329 → 1.1.0-dev.2318696406

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.
@@ -410,6 +410,7 @@
410
410
  "The following link will be sent with your message. It contains your current configuration and will help us to understand your problem.": "Der folgende Link wird mit Ihrer Nachricht gesendet. Er enthält Ihre aktuelle Konfiguration und hilft uns, Ihr Problem zu verstehen.",
411
411
  "The generated document may contain sensitive data.": "Das generierte Dokument kann sensible Daten enthalten.",
412
412
  "The print server is unavailable. Please, try later.": "Der Druckserver ist nicht verfügbar. Bitte versuche es später erneut.",
413
+ "The theme {name} is already present in the treeview.": "Das Thema {name} ist bereits im Layerbaum vorhanden.",
413
414
  "theme": "Standardthema",
414
415
  "Theme selection": "Themenauswahl",
415
416
  "Themes": "Themen",
@@ -412,6 +412,7 @@
412
412
  "The following link will be sent with your message. It contains your current configuration and will help us to understand your problem.": "The following link will be sent with your message. It contains your current configuration and will help us to understand your problem.",
413
413
  "The generated document may contain sensitive data.": "The generated document may contain sensitive data.",
414
414
  "The print server is unavailable. Please, try later.": "The print server is unavailable. Please, try later.",
415
+ "The theme {name} is already present in the treeview.": "The theme {name} is already present in the treeview.",
415
416
  "theme": "Default theme",
416
417
  "Theme selection": "Theme selection",
417
418
  "Themes": "Themes",
@@ -410,6 +410,7 @@
410
410
  "The following link will be sent with your message. It contains your current configuration and will help us to understand your problem.": "Le lien ci-dessous sera envoyé avec votre message. Il contient votre configuration courante et nous aidera à analyser votre demande.",
411
411
  "The generated document may contain sensitive data.": "Le document généré peut contenir des données sensibles.",
412
412
  "The print server is unavailable. Please, try later.": "Le serveur d'impression est indisponible. Veuillez réessayer plus tard.",
413
+ "The theme {name} is already present in the treeview.": "Le thème {name} est déjà présent dans l’arbre des couches.",
413
414
  "theme": "Thème par défaut",
414
415
  "Theme selection": "Sélection du thème",
415
416
  "Themes": "Thèmes",
@@ -410,6 +410,7 @@
410
410
  "The following link will be sent with your message. It contains your current configuration and will help us to understand your problem.": "Il seguente link verrà inviato con il tuo messaggio. Contiene la tua configurazione attuale e ci aiuterà a capire il problema.",
411
411
  "The generated document may contain sensitive data.": "Il documento generato potrebbe contenere dati sensibili.",
412
412
  "The print server is unavailable. Please, try later.": "Il server di stampa non è disponibile. Riprova più tardi.",
413
+ "The theme {name} is already present in the treeview.": "Il tema {name} è già presente nella struttura ad albero.",
413
414
  "theme": "Tema predefinito",
414
415
  "Theme selection": "Selezione del tema",
415
416
  "Themes": "Temi",
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="#5f6368" viewBox="0 -960 960 960"><path d="M480-360q50 0 85-35t35-85-35-85-85-35-85 35-35 85 35 85 85 35m0 280q-83 0-156-31.5T197-197t-85.5-127T80-480t31.5-156T197-763t127-85.5T480-880t156 31.5T763-763t85.5 127T880-480t-31.5 156T763-197t-127 85.5T480-80m0-80q134 0 227-93t93-227-93-227-227-93-227 93-93 227 93 227 227 93m0-320"/><path d="m67.025-67.033 826.657-826.666" style="fill:none;stroke:#000;stroke-width:53.0651;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"/></svg>
@@ -7,7 +7,7 @@ class ContactComponent extends GirafeHTMLElement {
7
7
  </style><style>
8
8
  #content{background:var(--bkg-color);color:var(--text-color);flex-direction:column;margin:0;padding:1rem;display:flex}label,input,select,textarea{flex-grow:1;font-size:.9rem}.gg-input,.gg-select{margin-bottom:1rem}.mail-contact{margin-top:2rem;margin-bottom:2rem}
9
9
  </style>
10
- <div id="panel"><div id="content"><label for="email" i18n="Your email (optional)" class="gg-label">Your email (optional)</label> <input id="email" placeholder="superman@example.com" class="gg-input"> <label for="reason" i18n="Why are you contacting us?" class="gg-label">Why are you contacting us?</label> <select id="reason" class="gg-select"><option value="" disabled="disabled" selected="selected">-</option>${this.context.configManager.Config.contact?.reasons.map((reason) => uHtml `<option i18n="${reason}" value="${reason}">${reason}</option>`)}</select> <label for="message" i18n="Your message" class="gg-label">Your message</label> <textarea id="message" class="gg-input gg-textarea"></textarea> <label for="shortlink" i18n="The following link will be sent with your message. It contains your current configuration and will help us to understand your problem." class="gg-label">The following link will be sent with your message. It contains your current configuration and will help us to understand your problem.</label> <input id="shortlink" disabled="disabled" value="${this.shortUrl}" class="gg-input"><div class="mail-contact"><span i18n="You can also contact us directly by E-Mail at">You can also contact us directly by E-Mail at</span> <a href="${'mailto:' + this.context.configManager.Config.contact?.email}">${this.context.configManager.Config.contact?.email}</a></div><button class="gg-button" tip="Send message" i18n="Send" onclick="${() => this.sendMessage()}">Send</button></div></div>`;
10
+ <div id="panel"><div id="content"><label for="email" i18n="Your email (optional)" class="gg-label">Your email (optional)</label> <input id="email" placeholder="you@example.com" class="gg-input"> <label for="reason" i18n="Why are you contacting us?" class="gg-label">Why are you contacting us?</label> <select id="reason" class="gg-select"><option value="" disabled="disabled" selected="selected">-</option>${this.context.configManager.Config.contact?.reasons.map((reason) => uHtml `<option i18n="${reason}" value="${reason}">${reason}</option>`)}</select> <label for="message" i18n="Your message" class="gg-label">Your message</label> <textarea id="message" class="gg-input gg-textarea"></textarea> <label for="shortlink" i18n="The following link will be sent with your message. It contains your current configuration and will help us to understand your problem." class="gg-label">The following link will be sent with your message. It contains your current configuration and will help us to understand your problem.</label> <input id="shortlink" disabled="disabled" value="${this.shortUrl}" class="gg-input"><div class="mail-contact"><span i18n="You can also contact us directly by E-Mail at">You can also contact us directly by E-Mail at</span> <a href="${'mailto:' + this.context.configManager.Config.contact?.email}">${this.context.configManager.Config.contact?.email}</a></div><button class="gg-button" tip="Send message" i18n="Send" onclick="${() => this.sendMessage()}">Send</button></div></div>`;
11
11
  };
12
12
  isPanelVisible = false;
13
13
  panelTitle = 'contact-panel';
@@ -74,6 +74,7 @@ export default class MapComponent extends GirafeHTMLElement {
74
74
  registerEvents(): void;
75
75
  locateUser(): void;
76
76
  getCurrentLocation(): void;
77
+ disableLocateUser: () => void;
77
78
  readonly updateGeolocation: (position: GeolocationPosition) => void;
78
79
  render(): void;
79
80
  listenOpenLayersEvents(): void;
@@ -46,9 +46,9 @@ export default class MapComponent extends GirafeHTMLElement {
46
46
  return uHtml `<style>
47
47
  *{font-family:Arial,sans-serif}.hidden{display:none!important}.gg-rotate90{transform:rotate(90deg)}.gg-rotate180{transform:rotate(180deg)}.gg-rotate270{transform:rotate(270deg)}img{filter:var(--svg-filter)}img.legend-image{filter:var(--svg-map-filter);background:var(--svg-legend-bkg)}div{scrollbar-width:thin}a,a:visited{color:var(--link-color)}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes spin-wait{0%{transform:rotate(0)}7%{transform:rotate(360deg)}to{transform:rotate(360deg)}}.gg-spin{animation-name:spin;animation-duration:2s;animation-timing-function:linear;animation-iteration-count:infinite}.gg-spin-wait{animation-name:spin-wait;animation-duration:10s;animation-timing-function:linear;animation-iteration-count:infinite}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-thumb{background:#999}.gg-button,.gg-select,.gg-input,.gg-textarea{background-color:var(--bkg-color);color:var(--text-color);border:var(--app-standard-border);box-sizing:border-box;cursor:pointer;border-radius:3px;outline:0;margin:0;padding:0 0 0 .5rem;display:inline-block}.gg-label{background-color:var(--bkg-color);color:var(--text-color);border:none;align-items:center;margin:0;padding:0;display:flex}.gg-button,.gg-select,.gg-input,.gg-label{min-height:calc(var(--app-standard-height)/1.5)}.gg-textarea{max-height:initial;resize:vertical;height:6rem;padding:.5rem;line-height:1.3rem}.gg-input{cursor:text}.gg-checkbox{accent-color:var(--text-color);width:1.2rem}.gg-range{accent-color:var(--text-color)}.gg-button{padding:0 .5rem}.gg-button.active{border:solid 1px var(--text-color-grad2);background-color:var(--text-color-grad2);color:var(--bkg-color)}.gg-button:disabled{color:gray;cursor:not-allowed;background-color:#d3d3d3;border:none}.gg-input:disabled,.gg-select:disabled,.gg-textarea:disabled{color:gray;cursor:not-allowed;background-color:#d3d3d3}.gg-button>img{vertical-align:middle}.gg-icon-button{color:var(--text-color);cursor:pointer;background-color:#0000;border:none;flex-direction:column;justify-content:center;align-items:center;padding:0;display:flex}.gg-icon{justify-content:center;align-items:center;display:flex}.gg-big,.gg-big-withtext{min-width:var(--app-standard-height);min-height:var(--app-standard-height);max-height:var(--app-standard-height)}.gg-big img,.gg-big-withtext img{width:calc(var(--app-standard-height) - 1.5rem);margin:0}.gg-big-withtext span{font-variant:small-caps;padding:0 1rem;font-size:.9rem}.gg-medium,.gg-medium-withtext{min-width:calc(var(--app-standard-height)/1.2);min-height:calc(var(--app-standard-height)/1.2);max-height:calc(var(--app-standard-height)/1.2);flex-direction:row}.gg-medium img{width:calc(var(--app-standard-height)/2.4);margin:0}.gg-medium-withtext img{width:calc(var(--app-standard-height)/2.4);margin-left:.5rem}.gg-medium-withtext span{padding:0 1rem 0 .5rem;font-size:.9rem}.gg-small,.gg-small-withtext{min-width:calc(var(--app-standard-height)/2);min-height:calc(var(--app-standard-height)/2);max-height:calc(var(--app-standard-height)/2);flex-direction:row}.gg-small img{width:calc(var(--app-standard-height)/3);margin:0}.gg-small-withtext img{width:calc(var(--app-standard-height)/3);margin-left:.5rem}.gg-small-withtext span{padding:0 .5rem 0 .3rem;font-size:.9rem}.gg-button:hover,.gg-select:hover,.gg-input:hover,.gg-textarea:hover,.gg-icon-button:hover{background-color:var(--bkg-color-grad1)}.gg-opacity{opacity:.5}.gg-opacity:hover{opacity:1;background-color:#0000}.gg-tabs{cursor:pointer;grid-auto-flow:column;padding-bottom:1rem;font-size:1rem;display:grid}.gg-tab{border:none;border-bottom:var(--app-standard-border);cursor:pointer;color:var(--text-color);background:0 0;padding:.5rem}.gg-tab.active{border-bottom:solid 1px var(--text-color)}.girafe-button-big,.girafe-button-large,.girafe-button-small,.girafe-button-tiny{color:var(--text-color);background-color:#0000;border:none;flex-direction:column;display:flex}.girafe-button-big:hover,.girafe-button-large:hover,.girafe-button-small:hover,.girafe-button-tiny:hover{background-color:var(--bkg-color-grad1);cursor:pointer}.girafe-button-big.dark,.girafe-button-large.dark,.girafe-button-small.dark,.girafe-button-tiny.dark{background-color:var(--bkg-color);filter:invert()}.girafe-button-big{width:var(--app-standard-height);height:var(--app-standard-height);align-items:center;padding:1rem}.girafe-button-big img{overflow:hidden}.girafe-button-large{flex-direction:row}.girafe-button-large img{height:2rem;margin:.3rem}.girafe-button-large span{height:2rem;margin:.3rem;line-height:2rem}.girafe-button-small{min-width:calc(var(--app-standard-height)/2);height:calc(var(--app-standard-height)/2);align-items:center;padding:.5rem}.girafe-button-small img{overflow:hidden}.girafe-button-small span{text-align:left;text-overflow:ellipsis;width:100%;overflow:hidden}.girafe-button-tiny{align-items:center;width:1rem;height:1rem;padding:0}.girafe-button-tiny img{overflow:hidden}.girafe-onboarding-theme{background-color:var(--bkg-color)!important;color:var(--text-color)!important}.girafe-onboarding-theme button{background-color:var(--bkg-color)!important;color:var(--text-color)!important;text-shadow:none!important}.girafe-onboarding-theme button.driver-popover-close-btn{z-index:10000}
48
48
  </style><style>
49
- #container,#ol-map{background-color:var(--bkg-color);width:100%;height:100%;position:relative}#ol-map.darkmap canvas{filter:invert()hue-rotate(180deg)}.hidden{display:none}.center{text-align:center;margin:10px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.loading span{color:var(--text-color);margin-top:1rem;font-weight:600;display:block}.loading span.quote{font-style:italic;font-weight:300}#cs-map{background-color:var(--bkg-color);border-left:3px solid #444;height:100%;display:none;position:absolute;overflow:hidden}.ol-control{background-color:#0000;border:none;box-shadow:0 1px 4px #0000004d;right:2rem!important;left:unset!important}.ol-zoom{top:2rem!important}.ol-rotate{top:9.3rem!important}.ol-location{top:7rem!important}.img-location{width:55%;height:auto}.ol-zoom-in,.ol-zoom-out,.btn-location,.ol-rotate-reset{cursor:pointer;background-color:#fff;width:2rem!important;height:2rem!important;font-size:1.2rem!important}.ol-scale-line{bottom:.5rem!important;right:1rem!important;left:unset!important}.ol-popup{background-color:var(--bkg-color);color:var(--text-color);box-shadow:0 1px 4px var(--bx-shdw);border:1px solid var(--text-color-grad1);border-radius:10px;min-width:140px;padding:15px;position:absolute;bottom:12px;left:-50px}.ol-popup:after,.ol-popup:before{content:" ";pointer-events:none;border:solid #0000;width:0;height:0;position:absolute;top:100%}.ol-popup:after{border-top-color:var(--bkg-color);border-width:10px;margin-left:-10px;left:48px}.ol-popup:before{border-top-color:var(--text-color-grad1);border-width:11px;margin-left:-11px;left:48px}.ol-popup-closer{background-color:var(--bkg-color);color:var(--text-color);cursor:pointer;text-decoration:none;position:absolute;top:2px;right:8px}.ol-popup-closer:after{content:"✖"}#swiper{width:100%;height:0;margin:0;display:none;position:absolute;top:50%}input[type=range]{-webkit-appearance:none;width:100%}input[type=range]::-webkit-slider-runnable-track{height:0}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;background:var(--bkg-color);cursor:ew-resize;border:2px solid #444;width:6px;height:0;margin-top:-1000px;padding-top:1000px;padding-bottom:1000px}input[type=range]::-moz-range-thumb{background:var(--bkg-color);cursor:ew-resize;border:2px solid #444;width:3px;height:0;padding-top:1000px;padding-bottom:1000px}.close-swiper{--button-size:2rem;transform:translateX(calc(-1*var(--button-size)/2));width:var(--button-size);height:var(--button-size);background-color:var(--bkg-color);color:var(--text-color);cursor:pointer;border-width:1px;border-radius:4px;display:none;position:absolute;top:0}.close-swiper:hover,.close-swiper:focus{outline:1px solid var(--text-color);color:var(--text-color-grad1)}.ol-viewport .tooltip{color:#fff;opacity:.7;white-space:nowrap;background:#00000080;border-radius:0;padding:.32rem .62rem;position:relative}@media screen and (hover:none){.ol-zoom,.ol-rotate,.ol-location{display:none!important}}.contextmenu{background-color:var(--bkg-color);color:var(--text-color);border:1px solid #ccc;box-shadow:1px 3px 4px #0006;& .hidden{display:none}& .menu-entry{cursor:pointer;padding:10px}& .menu-entry:hover{background-color:var(--bkg-color-grad1)}& .menu-entry[aria-disabled=true]{pointer-events:none;color:var(--text-color-grad1)}}
49
+ #container,#ol-map{background-color:var(--bkg-color);width:100%;height:100%;position:relative}#ol-map.darkmap canvas{filter:invert()hue-rotate(180deg)}.hidden{display:none}.center{text-align:center;margin:10px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.loading span{color:var(--text-color);margin-top:1rem;font-weight:600;display:block}.loading span.quote{font-style:italic;font-weight:300}#cs-map{background-color:var(--bkg-color);border-left:3px solid #444;height:100%;display:none;position:absolute;overflow:hidden}.ol-control{background-color:#0000;border:none;box-shadow:0 1px 4px #0000004d;right:2rem!important;left:unset!important}.ol-zoom{top:2rem!important}.ol-rotate{top:9.3rem!important}.ol-location{top:7rem!important}.img-location,.img-disable-location{width:55%;height:auto}.ol-zoom-in,.ol-zoom-out,.btn-location,.btn-disable-location,.ol-rotate-reset{cursor:pointer;background-color:#fff;width:2rem!important;height:2rem!important;font-size:1.2rem!important}.ol-scale-line{bottom:.5rem!important;right:1rem!important;left:unset!important}.ol-popup{background-color:var(--bkg-color);color:var(--text-color);box-shadow:0 1px 4px var(--bx-shdw);border:1px solid var(--text-color-grad1);border-radius:10px;min-width:140px;padding:15px;position:absolute;bottom:12px;left:-50px}.ol-popup:after,.ol-popup:before{content:" ";pointer-events:none;border:solid #0000;width:0;height:0;position:absolute;top:100%}.ol-popup:after{border-top-color:var(--bkg-color);border-width:10px;margin-left:-10px;left:48px}.ol-popup:before{border-top-color:var(--text-color-grad1);border-width:11px;margin-left:-11px;left:48px}.ol-popup-closer{background-color:var(--bkg-color);color:var(--text-color);cursor:pointer;text-decoration:none;position:absolute;top:2px;right:8px}.ol-popup-closer:after{content:"✖"}#swiper{width:100%;height:0;margin:0;display:none;position:absolute;top:50%}input[type=range]{-webkit-appearance:none;width:100%}input[type=range]::-webkit-slider-runnable-track{height:0}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;background:var(--bkg-color);cursor:ew-resize;border:2px solid #444;width:6px;height:0;margin-top:-1000px;padding-top:1000px;padding-bottom:1000px}input[type=range]::-moz-range-thumb{background:var(--bkg-color);cursor:ew-resize;border:2px solid #444;width:3px;height:0;padding-top:1000px;padding-bottom:1000px}.close-swiper{--button-size:2rem;transform:translateX(calc(-1*var(--button-size)/2));width:var(--button-size);height:var(--button-size);background-color:var(--bkg-color);color:var(--text-color);cursor:pointer;border-width:1px;border-radius:4px;display:none;position:absolute;top:0}.close-swiper:hover,.close-swiper:focus{outline:1px solid var(--text-color);color:var(--text-color-grad1)}.ol-viewport .tooltip{color:#fff;opacity:.7;white-space:nowrap;background:#00000080;border-radius:0;padding:.32rem .62rem;position:relative}@media screen and (hover:none){.ol-zoom,.ol-rotate,.ol-location{display:none!important}}.contextmenu{background-color:var(--bkg-color);color:var(--text-color);border:1px solid #ccc;box-shadow:1px 3px 4px #0006;& .hidden{display:none}& .menu-entry{cursor:pointer;padding:10px}& .menu-entry:hover{background-color:var(--bkg-color-grad1)}& .menu-entry[aria-disabled=true]{pointer-events:none;color:var(--text-color-grad1)}}
50
50
  </style>
51
- <link rel="stylesheet" href="lib/ol/ol.css"><div id="container"><div id="ol-map"></div><div class="ol-location ol-unselectable ol-control"><button onclick="${() => this.locateUser()}" class="btn-location"><img class="img-location" alt="location-icon" src="icons/adjust.svg"></button></div><div id="cs-map"><div class="${this.loading ? 'loading center' : 'loading hidden'}"><img alt="loading-icon" src="icons/loading.svg" class="gg-spin"> <span i18n="Loading cesium...">Loading cesium...</span> <span class="quote" i18n="cesium-loading-quote">Please be patient, like a giraffe reaching for the tastiest leaves.</span></div></div><input id="swiper" type="range" min="0" max="1000" step="1"> <button tip="Hide Swiper" id="close-swiper" class="close-swiper">×</button></div>`;
51
+ <link rel="stylesheet" href="lib/ol/ol.css"><div id="container"><div id="ol-map"></div><div class="ol-location ol-unselectable ol-control"><button onclick="${() => this.locateUser()}" class="btn-location"><img class="img-location" alt="location-icon" src="icons/adjust.svg"></button> <button id="disable-location" onclick="${() => this.disableLocateUser()}" class="btn-disable-location hidden"><img class="img-disable-location" alt="disable-location-icon" src="icons/adjust-disable.svg"></button></div><div id="cs-map"><div class="${this.loading ? 'loading center' : 'loading hidden'}"><img alt="loading-icon" src="icons/loading.svg" class="gg-spin"> <span i18n="Loading cesium...">Loading cesium...</span> <span class="quote" i18n="cesium-loading-quote">Please be patient, like a giraffe reaching for the tastiest leaves.</span></div></div><input id="swiper" type="range" min="0" max="1000" step="1"> <button tip="Hide Swiper" id="close-swiper" class="close-swiper">×</button></div>`;
52
52
  };
53
53
  olMap;
54
54
  mapTarget;
@@ -169,6 +169,7 @@ export default class MapComponent extends GirafeHTMLElement {
169
169
  // The user's current position is utilized to show the distance to objects in the layer
170
170
  navigator.permissions.query({ name: 'geolocation' }).then((result) => {
171
171
  if (result.state === 'granted' || result.state === 'prompt') {
172
+ this.shadow.getElementById('disable-location')?.classList.remove('hidden');
172
173
  this.getCurrentLocation();
173
174
  }
174
175
  });
@@ -199,6 +200,10 @@ export default class MapComponent extends GirafeHTMLElement {
199
200
  maximumAge: 0
200
201
  });
201
202
  }
203
+ disableLocateUser = () => {
204
+ this.geolocationSource.clear();
205
+ this.shadow.getElementById('disable-location')?.classList.add('hidden');
206
+ };
202
207
  updateGeolocation = (position) => {
203
208
  const coords = position.coords;
204
209
  const longitude = coords.longitude;
@@ -6,7 +6,7 @@ declare class SearchComponent extends GirafeHTMLElement {
6
6
  paintbrushIcon: string;
7
7
  private get map();
8
8
  private readonly previewFeaturesCollection;
9
- private previewLayers;
9
+ private previewLayers?;
10
10
  private previewGeoLayer;
11
11
  private maxExtent?;
12
12
  private readonly geoJsonFormatter;
@@ -30,7 +30,7 @@ class SearchComponent extends GirafeHTMLElement {
30
30
  return this.context.mapManager.getMap();
31
31
  }
32
32
  previewFeaturesCollection = new Collection();
33
- previewLayers = [];
33
+ previewLayers;
34
34
  previewGeoLayer = null;
35
35
  maxExtent;
36
36
  geoJsonFormatter = new GeoJSON();
@@ -321,14 +321,19 @@ class SearchComponent extends GirafeHTMLElement {
321
321
  // Clear preview search result
322
322
  this.previewFeaturesCollection.clear();
323
323
  // Clear preview layer
324
- this.context.themesHelper.removeLayersFromLayerTree(this.previewLayers);
325
- this.previewLayers = [];
324
+ if (this.previewLayers) {
325
+ this.context.themesHelper.removeLayersFromLayerTree(this.previewLayers.insertedLayers);
326
+ for (const layer of this.previewLayers.activatedLayers) {
327
+ this.context.layerManager.toggle(layer, 'off');
328
+ }
329
+ this.previewLayers = undefined;
330
+ }
326
331
  }
327
332
  onSelect(feature) {
328
333
  this.selectedResult = feature;
329
334
  this.ignoreBlur = false;
330
335
  this.forceHide = true;
331
- this.previewLayers = [];
336
+ this.previewLayers = undefined;
332
337
  super.render();
333
338
  const geom = feature.getGeometry();
334
339
  if (geom) {
@@ -39,6 +39,9 @@ class ThemeComponent extends GirafeHTMLElement {
39
39
  super.render();
40
40
  }
41
41
  onThemeChanged(theme) {
42
+ if (this.context.configManager.Config.themes.selectionMode === 'add') {
43
+ this.state.themes.lastSelectedTheme = null;
44
+ }
42
45
  this.state.themes.lastSelectedTheme = theme;
43
46
  if (theme.disclaimer) {
44
47
  this.state.infobox.elements.push({
@@ -6,9 +6,11 @@ export default abstract class TreeViewElement extends GirafeHTMLElement {
6
6
  protected layer: BaseLayer;
7
7
  private dragButton;
8
8
  private container;
9
+ private header;
9
10
  constructor(layer: BaseLayer, name: string);
10
11
  protected connectedCallback(): void;
11
12
  render(): void;
13
+ private highlight;
12
14
  refreshRender(): void;
13
15
  refreshRender(layer?: BaseLayer): void;
14
16
  protected showMetadata(): void;
@@ -10,6 +10,7 @@ export default class TreeViewElement extends GirafeHTMLElement {
10
10
  layer;
11
11
  dragButton;
12
12
  container;
13
+ header;
13
14
  constructor(layer, name) {
14
15
  super(name);
15
16
  this.layer = layer;
@@ -22,11 +23,28 @@ export default class TreeViewElement extends GirafeHTMLElement {
22
23
  super.render();
23
24
  this.dragButton = this.shadow.getElementById('drag-button');
24
25
  this.container = this.shadow.getElementById('container');
26
+ this.header = this.shadow.querySelector('header');
25
27
  super.girafeTranslate();
26
28
  this.initializeDrag();
27
29
  if (isTimeAwareLayer(this.layer)) {
28
30
  this.createTimeRestrictionTooltip(this.layer);
29
31
  }
32
+ this.subscribe(/layers\.layersList\..*\.isHighlighted/, (_oldValue, newValue, layer) => {
33
+ if (newValue && layer === this.layer) {
34
+ this.highlight();
35
+ }
36
+ });
37
+ }
38
+ highlight() {
39
+ this.header.scrollIntoView({
40
+ behavior: 'smooth',
41
+ block: 'nearest'
42
+ });
43
+ this.header.classList.add('highlight');
44
+ setTimeout(() => {
45
+ this.header.classList.remove('highlight');
46
+ this.layer.isHighlighted = false;
47
+ }, 3000);
30
48
  }
31
49
  refreshRender(layer) {
32
50
  if (this.state.treeview.renderEnabled && (!layer || layer === this.layer)) {
@@ -34,6 +52,9 @@ export default class TreeViewElement extends GirafeHTMLElement {
34
52
  // Else, call refresh only if the layer in param is the current one
35
53
  super.refreshRender();
36
54
  super.girafeTranslate();
55
+ if (this.layer.isHighlighted) {
56
+ this.highlight();
57
+ }
37
58
  }
38
59
  }
39
60
  showMetadata() {
@@ -5,7 +5,7 @@ import TreeViewGroupElement from '../tools/treeviewgroupelement.js';
5
5
  class TreeViewGroupComponent extends TreeViewGroupElement {
6
6
  template = () => {
7
7
  return uHtml `<style>
8
- header{border-top:1px solid #ddd;align-items:center;height:2rem;display:flex}.tool{display:none!important}header:hover .tool{display:flex!important}.tool.active{order:100;opacity:1!important;display:flex!important}.label-container{flex-grow:1;align-items:center;display:flex;overflow:auto}.label-out-resolution span{font-style:italic}.resolution-tool{margin-left:.5rem}.legend{display:flex}.legend img{background:var(--svg-legend-bkg);height:fit-content;filter:var(--svg-map-filter)}.legend-icon{background:var(--svg-legend-bkg);max-height:1.5rem;filter:var(--svg-map-filter);margin-left:.5rem}.children{flex-basis:100%;order:10;padding-left:1.3rem}.dragAfter{border-bottom:1rem dashed #ccc}.dragBefore{border-top:1rem dashed #ccc}.gg-checkbox{width:1.2rem}.gg-caret,.gg-spacer{text-align:center;width:1.5rem;padding:0}.gg-caret{transform:scale(1.3)}.gg-caret.gg-rotate90{transform:scale(1.3)rotate(90deg)}.gg-small.gg-lock{min-width:1rem}.gg-tree-label{text-align:left;white-space:nowrap;text-overflow:ellipsis;padding-left:0;overflow:hidden}.gg-grab:hover{cursor:grab}.gg-selected{opacity:1}.legend-file{color:var(--text-color);font-style:italic;display:flex}
8
+ header{border-top:1px solid #ddd;align-items:center;height:2rem;display:flex}.tool{display:none!important}header:hover .tool{display:flex!important}.tool.active{order:100;opacity:1!important;display:flex!important}.label-container{flex-grow:1;align-items:center;display:flex;overflow:auto}.label-out-resolution span{font-style:italic}.resolution-tool{margin-left:.5rem}.legend{display:flex}.legend img{background:var(--svg-legend-bkg);height:fit-content;filter:var(--svg-map-filter)}.legend-icon{background:var(--svg-legend-bkg);max-height:1.5rem;filter:var(--svg-map-filter);margin-left:.5rem}.children{flex-basis:100%;order:10;padding-left:1.3rem}.dragAfter{border-bottom:1rem dashed #ccc}.dragBefore{border-top:1rem dashed #ccc}.gg-checkbox{width:1.2rem}.gg-caret,.gg-spacer{text-align:center;width:1.5rem;padding:0}.gg-caret{transform:scale(1.3)}.gg-caret.gg-rotate90{transform:scale(1.3)rotate(90deg)}.gg-small.gg-lock{min-width:1rem}.gg-tree-label{text-align:left;white-space:nowrap;text-overflow:ellipsis;padding-left:0;overflow:hidden}.gg-grab:hover{cursor:grab}.gg-selected{opacity:1}.legend-file{color:var(--text-color);font-style:italic;display:flex}@keyframes headerFade{0%{background-color:var(--highlight-color)}to{background-color:#0000}}.highlight{animation:3s ease-in-out forwards headerFade}
9
9
  </style><style>
10
10
  *{font-family:Arial,sans-serif}.hidden{display:none!important}.gg-rotate90{transform:rotate(90deg)}.gg-rotate180{transform:rotate(180deg)}.gg-rotate270{transform:rotate(270deg)}img{filter:var(--svg-filter)}img.legend-image{filter:var(--svg-map-filter);background:var(--svg-legend-bkg)}div{scrollbar-width:thin}a,a:visited{color:var(--link-color)}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes spin-wait{0%{transform:rotate(0)}7%{transform:rotate(360deg)}to{transform:rotate(360deg)}}.gg-spin{animation-name:spin;animation-duration:2s;animation-timing-function:linear;animation-iteration-count:infinite}.gg-spin-wait{animation-name:spin-wait;animation-duration:10s;animation-timing-function:linear;animation-iteration-count:infinite}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-thumb{background:#999}.gg-button,.gg-select,.gg-input,.gg-textarea{background-color:var(--bkg-color);color:var(--text-color);border:var(--app-standard-border);box-sizing:border-box;cursor:pointer;border-radius:3px;outline:0;margin:0;padding:0 0 0 .5rem;display:inline-block}.gg-label{background-color:var(--bkg-color);color:var(--text-color);border:none;align-items:center;margin:0;padding:0;display:flex}.gg-button,.gg-select,.gg-input,.gg-label{min-height:calc(var(--app-standard-height)/1.5)}.gg-textarea{max-height:initial;resize:vertical;height:6rem;padding:.5rem;line-height:1.3rem}.gg-input{cursor:text}.gg-checkbox{accent-color:var(--text-color);width:1.2rem}.gg-range{accent-color:var(--text-color)}.gg-button{padding:0 .5rem}.gg-button.active{border:solid 1px var(--text-color-grad2);background-color:var(--text-color-grad2);color:var(--bkg-color)}.gg-button:disabled{color:gray;cursor:not-allowed;background-color:#d3d3d3;border:none}.gg-input:disabled,.gg-select:disabled,.gg-textarea:disabled{color:gray;cursor:not-allowed;background-color:#d3d3d3}.gg-button>img{vertical-align:middle}.gg-icon-button{color:var(--text-color);cursor:pointer;background-color:#0000;border:none;flex-direction:column;justify-content:center;align-items:center;padding:0;display:flex}.gg-icon{justify-content:center;align-items:center;display:flex}.gg-big,.gg-big-withtext{min-width:var(--app-standard-height);min-height:var(--app-standard-height);max-height:var(--app-standard-height)}.gg-big img,.gg-big-withtext img{width:calc(var(--app-standard-height) - 1.5rem);margin:0}.gg-big-withtext span{font-variant:small-caps;padding:0 1rem;font-size:.9rem}.gg-medium,.gg-medium-withtext{min-width:calc(var(--app-standard-height)/1.2);min-height:calc(var(--app-standard-height)/1.2);max-height:calc(var(--app-standard-height)/1.2);flex-direction:row}.gg-medium img{width:calc(var(--app-standard-height)/2.4);margin:0}.gg-medium-withtext img{width:calc(var(--app-standard-height)/2.4);margin-left:.5rem}.gg-medium-withtext span{padding:0 1rem 0 .5rem;font-size:.9rem}.gg-small,.gg-small-withtext{min-width:calc(var(--app-standard-height)/2);min-height:calc(var(--app-standard-height)/2);max-height:calc(var(--app-standard-height)/2);flex-direction:row}.gg-small img{width:calc(var(--app-standard-height)/3);margin:0}.gg-small-withtext img{width:calc(var(--app-standard-height)/3);margin-left:.5rem}.gg-small-withtext span{padding:0 .5rem 0 .3rem;font-size:.9rem}.gg-button:hover,.gg-select:hover,.gg-input:hover,.gg-textarea:hover,.gg-icon-button:hover{background-color:var(--bkg-color-grad1)}.gg-opacity{opacity:.5}.gg-opacity:hover{opacity:1;background-color:#0000}.gg-tabs{cursor:pointer;grid-auto-flow:column;padding-bottom:1rem;font-size:1rem;display:grid}.gg-tab{border:none;border-bottom:var(--app-standard-border);cursor:pointer;color:var(--text-color);background:0 0;padding:.5rem}.gg-tab.active{border-bottom:solid 1px var(--text-color)}.girafe-button-big,.girafe-button-large,.girafe-button-small,.girafe-button-tiny{color:var(--text-color);background-color:#0000;border:none;flex-direction:column;display:flex}.girafe-button-big:hover,.girafe-button-large:hover,.girafe-button-small:hover,.girafe-button-tiny:hover{background-color:var(--bkg-color-grad1);cursor:pointer}.girafe-button-big.dark,.girafe-button-large.dark,.girafe-button-small.dark,.girafe-button-tiny.dark{background-color:var(--bkg-color);filter:invert()}.girafe-button-big{width:var(--app-standard-height);height:var(--app-standard-height);align-items:center;padding:1rem}.girafe-button-big img{overflow:hidden}.girafe-button-large{flex-direction:row}.girafe-button-large img{height:2rem;margin:.3rem}.girafe-button-large span{height:2rem;margin:.3rem;line-height:2rem}.girafe-button-small{min-width:calc(var(--app-standard-height)/2);height:calc(var(--app-standard-height)/2);align-items:center;padding:.5rem}.girafe-button-small img{overflow:hidden}.girafe-button-small span{text-align:left;text-overflow:ellipsis;width:100%;overflow:hidden}.girafe-button-tiny{align-items:center;width:1rem;height:1rem;padding:0}.girafe-button-tiny img{overflow:hidden}.girafe-onboarding-theme{background-color:var(--bkg-color)!important;color:var(--text-color)!important}.girafe-onboarding-theme button{background-color:var(--bkg-color)!important;color:var(--text-color)!important;text-shadow:none!important}.girafe-onboarding-theme button.driver-popover-close-btn{z-index:10000}
11
11
  </style>
@@ -10,7 +10,7 @@ import WmsLegendHelper from '../../../tools/wms/wmslegendhelper.js';
10
10
  class TreeViewItemComponent extends TreeViewElement {
11
11
  template = () => {
12
12
  return uHtml `<style>
13
- header{border-top:1px solid #ddd;align-items:center;height:2rem;display:flex}.tool{display:none!important}header:hover .tool{display:flex!important}.tool.active{order:100;opacity:1!important;display:flex!important}.label-container{flex-grow:1;align-items:center;display:flex;overflow:auto}.label-out-resolution span{font-style:italic}.resolution-tool{margin-left:.5rem}.legend{display:flex}.legend img{background:var(--svg-legend-bkg);height:fit-content;filter:var(--svg-map-filter)}.legend-icon{background:var(--svg-legend-bkg);max-height:1.5rem;filter:var(--svg-map-filter);margin-left:.5rem}.children{flex-basis:100%;order:10;padding-left:1.3rem}.dragAfter{border-bottom:1rem dashed #ccc}.dragBefore{border-top:1rem dashed #ccc}.gg-checkbox{width:1.2rem}.gg-caret,.gg-spacer{text-align:center;width:1.5rem;padding:0}.gg-caret{transform:scale(1.3)}.gg-caret.gg-rotate90{transform:scale(1.3)rotate(90deg)}.gg-small.gg-lock{min-width:1rem}.gg-tree-label{text-align:left;white-space:nowrap;text-overflow:ellipsis;padding-left:0;overflow:hidden}.gg-grab:hover{cursor:grab}.gg-selected{opacity:1}.legend-file{color:var(--text-color);font-style:italic;display:flex}
13
+ header{border-top:1px solid #ddd;align-items:center;height:2rem;display:flex}.tool{display:none!important}header:hover .tool{display:flex!important}.tool.active{order:100;opacity:1!important;display:flex!important}.label-container{flex-grow:1;align-items:center;display:flex;overflow:auto}.label-out-resolution span{font-style:italic}.resolution-tool{margin-left:.5rem}.legend{display:flex}.legend img{background:var(--svg-legend-bkg);height:fit-content;filter:var(--svg-map-filter)}.legend-icon{background:var(--svg-legend-bkg);max-height:1.5rem;filter:var(--svg-map-filter);margin-left:.5rem}.children{flex-basis:100%;order:10;padding-left:1.3rem}.dragAfter{border-bottom:1rem dashed #ccc}.dragBefore{border-top:1rem dashed #ccc}.gg-checkbox{width:1.2rem}.gg-caret,.gg-spacer{text-align:center;width:1.5rem;padding:0}.gg-caret{transform:scale(1.3)}.gg-caret.gg-rotate90{transform:scale(1.3)rotate(90deg)}.gg-small.gg-lock{min-width:1rem}.gg-tree-label{text-align:left;white-space:nowrap;text-overflow:ellipsis;padding-left:0;overflow:hidden}.gg-grab:hover{cursor:grab}.gg-selected{opacity:1}.legend-file{color:var(--text-color);font-style:italic;display:flex}@keyframes headerFade{0%{background-color:var(--highlight-color)}to{background-color:#0000}}.highlight{animation:3s ease-in-out forwards headerFade}
14
14
  </style><style>
15
15
  *{font-family:Arial,sans-serif}.hidden{display:none!important}.gg-rotate90{transform:rotate(90deg)}.gg-rotate180{transform:rotate(180deg)}.gg-rotate270{transform:rotate(270deg)}img{filter:var(--svg-filter)}img.legend-image{filter:var(--svg-map-filter);background:var(--svg-legend-bkg)}div{scrollbar-width:thin}a,a:visited{color:var(--link-color)}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes spin-wait{0%{transform:rotate(0)}7%{transform:rotate(360deg)}to{transform:rotate(360deg)}}.gg-spin{animation-name:spin;animation-duration:2s;animation-timing-function:linear;animation-iteration-count:infinite}.gg-spin-wait{animation-name:spin-wait;animation-duration:10s;animation-timing-function:linear;animation-iteration-count:infinite}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-thumb{background:#999}.gg-button,.gg-select,.gg-input,.gg-textarea{background-color:var(--bkg-color);color:var(--text-color);border:var(--app-standard-border);box-sizing:border-box;cursor:pointer;border-radius:3px;outline:0;margin:0;padding:0 0 0 .5rem;display:inline-block}.gg-label{background-color:var(--bkg-color);color:var(--text-color);border:none;align-items:center;margin:0;padding:0;display:flex}.gg-button,.gg-select,.gg-input,.gg-label{min-height:calc(var(--app-standard-height)/1.5)}.gg-textarea{max-height:initial;resize:vertical;height:6rem;padding:.5rem;line-height:1.3rem}.gg-input{cursor:text}.gg-checkbox{accent-color:var(--text-color);width:1.2rem}.gg-range{accent-color:var(--text-color)}.gg-button{padding:0 .5rem}.gg-button.active{border:solid 1px var(--text-color-grad2);background-color:var(--text-color-grad2);color:var(--bkg-color)}.gg-button:disabled{color:gray;cursor:not-allowed;background-color:#d3d3d3;border:none}.gg-input:disabled,.gg-select:disabled,.gg-textarea:disabled{color:gray;cursor:not-allowed;background-color:#d3d3d3}.gg-button>img{vertical-align:middle}.gg-icon-button{color:var(--text-color);cursor:pointer;background-color:#0000;border:none;flex-direction:column;justify-content:center;align-items:center;padding:0;display:flex}.gg-icon{justify-content:center;align-items:center;display:flex}.gg-big,.gg-big-withtext{min-width:var(--app-standard-height);min-height:var(--app-standard-height);max-height:var(--app-standard-height)}.gg-big img,.gg-big-withtext img{width:calc(var(--app-standard-height) - 1.5rem);margin:0}.gg-big-withtext span{font-variant:small-caps;padding:0 1rem;font-size:.9rem}.gg-medium,.gg-medium-withtext{min-width:calc(var(--app-standard-height)/1.2);min-height:calc(var(--app-standard-height)/1.2);max-height:calc(var(--app-standard-height)/1.2);flex-direction:row}.gg-medium img{width:calc(var(--app-standard-height)/2.4);margin:0}.gg-medium-withtext img{width:calc(var(--app-standard-height)/2.4);margin-left:.5rem}.gg-medium-withtext span{padding:0 1rem 0 .5rem;font-size:.9rem}.gg-small,.gg-small-withtext{min-width:calc(var(--app-standard-height)/2);min-height:calc(var(--app-standard-height)/2);max-height:calc(var(--app-standard-height)/2);flex-direction:row}.gg-small img{width:calc(var(--app-standard-height)/3);margin:0}.gg-small-withtext img{width:calc(var(--app-standard-height)/3);margin-left:.5rem}.gg-small-withtext span{padding:0 .5rem 0 .3rem;font-size:.9rem}.gg-button:hover,.gg-select:hover,.gg-input:hover,.gg-textarea:hover,.gg-icon-button:hover{background-color:var(--bkg-color-grad1)}.gg-opacity{opacity:.5}.gg-opacity:hover{opacity:1;background-color:#0000}.gg-tabs{cursor:pointer;grid-auto-flow:column;padding-bottom:1rem;font-size:1rem;display:grid}.gg-tab{border:none;border-bottom:var(--app-standard-border);cursor:pointer;color:var(--text-color);background:0 0;padding:.5rem}.gg-tab.active{border-bottom:solid 1px var(--text-color)}.girafe-button-big,.girafe-button-large,.girafe-button-small,.girafe-button-tiny{color:var(--text-color);background-color:#0000;border:none;flex-direction:column;display:flex}.girafe-button-big:hover,.girafe-button-large:hover,.girafe-button-small:hover,.girafe-button-tiny:hover{background-color:var(--bkg-color-grad1);cursor:pointer}.girafe-button-big.dark,.girafe-button-large.dark,.girafe-button-small.dark,.girafe-button-tiny.dark{background-color:var(--bkg-color);filter:invert()}.girafe-button-big{width:var(--app-standard-height);height:var(--app-standard-height);align-items:center;padding:1rem}.girafe-button-big img{overflow:hidden}.girafe-button-large{flex-direction:row}.girafe-button-large img{height:2rem;margin:.3rem}.girafe-button-large span{height:2rem;margin:.3rem;line-height:2rem}.girafe-button-small{min-width:calc(var(--app-standard-height)/2);height:calc(var(--app-standard-height)/2);align-items:center;padding:.5rem}.girafe-button-small img{overflow:hidden}.girafe-button-small span{text-align:left;text-overflow:ellipsis;width:100%;overflow:hidden}.girafe-button-tiny{align-items:center;width:1rem;height:1rem;padding:0}.girafe-button-tiny img{overflow:hidden}.girafe-onboarding-theme{background-color:var(--bkg-color)!important;color:var(--text-color)!important}.girafe-onboarding-theme button{background-color:var(--bkg-color)!important;color:var(--text-color)!important;text-shadow:none!important}.girafe-onboarding-theme button.driver-popover-close-btn{z-index:10000}
16
16
  </style>
@@ -10,7 +10,7 @@ class TreeViewThemeComponent extends TreeViewGroupElement {
10
10
  return uHtml `<style>
11
11
  *{font-family:Arial,sans-serif}.hidden{display:none!important}.gg-rotate90{transform:rotate(90deg)}.gg-rotate180{transform:rotate(180deg)}.gg-rotate270{transform:rotate(270deg)}img{filter:var(--svg-filter)}img.legend-image{filter:var(--svg-map-filter);background:var(--svg-legend-bkg)}div{scrollbar-width:thin}a,a:visited{color:var(--link-color)}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes spin-wait{0%{transform:rotate(0)}7%{transform:rotate(360deg)}to{transform:rotate(360deg)}}.gg-spin{animation-name:spin;animation-duration:2s;animation-timing-function:linear;animation-iteration-count:infinite}.gg-spin-wait{animation-name:spin-wait;animation-duration:10s;animation-timing-function:linear;animation-iteration-count:infinite}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-thumb{background:#999}.gg-button,.gg-select,.gg-input,.gg-textarea{background-color:var(--bkg-color);color:var(--text-color);border:var(--app-standard-border);box-sizing:border-box;cursor:pointer;border-radius:3px;outline:0;margin:0;padding:0 0 0 .5rem;display:inline-block}.gg-label{background-color:var(--bkg-color);color:var(--text-color);border:none;align-items:center;margin:0;padding:0;display:flex}.gg-button,.gg-select,.gg-input,.gg-label{min-height:calc(var(--app-standard-height)/1.5)}.gg-textarea{max-height:initial;resize:vertical;height:6rem;padding:.5rem;line-height:1.3rem}.gg-input{cursor:text}.gg-checkbox{accent-color:var(--text-color);width:1.2rem}.gg-range{accent-color:var(--text-color)}.gg-button{padding:0 .5rem}.gg-button.active{border:solid 1px var(--text-color-grad2);background-color:var(--text-color-grad2);color:var(--bkg-color)}.gg-button:disabled{color:gray;cursor:not-allowed;background-color:#d3d3d3;border:none}.gg-input:disabled,.gg-select:disabled,.gg-textarea:disabled{color:gray;cursor:not-allowed;background-color:#d3d3d3}.gg-button>img{vertical-align:middle}.gg-icon-button{color:var(--text-color);cursor:pointer;background-color:#0000;border:none;flex-direction:column;justify-content:center;align-items:center;padding:0;display:flex}.gg-icon{justify-content:center;align-items:center;display:flex}.gg-big,.gg-big-withtext{min-width:var(--app-standard-height);min-height:var(--app-standard-height);max-height:var(--app-standard-height)}.gg-big img,.gg-big-withtext img{width:calc(var(--app-standard-height) - 1.5rem);margin:0}.gg-big-withtext span{font-variant:small-caps;padding:0 1rem;font-size:.9rem}.gg-medium,.gg-medium-withtext{min-width:calc(var(--app-standard-height)/1.2);min-height:calc(var(--app-standard-height)/1.2);max-height:calc(var(--app-standard-height)/1.2);flex-direction:row}.gg-medium img{width:calc(var(--app-standard-height)/2.4);margin:0}.gg-medium-withtext img{width:calc(var(--app-standard-height)/2.4);margin-left:.5rem}.gg-medium-withtext span{padding:0 1rem 0 .5rem;font-size:.9rem}.gg-small,.gg-small-withtext{min-width:calc(var(--app-standard-height)/2);min-height:calc(var(--app-standard-height)/2);max-height:calc(var(--app-standard-height)/2);flex-direction:row}.gg-small img{width:calc(var(--app-standard-height)/3);margin:0}.gg-small-withtext img{width:calc(var(--app-standard-height)/3);margin-left:.5rem}.gg-small-withtext span{padding:0 .5rem 0 .3rem;font-size:.9rem}.gg-button:hover,.gg-select:hover,.gg-input:hover,.gg-textarea:hover,.gg-icon-button:hover{background-color:var(--bkg-color-grad1)}.gg-opacity{opacity:.5}.gg-opacity:hover{opacity:1;background-color:#0000}.gg-tabs{cursor:pointer;grid-auto-flow:column;padding-bottom:1rem;font-size:1rem;display:grid}.gg-tab{border:none;border-bottom:var(--app-standard-border);cursor:pointer;color:var(--text-color);background:0 0;padding:.5rem}.gg-tab.active{border-bottom:solid 1px var(--text-color)}.girafe-button-big,.girafe-button-large,.girafe-button-small,.girafe-button-tiny{color:var(--text-color);background-color:#0000;border:none;flex-direction:column;display:flex}.girafe-button-big:hover,.girafe-button-large:hover,.girafe-button-small:hover,.girafe-button-tiny:hover{background-color:var(--bkg-color-grad1);cursor:pointer}.girafe-button-big.dark,.girafe-button-large.dark,.girafe-button-small.dark,.girafe-button-tiny.dark{background-color:var(--bkg-color);filter:invert()}.girafe-button-big{width:var(--app-standard-height);height:var(--app-standard-height);align-items:center;padding:1rem}.girafe-button-big img{overflow:hidden}.girafe-button-large{flex-direction:row}.girafe-button-large img{height:2rem;margin:.3rem}.girafe-button-large span{height:2rem;margin:.3rem;line-height:2rem}.girafe-button-small{min-width:calc(var(--app-standard-height)/2);height:calc(var(--app-standard-height)/2);align-items:center;padding:.5rem}.girafe-button-small img{overflow:hidden}.girafe-button-small span{text-align:left;text-overflow:ellipsis;width:100%;overflow:hidden}.girafe-button-tiny{align-items:center;width:1rem;height:1rem;padding:0}.girafe-button-tiny img{overflow:hidden}.girafe-onboarding-theme{background-color:var(--bkg-color)!important;color:var(--text-color)!important}.girafe-onboarding-theme button{background-color:var(--bkg-color)!important;color:var(--text-color)!important;text-shadow:none!important}.girafe-onboarding-theme button.driver-popover-close-btn{z-index:10000}
12
12
  </style><style>
13
- header{border-top:1px solid #ddd;align-items:center;height:2rem;display:flex}.tool{display:none!important}header:hover .tool{display:flex!important}.tool.active{order:100;opacity:1!important;display:flex!important}.label-container{flex-grow:1;align-items:center;display:flex;overflow:auto}.label-out-resolution span{font-style:italic}.resolution-tool{margin-left:.5rem}.legend{display:flex}.legend img{background:var(--svg-legend-bkg);height:fit-content;filter:var(--svg-map-filter)}.legend-icon{background:var(--svg-legend-bkg);max-height:1.5rem;filter:var(--svg-map-filter);margin-left:.5rem}.children{flex-basis:100%;order:10;padding-left:1.3rem}.dragAfter{border-bottom:1rem dashed #ccc}.dragBefore{border-top:1rem dashed #ccc}.gg-checkbox{width:1.2rem}.gg-caret,.gg-spacer{text-align:center;width:1.5rem;padding:0}.gg-caret{transform:scale(1.3)}.gg-caret.gg-rotate90{transform:scale(1.3)rotate(90deg)}.gg-small.gg-lock{min-width:1rem}.gg-tree-label{text-align:left;white-space:nowrap;text-overflow:ellipsis;padding-left:0;overflow:hidden}.gg-grab:hover{cursor:grab}.gg-selected{opacity:1}.legend-file{color:var(--text-color);font-style:italic;display:flex}
13
+ header{border-top:1px solid #ddd;align-items:center;height:2rem;display:flex}.tool{display:none!important}header:hover .tool{display:flex!important}.tool.active{order:100;opacity:1!important;display:flex!important}.label-container{flex-grow:1;align-items:center;display:flex;overflow:auto}.label-out-resolution span{font-style:italic}.resolution-tool{margin-left:.5rem}.legend{display:flex}.legend img{background:var(--svg-legend-bkg);height:fit-content;filter:var(--svg-map-filter)}.legend-icon{background:var(--svg-legend-bkg);max-height:1.5rem;filter:var(--svg-map-filter);margin-left:.5rem}.children{flex-basis:100%;order:10;padding-left:1.3rem}.dragAfter{border-bottom:1rem dashed #ccc}.dragBefore{border-top:1rem dashed #ccc}.gg-checkbox{width:1.2rem}.gg-caret,.gg-spacer{text-align:center;width:1.5rem;padding:0}.gg-caret{transform:scale(1.3)}.gg-caret.gg-rotate90{transform:scale(1.3)rotate(90deg)}.gg-small.gg-lock{min-width:1rem}.gg-tree-label{text-align:left;white-space:nowrap;text-overflow:ellipsis;padding-left:0;overflow:hidden}.gg-grab:hover{cursor:grab}.gg-selected{opacity:1}.legend-file{color:var(--text-color);font-style:italic;display:flex}@keyframes headerFade{0%{background-color:var(--highlight-color)}to{background-color:#0000}}.highlight{animation:3s ease-in-out forwards headerFade}
14
14
  </style><style>
15
15
  header{border:none;flex-direction:row-reverse;margin-top:.5rem;margin-bottom:.5rem;position:relative}.theme-button{font-size:1.2rem;font-weight:600}.theme-button span{margin-left:.5rem}.theme-button:hover{cursor:default;background-color:#0000;border:none}.children{padding-left:.5rem}.children:first-child{border:none}.label-container{position:absolute;inset:0}.label-container button{text-align:center;flex-grow:1}.tool{z-index:1}
16
16
  </style>
package/main.tools.js CHANGED
@@ -43,5 +43,10 @@ export function redirectTo(page) {
43
43
  mobileUrl.pathname = pathParts.join('/');
44
44
  mobileUrl.search = currentUrl.search;
45
45
  mobileUrl.hash = currentUrl.hash;
46
- globalThis.location.href = mobileUrl.toString();
46
+ setTimeout(() => {
47
+ // Dispatch special event before redirecting, because some components need perhaps to do/cancel things
48
+ const event = new CustomEvent('gg:redirect');
49
+ globalThis.dispatchEvent(event);
50
+ globalThis.location.href = mobileUrl.toString();
51
+ });
47
52
  }
@@ -26,6 +26,7 @@ declare abstract class BaseLayer {
26
26
  hasError: boolean;
27
27
  errorMessage: string | null;
28
28
  get hasMetadata(): boolean;
29
+ isHighlighted: boolean;
29
30
  abstract activeState: string;
30
31
  abstract get active(): boolean;
31
32
  abstract get inactive(): boolean;
@@ -31,6 +31,7 @@ class BaseLayer {
31
31
  get hasMetadata() {
32
32
  return this.metadataUrl !== undefined;
33
33
  }
34
+ isHighlighted = false;
34
35
  parent;
35
36
  constructor(id, name, order, options) {
36
37
  this.id = id;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "name": "GeoGirafe PSC",
6
6
  "url": "https://doc.geomapfish.dev"
7
7
  },
8
- "version": "1.1.0-dev.2312792329",
8
+ "version": "1.1.0-dev.2318696406",
9
9
  "type": "module",
10
10
  "engines": {
11
11
  "node": ">=20.19.0"
@@ -52,7 +52,7 @@
52
52
  "vanilla-picker": "2.12.3"
53
53
  },
54
54
  "peerDependencies": {
55
- "@geoblocks/mapfishprint": "0.2",
55
+ "@geoblocks/mapfishprint": "0.3",
56
56
  "@types/geojson": "7946",
57
57
  "cesium": ">1.113",
58
58
  "ol": "8 || 9 || 10",
@@ -62,7 +62,7 @@
62
62
  "proj4": "2"
63
63
  },
64
64
  "devDependencies": {
65
- "@geoblocks/mapfishprint": "0.2.20",
65
+ "@geoblocks/mapfishprint": "0.3.0",
66
66
  "@geoblocks/print": "0.7.9",
67
67
  "@types/babel__generator": "7.27.0",
68
68
  "@types/d3": "7.4.3",
@@ -6,6 +6,7 @@ body {
6
6
  --bkg-color: rgb(255, 255, 255);
7
7
  --text-color: #222;
8
8
  --link-color: grey;
9
+ --highlight-color: rgba(0, 120, 255, 0.1);
9
10
 
10
11
  --bx-shdw: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 2px 4px 0 rgba(0, 0, 0, 0.16);
11
12
  --t-bkg: #ffffffbb;
@@ -47,6 +48,7 @@ body.dark-theme {
47
48
  --success-color: #529c52;
48
49
  --svg-filter: invert(1) hue-rotate(180deg);
49
50
  --svg-legend-bkg: var(--legend-bkg);
51
+ --highlight-color: rgba(174, 208, 247, 0.5);
50
52
  }
51
53
 
52
54
  /* Legends theme colors for the map */
@@ -78,6 +80,7 @@ body.dark-map {
78
80
  --svg-filter: invert(1);
79
81
  --svg-map-filter: invert(1) hue-rotate(180deg);
80
82
  --svg-legend-bkg: var(--legend-bkg);
83
+ --highlight-color: rgba(174, 208, 247, 0.5);
81
84
  }
82
85
 
83
86
  /* Override dark mode with light mode styles if the user decides to swap */
@@ -98,6 +101,7 @@ body.dark-map {
98
101
  --lnk-active: #ff0000;
99
102
  --svg-filter: none;
100
103
  --svg-legend-bkg: var(--legend-bkg);
104
+ --highlight-color: rgba(0, 120, 255, 0.1);
101
105
  }
102
106
  body.dark-theme.light-map {
103
107
  --svg-map-filter: none;
@@ -1 +1 @@
1
- {"version":"1.1.0-dev.2312792329", "build":"2312792329", "date":"08/02/2026"}
1
+ {"version":"1.1.0-dev.2318696406", "build":"2318696406", "date":"11/02/2026"}
@@ -1,10 +1,13 @@
1
1
  import GirafeSingleton from '../../base/GirafeSingleton.js';
2
2
  import GirafeConfig from './girafeconfig.js';
3
+ import IGirafeContext from '../context/icontext.js';
3
4
  declare class ConfigManager extends GirafeSingleton {
4
5
  private config;
5
6
  private defaultConfig;
6
7
  private loadingPromise;
7
8
  private readonly storagePathForOverrides;
9
+ private readonly abortController;
10
+ constructor(context: IGirafeContext);
8
11
  get Config(): GirafeConfig;
9
12
  private getConfigUrls;
10
13
  loadConfig(): Promise<GirafeConfig>;
@@ -7,6 +7,13 @@ class ConfigManager extends GirafeSingleton {
7
7
  defaultConfig = null;
8
8
  loadingPromise = null;
9
9
  storagePathForOverrides = 'configOverrides';
10
+ abortController = new AbortController();
11
+ constructor(context) {
12
+ super(context);
13
+ globalThis.addEventListener('gg:redirect', () => {
14
+ this.abortController.abort();
15
+ });
16
+ }
10
17
  get Config() {
11
18
  return this.config;
12
19
  }
@@ -53,18 +60,17 @@ class ConfigManager extends GirafeSingleton {
53
60
  let jsonConfig = {};
54
61
  for (const configUrl of configUrls) {
55
62
  try {
56
- const response = await fetch(configUrl);
63
+ const response = await fetch(configUrl, { signal: this.abortController.signal });
57
64
  const newJsonConfig = await response.json();
58
65
  jsonConfig = this.mergeConfigs(jsonConfig, newJsonConfig);
59
66
  }
60
67
  catch {
61
- // TODO REG: Manage better the errors at the aplication start:
62
- // - the window.gAlert fuction should be callable at the very beggining of the app
63
- // - The ErrorManager should handled suches case, but it seems to be initialized too late.
64
- // - normal alerts seems to be blocked on mobile.
65
- const errorMessage = `Error while reading the configuration file ${configUrl}. Please verify your configuration.`;
66
- window.alert(errorMessage);
67
- throw new Error(errorMessage);
68
+ // If the loading of config file was aborted due to automatic redirect to another interface
69
+ // We do not display any error.
70
+ if (!this.abortController.signal.aborted) {
71
+ const errorMessage = `Error while reading the configuration file ${configUrl}. Please verify your configuration.`;
72
+ globalThis.alert(errorMessage);
73
+ }
68
74
  }
69
75
  }
70
76
  // Create a backup of the default config before applying overrides
@@ -34,5 +34,6 @@ declare class LayerManager extends GirafeSingleton {
34
34
  isLayerWithFilter(layer: ILayerWithFilter | Layer): layer is ILayerWithFilter;
35
35
  getSortedLayers(layers: BaseLayer[]): BaseLayer[];
36
36
  private activateDefaultLayers;
37
+ private highlightNewLayers;
37
38
  }
38
39
  export default LayerManager;
@@ -21,6 +21,7 @@ class LayerManager extends GirafeSingleton {
21
21
  this.layerClones.push(...addedLayers);
22
22
  this.fillLayerIdToClone(addedLayers);
23
23
  this.activateDefaultLayers(addedLayers);
24
+ this.highlightNewLayers(addedLayers);
24
25
  }
25
26
  fillLayerIdToClone(layers) {
26
27
  for (const layer of layers) {
@@ -277,5 +278,13 @@ class LayerManager extends GirafeSingleton {
277
278
  }
278
279
  }
279
280
  }
281
+ highlightNewLayers(layers) {
282
+ // Do not highlight at application start
283
+ if (this.state.application.isReady) {
284
+ for (const layer of layers) {
285
+ layer.isHighlighted = true;
286
+ }
287
+ }
288
+ }
280
289
  }
281
290
  export default LayerManager;
package/tools/main.d.ts CHANGED
@@ -91,6 +91,7 @@ export type { GgUserInteractionEvent } from './state/userinteractionevent.js';
91
91
  export { gGEventDependencies, isPrimaryPointerAction, isAlternateMouseClick, isMouseWheelClick } from './state/userinteractionevent.js';
92
92
  export { default as CustomThemesManager } from './themes/customthemesmanager.js';
93
93
  export { DEFAULT_OPACITY, OPACITY_FOR_DEFAULT_BASEMAP } from './themes/themes-config.js';
94
+ export type { LayerTreeChanges } from './themes/themeshelper.js';
94
95
  export { default as ThemesHelper } from './themes/themeshelper.js';
95
96
  export { default as ThemesManager } from './themes/themesmanager.js';
96
97
  export { default as UserLayerManager } from './themes/userlayermanager.js';
@@ -1,11 +1,12 @@
1
1
  import GirafeSingleton from '../../base/GirafeSingleton.js';
2
- import MapOL from 'ol/Map.js';
2
+ import OlMap from 'ol/Map.js';
3
3
  import type { Extent } from 'ol/extent.js';
4
4
  import type BaseLayer from 'ol/layer/Base.js';
5
5
  /** The singleton containing the main OpenLayers map accessible from everywhere */
6
6
  export default class MapManager extends GirafeSingleton {
7
- private readonly map;
8
- getMap(): MapOL;
7
+ private map?;
8
+ private createMap;
9
+ getMap(): OlMap;
9
10
  /**
10
11
  * @returns an array of BaseLayer objects that should be printed and that are not in the layer tree.
11
12
  */
@@ -1,37 +1,46 @@
1
1
  import GirafeSingleton from '../../base/GirafeSingleton.js';
2
- import MapOL from 'ol/Map.js';
2
+ import OlMap from 'ol/Map.js';
3
3
  import { defaults as defaultControls } from 'ol/control/defaults.js';
4
4
  import { defaults as defaultInteractions } from 'ol/interaction/defaults.js';
5
5
  import { DragPan } from 'ol/interaction.js';
6
+ import { Kinetic } from 'ol';
6
7
  /** The singleton containing the main OpenLayers map accessible from everywhere */
7
8
  export default class MapManager extends GirafeSingleton {
8
- map = new MapOL({
9
- controls: defaultControls({
10
- rotate: !this.context.stateManager.state.interface.isMobile,
11
- zoom: !this.context.stateManager.state.interface.isMobile
12
- }),
13
- layers: [],
14
- interactions: defaultInteractions({ dragPan: false }).extend([
15
- /** Make Map pan on Wheel/Middle-Button Click */
16
- new DragPan({
17
- condition: function (mapBrowserEvent) {
18
- const event = mapBrowserEvent.originalEvent;
19
- return event.isPrimary && event.button < 2 && !event.shiftKey;
20
- }
21
- })
22
- ])
23
- });
9
+ map;
10
+ createMap() {
11
+ const interactions = defaultInteractions({ dragPan: false });
12
+ interactions.push(new DragPan({
13
+ condition: function (mapBrowserEvent) {
14
+ const event = mapBrowserEvent.originalEvent;
15
+ return event.isPrimary && event.button < 2 && !event.shiftKey;
16
+ },
17
+ kinetic: new Kinetic(-0.005, 0.05, 100)
18
+ }));
19
+ this.map = new OlMap({
20
+ controls: defaultControls({
21
+ rotate: !this.context.stateManager.state.interface.isMobile,
22
+ zoom: !this.context.stateManager.state.interface.isMobile
23
+ }),
24
+ layers: [],
25
+ interactions: interactions
26
+ });
27
+ }
24
28
  getMap() {
29
+ if (!this.map) {
30
+ this.createMap();
31
+ }
25
32
  return this.map;
26
33
  }
27
34
  /**
28
35
  * @returns an array of BaseLayer objects that should be printed and that are not in the layer tree.
29
36
  */
30
37
  getLayersToPrint() {
31
- return this.map.getAllLayers().filter((layer) => layer.get('addToPrintedLayers'));
38
+ return this.getMap()
39
+ .getAllLayers()
40
+ .filter((layer) => layer.get('addToPrintedLayers'));
32
41
  }
33
42
  zoomToExtent(extent, minResolution) {
34
- this.map.getView().fit(extent, {
43
+ this.getMap().getView().fit(extent, {
35
44
  minResolution: minResolution
36
45
  });
37
46
  }
@@ -3,6 +3,10 @@ import BaseLayer from '../../models/layers/baselayer.js';
3
3
  import GroupLayer from '../../models/layers/grouplayer.js';
4
4
  import Layer from '../../models/layers/layer.js';
5
5
  import ThemeLayer from '../../models/layers/themelayer.js';
6
+ export type LayerTreeChanges = {
7
+ insertedLayers: BaseLayer[];
8
+ activatedLayers: BaseLayer[];
9
+ };
6
10
  export default class ThemesHelper extends GirafeSingleton {
7
11
  initializeSingleton(): void;
8
12
  private get state();
@@ -32,7 +36,7 @@ export default class ThemesHelper extends GirafeSingleton {
32
36
  * This prevents themes of visibly "jumping" around in the tree after being added due to reordering.
33
37
  */
34
38
  getInitialOrderForNewTheme(): number;
35
- mergeThemeInLayerTree(theme: ThemeLayer, activate?: boolean, forceTop?: boolean): BaseLayer[];
39
+ mergeThemeInLayerTree(theme: ThemeLayer, activate?: boolean, forceTop?: boolean): LayerTreeChanges;
36
40
  /**
37
41
  * This function merges the newLayer at its right place in the LayerTree
38
42
  * @param newLayer The layer to insert somewhere in the hierarchy
@@ -41,6 +45,8 @@ export default class ThemesHelper extends GirafeSingleton {
41
45
  * @returns
42
46
  */
43
47
  private mergeLayerWithExistingLayerTree;
48
+ private highlightLayerInLayerTree;
49
+ private addLayerToLayerTree;
44
50
  removeLayersFromLayerTree(layersToRemove: BaseLayer[]): void;
45
51
  private removeLayersFromExistingLayerTree;
46
52
  /**
@@ -116,7 +116,17 @@ export default class ThemesHelper extends GirafeSingleton {
116
116
  const clonedTheme = theme.clone();
117
117
  const themeAlreadyInLayersList = this.state.layers.layersList.find((l) => l.id == clonedTheme.id);
118
118
  if (themeAlreadyInLayersList) {
119
- console.info(`The theme ${clonedTheme.name} is already present in the treeview.`);
119
+ themeAlreadyInLayersList.isHighlighted = true;
120
+ const layername = this.context.i18nManager.getTranslation(clonedTheme.name);
121
+ const msg = this.context.i18nManager
122
+ .getTranslation('The theme {name} is already present in the treeview.')
123
+ .replace('{name}', layername);
124
+ this.state.infobox.elements.push({
125
+ id: theme.treeItemId,
126
+ text: msg,
127
+ type: 'info',
128
+ duration: 5000
129
+ });
120
130
  return;
121
131
  }
122
132
  if (this.context.configManager.Config.themes.selectionMode === 'replace') {
@@ -131,14 +141,14 @@ export default class ThemesHelper extends GirafeSingleton {
131
141
  }
132
142
  const themeFunctionalities = this.state.themes._allFunctionalities[theme.id];
133
143
  if (themeFunctionalities) {
134
- Object.keys(themeFunctionalities).forEach((functionality) => {
144
+ for (const functionality of Object.keys(themeFunctionalities)) {
135
145
  if (KNOWN_FUNCTIONALITIES.includes(functionality)) {
136
146
  this.state.functionalities[functionality] = themeFunctionalities[functionality];
137
147
  }
138
148
  else {
139
149
  console.warn(`Unknown functionality '${functionality}' found on Theme '${theme.name}'.`);
140
150
  }
141
- });
151
+ }
142
152
  }
143
153
  }
144
154
  getMinimalClonedThemeForLayer(layer) {
@@ -152,6 +162,10 @@ export default class ThemesHelper extends GirafeSingleton {
152
162
  children[0].isExpanded = true;
153
163
  children = children[0].children;
154
164
  }
165
+ const clonedLayer = this.findBaseLayerRecursiveById([clone], layer.id);
166
+ if (clonedLayer) {
167
+ clonedLayer.isHighlighted = true;
168
+ }
155
169
  return clone;
156
170
  }
157
171
  removeOthers(layers, keep) {
@@ -316,13 +330,9 @@ export default class ThemesHelper extends GirafeSingleton {
316
330
  }
317
331
  mergeThemeInLayerTree(theme, activate = false, forceTop = false) {
318
332
  theme.order = forceTop ? -1 : this.getInitialOrderForNewTheme();
319
- const insertedLayers = this.mergeLayerWithExistingLayerTree(theme, this.state.layers.layersList);
320
- if (activate) {
321
- for (const insertedLayer of insertedLayers) {
322
- this.context.layerManager.toggle(insertedLayer, 'on');
323
- }
324
- }
325
- return insertedLayers;
333
+ const layerTreeChanges = { insertedLayers: [], activatedLayers: [] };
334
+ this.mergeLayerWithExistingLayerTree(theme, this.state.layers.layersList, activate, layerTreeChanges);
335
+ return layerTreeChanges;
326
336
  }
327
337
  /**
328
338
  * This function merges the newLayer at its right place in the LayerTree
@@ -331,25 +341,47 @@ export default class ThemesHelper extends GirafeSingleton {
331
341
  * @param parent
332
342
  * @returns
333
343
  */
334
- mergeLayerWithExistingLayerTree(newLayer, existingList, parent) {
344
+ mergeLayerWithExistingLayerTree(newLayer, existingList, activate = false, layerTreeChanges, parent) {
335
345
  const existingLayer = existingList.find((l) => l.id === newLayer.id);
336
346
  if (!existingLayer) {
337
347
  // The theme is not already present. We just add the theme to the layertree
338
- if (parent) {
339
- newLayer.parent = parent;
340
- }
341
- existingList.push(newLayer);
342
- return [newLayer];
348
+ this.addLayerToLayerTree(newLayer, existingList, activate, layerTreeChanges, parent);
349
+ return;
350
+ }
351
+ else if (newLayer.isHighlighted) {
352
+ this.highlightLayerInLayerTree(existingLayer, activate, layerTreeChanges);
343
353
  }
344
354
  // Otherwise, we have to merge the themes
345
- const insertedLayers = [];
346
355
  if ((newLayer instanceof ThemeLayer || newLayer instanceof GroupLayer) &&
347
356
  (existingLayer instanceof ThemeLayer || existingLayer instanceof GroupLayer)) {
348
357
  for (const child of newLayer.children) {
349
- insertedLayers.push(...this.mergeLayerWithExistingLayerTree(child, existingLayer.children, existingLayer));
358
+ this.mergeLayerWithExistingLayerTree(child, existingLayer.children, activate, layerTreeChanges, existingLayer);
350
359
  }
351
360
  }
352
- return insertedLayers;
361
+ }
362
+ highlightLayerInLayerTree(existingLayer, activate, layerTreeChanges) {
363
+ existingLayer.isHighlighted = true;
364
+ if (existingLayer.parent) {
365
+ existingLayer.parent.isExpanded = true;
366
+ }
367
+ if (activate && existingLayer.inactive) {
368
+ this.context.layerManager.toggle(existingLayer, 'on');
369
+ if (layerTreeChanges) {
370
+ layerTreeChanges.activatedLayers.push(existingLayer);
371
+ }
372
+ }
373
+ }
374
+ addLayerToLayerTree(newLayer, existingList, activate = false, layerTreeChanges, parent) {
375
+ if (parent) {
376
+ newLayer.parent = parent;
377
+ }
378
+ existingList.push(newLayer);
379
+ if (activate) {
380
+ this.context.layerManager.toggle(newLayer, 'on');
381
+ }
382
+ if (layerTreeChanges) {
383
+ layerTreeChanges.insertedLayers.push(newLayer);
384
+ }
353
385
  }
354
386
  removeLayersFromLayerTree(layersToRemove) {
355
387
  for (const layerToRemove of layersToRemove) {