@geogirafe/lib-geoportal 1.2.0-dev.2813242211 → 1.2.0-dev.2816732111

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.
Files changed (70) hide show
  1. package/api/apicontext.d.ts +4 -0
  2. package/api/apicontext.js +8 -0
  3. package/api/apigeogirafeapp.js +7 -5
  4. package/api/style.css +18 -1
  5. package/components/drawing/component.d.ts +9 -2
  6. package/components/drawing/component.js +27 -10
  7. package/components/drawing-toolbar/component.js +2 -2
  8. package/components/extlayers/component.d.ts +0 -1
  9. package/components/extlayers/component.js +1 -6
  10. package/components/main.d.ts +3 -1
  11. package/components/main.js +3 -1
  12. package/components/{map → map-2d}/component.d.ts +9 -24
  13. package/components/{map → map-2d}/component.js +28 -260
  14. package/components/map-2d/deprecatedmapcomponent.d.ts +15 -0
  15. package/components/map-2d/deprecatedmapcomponent.js +24 -0
  16. package/components/{map → map-2d}/style.css +0 -30
  17. package/components/{map → map-2d}/tools/swipemanager.d.ts +1 -1
  18. package/components/map-3d/component.d.ts +50 -0
  19. package/components/map-3d/component.js +139 -0
  20. package/components/map-3d/style.css +34 -0
  21. package/components/map-3d/tools/globe.d.ts +42 -0
  22. package/components/map-3d/tools/globe.js +198 -0
  23. package/components/selectiontool/component.d.ts +2 -2
  24. package/components/selectiontool/component.js +2 -2
  25. package/package.json +1 -1
  26. package/styles/iframe.css +18 -1
  27. package/styles/index.css +18 -1
  28. package/styles/mobile.css +18 -1
  29. package/templates/iframe.html +4 -1
  30. package/templates/index.html +4 -1
  31. package/templates/mobile.html +4 -1
  32. package/templates/public/about.json +1 -1
  33. package/templates/vite.config.js +43 -25
  34. package/tools/app/geogirafeapp-mobile.js +7 -2
  35. package/tools/app/geogirafeapp.js +7 -2
  36. package/tools/context/context.d.ts +4 -0
  37. package/tools/context/context.js +8 -0
  38. package/tools/context/icontext.d.ts +4 -0
  39. package/tools/drawing/cesiumDrawing.d.ts +9 -5
  40. package/tools/drawing/cesiumDrawing.js +8 -8
  41. package/tools/drawing/olDrawing.d.ts +2 -2
  42. package/tools/drawing/olDrawing.js +1 -1
  43. package/tools/main.d.ts +2 -0
  44. package/tools/main.js +2 -0
  45. package/tools/selection/selectionmanager.d.ts +19 -0
  46. package/tools/selection/selectionmanager.js +80 -0
  47. package/tools/state/componentManager.d.ts +1 -1
  48. package/tools/tests/mockcontext.d.ts +4 -0
  49. package/tools/tests/mockcontext.js +8 -0
  50. package/{components/map/tools → tools/wmts}/wmtsmanager.d.ts +4 -7
  51. package/{components/map/tools → tools/wmts}/wmtsmanager.js +7 -10
  52. /package/components/{map → map-2d}/tools/cogmanager.d.ts +0 -0
  53. /package/components/{map → map-2d}/tools/cogmanager.js +0 -0
  54. /package/components/{map → map-2d}/tools/contextmenu.d.ts +0 -0
  55. /package/components/{map → map-2d}/tools/contextmenu.js +0 -0
  56. /package/components/{map → map-2d}/tools/drawingmanager.d.ts +0 -0
  57. /package/components/{map → map-2d}/tools/drawingmanager.js +0 -0
  58. /package/components/{map → map-2d}/tools/focusfeature.d.ts +0 -0
  59. /package/components/{map → map-2d}/tools/focusfeature.js +0 -0
  60. /package/components/{map → map-2d}/tools/osmmanager.d.ts +0 -0
  61. /package/components/{map → map-2d}/tools/osmmanager.js +0 -0
  62. /package/components/{map → map-2d}/tools/swipemanager.js +0 -0
  63. /package/components/{map → map-2d}/tools/vectortilesmanager.d.ts +0 -0
  64. /package/components/{map → map-2d}/tools/vectortilesmanager.js +0 -0
  65. /package/components/{map → map-2d}/tools/viewmanager.d.ts +0 -0
  66. /package/components/{map → map-2d}/tools/viewmanager.js +0 -0
  67. /package/components/{map → map-2d}/tools/xyzmanager.d.ts +0 -0
  68. /package/components/{map → map-2d}/tools/xyzmanager.js +0 -0
  69. /package/components/{map → map-3d}/tools/wmsmanager3d.d.ts +0 -0
  70. /package/components/{map → map-3d}/tools/wmsmanager3d.js +0 -0
@@ -27,6 +27,8 @@ import UrlManager from '../tools/url/urlmanager.js';
27
27
  import UserDataManager from '../tools/userdata/userdatamanager.js';
28
28
  import WfsManager from '../tools/wfs/wfsmanager.js';
29
29
  import WmsManager from '../tools/wms/wmsmanager.js';
30
+ import WmtsManager from '../tools/wmts/wmtsmanager.js';
31
+ import SelectionManager from '../tools/selection/selectionmanager.js';
30
32
  import IGirafeContext from '../tools/context/icontext.js';
31
33
  import ApiSessionManager from './apisessionmanager.js';
32
34
  import OnBoardingManager from '../tools/onboarding/onboardingmanager.js';
@@ -62,6 +64,8 @@ export default class GirafeApiContext implements IGirafeContext {
62
64
  readonly orderingManager: OrderingManager;
63
65
  readonly userLayerManager: UserLayerManager;
64
66
  readonly wmsManager: WmsManager;
67
+ readonly wmtsManager: WmtsManager;
68
+ readonly selectionManager: SelectionManager;
65
69
  readonly ogcApiFeaturesManager: OgcApiFeaturesManager;
66
70
  readonly localFileManager: LocalFileManager;
67
71
  readonly onBoardingManager: OnBoardingManager;
package/api/apicontext.js CHANGED
@@ -28,6 +28,8 @@ import UrlManager from '../tools/url/urlmanager.js';
28
28
  import UserDataManager from '../tools/userdata/userdatamanager.js';
29
29
  import WfsManager from '../tools/wfs/wfsmanager.js';
30
30
  import WmsManager from '../tools/wms/wmsmanager.js';
31
+ import WmtsManager from '../tools/wmts/wmtsmanager.js';
32
+ import SelectionManager from '../tools/selection/selectionmanager.js';
31
33
  import ApiSessionManager from './apisessionmanager.js';
32
34
  import OnBoardingManager from '../tools/onboarding/onboardingmanager.js';
33
35
  import ThemeFavoritesManager from '../tools/themes/themefavoritesmanager.js';
@@ -63,6 +65,8 @@ export default class GirafeApiContext {
63
65
  orderingManager;
64
66
  userLayerManager;
65
67
  wmsManager;
68
+ wmtsManager;
69
+ selectionManager;
66
70
  ogcApiFeaturesManager;
67
71
  localFileManager;
68
72
  onBoardingManager;
@@ -98,6 +102,8 @@ export default class GirafeApiContext {
98
102
  this.customThemesManager = new CustomThemesManager(this);
99
103
  this.themesManager = new ThemesManager(this);
100
104
  this.wmsManager = new WmsManager(this);
105
+ this.wmtsManager = new WmtsManager(this);
106
+ this.selectionManager = new SelectionManager(this);
101
107
  this.localFileManager = new LocalFileManager(this);
102
108
  this.ogcApiFeaturesManager = new OgcApiFeaturesManager(this);
103
109
  this.onBoardingManager = new OnBoardingManager(this);
@@ -141,7 +147,9 @@ export default class GirafeApiContext {
141
147
  this.customThemesManager.initializeSingleton();
142
148
  this.themesManager.initializeSingleton();
143
149
  this.wmsManager.initializeSingleton();
150
+ this.wmtsManager.initializeSingleton();
144
151
  this.localFileManager.initializeSingleton();
152
+ this.selectionManager.initializeSingleton();
145
153
  this.ogcApiFeaturesManager.initializeSingleton();
146
154
  this.onBoardingManager.initializeSingleton();
147
155
  this.themeFavoritesManager.initializeSingleton();
@@ -2,7 +2,8 @@ import { html as uHtml } from 'uhtml';
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import proj4 from 'proj4';
4
4
  import GirafeHTMLElement from '../base/GirafeHTMLElement.js';
5
- import MapComponent from '../components/map/component.js';
5
+ import Map2dComponent from '../components/map-2d/component.js';
6
+ import Map3dComponent from '../components/map-3d/component.js';
6
7
  import { register } from 'ol/proj/proj4.js';
7
8
  import GirafeApiContext from './apicontext.js';
8
9
  import BasemapComponent from '../components/basemap/component.js';
@@ -34,10 +35,10 @@ export default class GeoGirafeApi extends GirafeHTMLElement {
34
35
  return uHtml `<style>
35
36
  .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}button,input,select,textarea{font:inherit}.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-grad1);background-color:var(--bkg-color-grad2)}.gg-button:disabled{background-color:var(--bkg-color-grad1);color:var(--text-color-grad2);cursor:not-allowed;border:none}.gg-button:disabled img{filter:opacity(.6)}.gg-input:disabled,.gg-select:disabled,.gg-textarea:disabled{background-color:var(--bkg-color-grad1);color:var(--text-color-grad2);cursor:not-allowed}.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:not(:disabled),.gg-select:hover:not(:disabled),.gg-input:hover:not(:disabled),.gg-textarea:hover:not(:disabled),.gg-icon-button:hover:not(:disabled){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}.tippy-box{background-color:var(--bkg-color)!important;border:var(--app-standard-border)!important}.tippy-content{color:var(--text-color)!important}.tippy-arrow{color:var(--bkg-color)!important}.tippy-box[data-theme~=error]{background-color:var(--error-color);white-space:pre-line}div.tippy-box[data-theme=image-popup]{border:var(--app-standard-border)!important;& div.tippy-content{background-color:var(--bkg-color)!important;& img{max-width:20rem;max-height:20rem}}& div.tippy-arrow{color:var(--bkg-color)!important}}
36
37
  </style><style>
37
- :host{position:relative}girafe-map{width:100%;height:100%;position:relative}girafe-basemap{display:block;position:absolute;bottom:.5rem;left:.5rem}girafe-search{width:50%;height:2.25rem;display:block;position:absolute;top:.5rem;left:.5rem;box-shadow:0 1px 4px #0000004d}girafe-selection-window{z-index:100;width:400px;height:240px;position:absolute;bottom:1rem;right:1rem}
38
+ :host{position:relative}#maps{width:100%;height:100%;position:relative;overflow:hidden}girafe-map-2d{width:100%;height:100%;display:block;position:relative}girafe-map-3d{border-left:3px solid #444;height:100%;display:none;position:absolute;top:0;overflow:hidden}girafe-basemap{display:block;position:absolute;bottom:.5rem;left:.5rem}girafe-search{width:50%;height:2.25rem;display:block;position:absolute;top:.5rem;left:.5rem;box-shadow:0 1px 4px #0000004d}girafe-selection-window{z-index:100;width:400px;height:240px;position:absolute;bottom:1rem;right:1rem}
38
39
  </style>
39
40
  <style>${this.customStyle}</style>
40
- <girafe-map></girafe-map>
41
+ <div id="maps"><girafe-map-2d></girafe-map-2d><girafe-map-3d></girafe-map-3d></div>
41
42
  ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
42
43
  };
43
44
  isInitialized = false;
@@ -103,8 +104,9 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
103
104
  return new GirafeApiContext();
104
105
  }
105
106
  defineApiComponents() {
106
- if (!customElements.get('girafe-map')) {
107
- customElements.define('girafe-map', MapComponent);
107
+ if (!customElements.get('girafe-map-2d')) {
108
+ customElements.define('girafe-map-2d', Map2dComponent);
109
+ customElements.define('girafe-map-3d', Map3dComponent);
108
110
  }
109
111
  }
110
112
  manageAttributes() {
package/api/style.css CHANGED
@@ -2,10 +2,27 @@
2
2
  position: relative;
3
3
  }
4
4
 
5
- girafe-map {
5
+ #maps {
6
6
  position: relative;
7
7
  width: 100%;
8
8
  height: 100%;
9
+ overflow: hidden;
10
+ }
11
+
12
+ girafe-map-2d {
13
+ display: block;
14
+ position: relative;
15
+ width: 100%;
16
+ height: 100%;
17
+ }
18
+
19
+ girafe-map-3d {
20
+ display: none;
21
+ position: absolute;
22
+ top: 0;
23
+ height: 100%;
24
+ overflow: hidden;
25
+ border-left: solid 3px #444;
9
26
  }
10
27
 
11
28
  girafe-basemap {
@@ -2,7 +2,7 @@ import { Color } from 'vanilla-picker';
2
2
  import DrawingFeature, { ArrowPosition, ArrowStyle, DrawingShape, MeasureInformation } from '../../tools/drawing/drawingFeature.js';
3
3
  import DrawingState from '../../tools/drawing/drawingState.js';
4
4
  import OlDrawing from '../../tools/drawing/olDrawing.js';
5
- import CesiumDrawing from '../../tools/drawing/cesiumDrawing.js';
5
+ import type CesiumDrawing from '../../tools/drawing/cesiumDrawing.js';
6
6
  import GirafeHTMLElement from '../../base/GirafeHTMLElement.js';
7
7
  import GirafeColorPicker from '../../tools/utils/girafecolorpicker.js';
8
8
  import LayerDrawing from '../../models/layers/layerdrawing.js';
@@ -42,7 +42,9 @@ export default class DrawingComponent extends GirafeHTMLElement implements IGira
42
42
  activeDrawingLayer?: LayerDrawing;
43
43
  defaultLayerName: string;
44
44
  olDrawing: OlDrawing;
45
- cesiumDrawing: CesiumDrawing;
45
+ cesiumDrawing?: CesiumDrawing;
46
+ /** Promise of the running lazy creation of the CesiumDrawing, to prevent creating it twice. */
47
+ private cesiumDrawingCreation?;
46
48
  fixedLengthEnabled: boolean;
47
49
  drawingText: string;
48
50
  batchCreateMode: boolean;
@@ -58,6 +60,11 @@ export default class DrawingComponent extends GirafeHTMLElement implements IGira
58
60
  protected fixedDimensionValueChangedHandler(e: CustomEvent): void;
59
61
  protected drawingTextChangedHandler(e: Event): void;
60
62
  protected connectedCallback(): void;
63
+ /**
64
+ * Lazily loads the drawing tools for the 3D Map.
65
+ * They are only needed once the globe has been loaded, and loading them pulls in Cesium.
66
+ */
67
+ private createCesiumDrawing;
61
68
  togglePanel(visible: boolean): void;
62
69
  get selectedFeatures(): DrawingFeature[];
63
70
  deselectAllFeatures(): void;
@@ -9,13 +9,13 @@ import { html as uHtml } from 'uhtml';
9
9
  import { v4 as uuidv4 } from 'uuid';
10
10
  import DrawingFeature, { DrawingShape } from '../../tools/drawing/drawingFeature.js';
11
11
  import OlDrawing from '../../tools/drawing/olDrawing.js';
12
- import CesiumDrawing from '../../tools/drawing/cesiumDrawing.js';
13
12
  import { GeoJSON, GPX, KML } from 'ol/format.js';
14
13
  import { Polygon } from 'ol/geom.js';
15
14
  import Feature from 'ol/Feature.js';
16
15
  import GirafeHTMLElement from '../../base/GirafeHTMLElement.js';
17
16
  import { download } from '../../tools/export/download.js';
18
- import MapComponent from '../map/component.js';
17
+ import Map2dComponent from '../map-2d/component.js';
18
+ import Map3dComponent from '../map-3d/component.js';
19
19
  import GirafeColorPicker from '../../tools/utils/girafecolorpicker.js';
20
20
  import checkedIcon from '../../assets/icons/checked-full.svg?raw';
21
21
  import noCheckedIcon from '../../assets/icons/checked-no.svg?raw';
@@ -113,6 +113,8 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
113
113
  defaultLayerName = 'My Drawing';
114
114
  olDrawing;
115
115
  cesiumDrawing;
116
+ /** Promise of the running lazy creation of the CesiumDrawing, to prevent creating it twice. */
117
+ cesiumDrawingCreation;
116
118
  fixedLengthEnabled = false;
117
119
  // Text used by the "Text" drawing tool for the shapes it creates.
118
120
  drawingText = '';
@@ -171,12 +173,12 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
171
173
  registerEvents() {
172
174
  this.olDrawing.registerInteractions();
173
175
  if (this.state.globe.loaded)
174
- this.cesiumDrawing.registerInteractions();
176
+ this.cesiumDrawing?.registerInteractions();
175
177
  this.subscribe(/layers\.layersList\..*\.removalRequested/, (oldValue, value, parents) => this.onRemovalRequested(oldValue, value, parents));
176
178
  }
177
179
  unregisterEvents() {
178
180
  this.olDrawing.unregisterInteractions();
179
- this.cesiumDrawing.unregisterInteractions();
181
+ this.cesiumDrawing?.unregisterInteractions();
180
182
  }
181
183
  addColorPicker(id, set, get) {
182
184
  const parent = this.getById(id);
@@ -236,7 +238,7 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
236
238
  drawingTextChangedHandler(e) {
237
239
  this.drawingText = e.target.value;
238
240
  this.olDrawing.setDrawingText(this.drawingText);
239
- this.cesiumDrawing.setDrawingText(this.drawingText);
241
+ this.cesiumDrawing?.setDrawingText(this.drawingText);
240
242
  }
241
243
  connectedCallback() {
242
244
  super.connectedCallback();
@@ -244,14 +246,13 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
244
246
  throw new Error(`ExtendedState '${DrawingStateLocation}' has to be defined in main typescript file.`);
245
247
  }
246
248
  this.drawingState = this.state.extendedState[DrawingStateLocation];
247
- const map = this.context.componentManager.getComponents(MapComponent)[0];
249
+ const map = this.context.componentManager.getComponents(Map2dComponent)[0];
248
250
  this.olDrawing = new OlDrawing(map, DrawingStateLocation, this.context, (featureId) => {
249
251
  const drawingFeature = this.drawingState.features.find((drawingFeature) => drawingFeature.id === featureId);
250
252
  if (drawingFeature) {
251
253
  this.deleteFeature(drawingFeature);
252
254
  }
253
255
  });
254
- this.cesiumDrawing = new CesiumDrawing(map, DrawingStateLocation, this.context);
255
256
  this.render();
256
257
  this.subscribe(`extendedState.${DrawingStateLocation}.features`, (olds, news) => this.onFeaturesChanged(olds, news));
257
258
  // Keep the shape list and the options in sync when the selection is changed in the map
@@ -261,16 +262,32 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
261
262
  }
262
263
  });
263
264
  this.subscribe('projection', (olds, news) => this.onProjectionChanged(olds, news));
264
- this.subscribe('globe.loaded', () => {
265
+ this.subscribe('globe.loaded', async () => {
266
+ if (this.state.globe.loaded) {
267
+ await this.createCesiumDrawing();
268
+ }
265
269
  if (this.state.globe.loaded && this.isPanelVisible) {
266
- this.cesiumDrawing.registerInteractions();
270
+ this.cesiumDrawing?.registerInteractions();
267
271
  }
268
272
  else {
269
- this.cesiumDrawing.unregisterInteractions();
273
+ this.cesiumDrawing?.unregisterInteractions();
270
274
  }
271
275
  });
272
276
  this.subscribe('projection', (_, newProjection) => this.warnWhenInWebMercator(newProjection));
273
277
  }
278
+ /**
279
+ * Lazily loads the drawing tools for the 3D Map.
280
+ * They are only needed once the globe has been loaded, and loading them pulls in Cesium.
281
+ */
282
+ async createCesiumDrawing() {
283
+ this.cesiumDrawingCreation ??= (async () => {
284
+ const map3d = this.context.componentManager.getComponents(Map3dComponent)[0];
285
+ const { default: CesiumDrawing } = await import('../../tools/drawing/cesiumDrawing');
286
+ this.cesiumDrawing = new CesiumDrawing(map3d, DrawingStateLocation, this.context);
287
+ this.cesiumDrawing.setDrawingText(this.drawingText);
288
+ })();
289
+ return this.cesiumDrawingCreation;
290
+ }
274
291
  togglePanel(visible) {
275
292
  if (this.isPanelVisible == visible)
276
293
  return;
@@ -8,7 +8,7 @@ import { html as uHtml } from 'uhtml';
8
8
  // SPDX-License-Identifier: Apache-2.0
9
9
  import GirafeHTMLElement from '../../base/GirafeHTMLElement.js';
10
10
  import { DrawingShape } from '../../tools/drawing/drawingFeature.js';
11
- import MapComponent from '../map/component.js';
11
+ import Map2dComponent from '../map-2d/component.js';
12
12
  import OlDrawing from '../../tools/drawing/olDrawing.js';
13
13
  import DrawingState from '../../tools/drawing/drawingState.js';
14
14
  import { UsedInTemplateOnly } from '../../decorators.js';
@@ -45,7 +45,7 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
45
45
  return this.context.mapManager.getMap();
46
46
  }
47
47
  get mapComponent() {
48
- return this.context.componentManager.getComponents(MapComponent)[0];
48
+ return this.context.componentManager.getComponents(Map2dComponent)[0];
49
49
  }
50
50
  constructor() {
51
51
  super('advanced-filter-drawing-toolbar');
@@ -22,7 +22,6 @@ declare class ExternalLayersComponent extends GirafeHTMLElement implements IGira
22
22
  get predefinedWmsWmtsSources(): PredefinedSource[];
23
23
  get hasPredefinedWmsWmtsSources(): boolean;
24
24
  selectedTab: 'wms_wmts' | 'file';
25
- private wmtsManager;
26
25
  private themeName?;
27
26
  private externalLayers;
28
27
  filteredLayers: ExternalLayer[];
@@ -4,7 +4,6 @@ import { html as uHtml } from 'uhtml';
4
4
  import GirafeHTMLElement from '../../base/GirafeHTMLElement.js';
5
5
  import ServerOgc from '../../models/serverogc.js';
6
6
  import { WmsClientDefault } from '../../tools/wms/wmsclient.js';
7
- import WmtsManager from '../map/tools/wmtsmanager.js';
8
7
  import LayerWmsExternal from '../../models/layers/layerwmsexternal.js';
9
8
  import LayerWmtsExternal from '../../models/layers/layerwmtsexternal.js';
10
9
  import ThemeLayerExternal from '../../models/layers/themelayerexternal.js';
@@ -35,7 +34,6 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
35
34
  return this.predefinedWmsWmtsSources.length > 0;
36
35
  }
37
36
  selectedTab = 'wms_wmts';
38
- wmtsManager;
39
37
  themeName;
40
38
  externalLayers = [];
41
39
  filteredLayers = [];
@@ -122,7 +120,7 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
122
120
  }
123
121
  async scanLayersWMTS(url) {
124
122
  this.themeName = this.parseName(url);
125
- const capabilities = await this.wmtsManager.getWmtsCapabilities(url);
123
+ const capabilities = await this.context.wmtsManager.getWmtsCapabilities(url);
126
124
  this.loading = false;
127
125
  if (capabilities?.ServiceIdentification?.Title) {
128
126
  this.themeName = capabilities.ServiceIdentification.Title;
@@ -225,9 +223,6 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
225
223
  }
226
224
  connectedCallback() {
227
225
  super.connectedCallback();
228
- const olMap = this.context.mapManager.getMap();
229
- // TODO REG : User context singleton for the WMTS-Manager
230
- this.wmtsManager = new WmtsManager(olMap, this.context.stateManager);
231
226
  const config = this.context.configManager.Config;
232
227
  this.predefinedSources = config.externalLayers?.predefinedSources || [];
233
228
  this.render();
@@ -29,7 +29,9 @@ export { default as InfoboxComponent } from './infobox/component.js';
29
29
  export { default as InfoWindowComponent } from './infowindow/component.js';
30
30
  export { default as LayoutComponent } from './layout/component.js';
31
31
  export { default as LRPanelComponent } from './lr-panel/component.js';
32
- export { default as MapComponent } from './map/component.js';
32
+ export { default as Map2dComponent } from './map-2d/component.js';
33
+ export { default as DeprecatedMapComponent } from './map-2d/deprecatedmapcomponent.js';
34
+ export { default as Map3dComponent } from './map-3d/component.js';
33
35
  export { default as MenuMobile } from './menu-mobile/component.js';
34
36
  export { default as MenuButtonComponent } from './menubutton/component.js';
35
37
  export { default as ModalsComponent } from './modals/component.js';
@@ -28,7 +28,9 @@ export { default as InfoboxComponent } from './infobox/component.js';
28
28
  export { default as InfoWindowComponent } from './infowindow/component.js';
29
29
  export { default as LayoutComponent } from './layout/component.js';
30
30
  export { default as LRPanelComponent } from './lr-panel/component.js';
31
- export { default as MapComponent } from './map/component.js';
31
+ export { default as Map2dComponent } from './map-2d/component.js';
32
+ export { default as DeprecatedMapComponent } from './map-2d/deprecatedmapcomponent.js';
33
+ export { default as Map3dComponent } from './map-3d/component.js';
32
34
  export { default as MenuMobile } from './menu-mobile/component.js';
33
35
  export { default as MenuButtonComponent } from './menubutton/component.js';
34
36
  export { default as ModalsComponent } from './modals/component.js';
@@ -8,10 +8,8 @@ import { DragBoxEvent } from 'ol/interaction/DragBox.js';
8
8
  import { Geometry } from 'ol/geom.js';
9
9
  import { Extent } from 'ol/extent.js';
10
10
  import SwipeManager from './tools/swipemanager.js';
11
- import WmsManager3d from './tools/wmsmanager3d.js';
12
11
  import OsmManager from './tools/osmmanager.js';
13
12
  import VectorTilesManager from './tools/vectortilesmanager.js';
14
- import WmtsManager from './tools/wmtsmanager.js';
15
13
  import ViewManager from './tools/viewmanager.js';
16
14
  import CogManager from './tools/cogmanager.js';
17
15
  import DrawingManager from './tools/drawingmanager.js';
@@ -21,30 +19,17 @@ import Layer from '../../models/layers/layer.js';
21
19
  import BaseLayer from '../../models/layers/baselayer.js';
22
20
  import { FocusFeature } from './tools/focusfeature.js';
23
21
  import XyzManager from './tools/xyzmanager.js';
24
- import SelectionParam from '../../models/selectionparam.js';
25
- import { CameraConfig } from '../../tools/state/globe.js';
26
22
  import { Callback } from '../../tools/state/statemanager.js';
27
23
  import { StyleFunction } from 'ol/style/Style.js';
28
- declare global {
29
- interface Window {
30
- Cesium: unknown;
31
- }
32
- }
33
- export default class MapComponent extends GirafeHTMLElement {
24
+ export default class Map2dComponent extends GirafeHTMLElement {
34
25
  protected templateUrl: string | null;
35
26
  protected styleUrls: string[] | null;
36
27
  template: () => import("uhtml").Hole;
37
28
  olMap: Map;
38
29
  mapTarget: HTMLDivElement;
39
- map3d: any;
40
- map3dTarget: HTMLDivElement;
41
- map3dShadowsTimestamp: number;
42
- loading: boolean;
43
30
  swiper: HTMLInputElement;
44
31
  closeSwiperButton: HTMLButtonElement;
45
32
  swipeManager: SwipeManager;
46
- wmtsManager: WmtsManager;
47
- wmsManager3d: WmsManager3d | null;
48
33
  osmManager: OsmManager;
49
34
  cogManager: CogManager;
50
35
  xyzManager: XyzManager;
@@ -79,7 +64,8 @@ export default class MapComponent extends GirafeHTMLElement {
79
64
  dragbox: DragBox;
80
65
  focusFeature: FocusFeature;
81
66
  mapTargetResizeObserver: ResizeObserver;
82
- constructor();
67
+ private get wmtsManager();
68
+ constructor(name?: string);
83
69
  /**
84
70
  * The Map needs to be displayed in Fullscreen Mode.
85
71
  */
@@ -109,7 +95,6 @@ export default class MapComponent extends GirafeHTMLElement {
109
95
  onDragSelection(_e: DragBoxEvent): void;
110
96
  select(extent: number[]): void;
111
97
  selectNone(): void;
112
- onSelectFeatures(selectionParams: SelectionParam[]): Promise<void>;
113
98
  protected connectedCallback(): void;
114
99
  onCustomGirafeEvent(details: {
115
100
  action: string;
@@ -124,14 +109,14 @@ export default class MapComponent extends GirafeHTMLElement {
124
109
  private setSelectLayerStyle;
125
110
  private setHighlightLayerStyle;
126
111
  private setCrosshairStyle;
127
- create3dMap(): Promise<void>;
128
- addAllActiveLayers3dMap(layer: BaseLayer): void;
129
- onGlobeToggled(): Promise<void>;
130
- onShadowsToggled(shadows: boolean): void;
131
- onShadowsTimestampChanged(shadowsTimestamp: number): void;
112
+ /**
113
+ * Resizes the 2D Map depending on the current globe display mode.
114
+ * In side-by-side mode the 2D Map only takes the left part of the available space,
115
+ * in full 3D mode it is hidden. The 3D Map takes care of its own sizing.
116
+ */
117
+ onGlobeDisplayChanged(display: string): void;
132
118
  onFeaturesSelected(features: Feature[]): void;
133
119
  onFeatureHighlighted(features: Feature[]): void;
134
- onCameraChanged(camera: CameraConfig | null): void;
135
120
  zoomToExtent(extent: Extent): void;
136
121
  onChangeProjection(_oldSrid: string, newSrid: string): void;
137
122
  onChangeDarkMode(): void;