qwc2 2026.7.30 → 2026.8.2

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.
@@ -44,7 +44,8 @@ var ResizeableWindow = /*#__PURE__*/function (_React$Component) {
44
44
  _classCallCheck(this, ResizeableWindow);
45
45
  _this = _callSuper(this, ResizeableWindow, [props]);
46
46
  _defineProperty(_this, "state", {
47
- geometry: null
47
+ geometry: null,
48
+ withinMapContainer: false
48
49
  });
49
50
  _defineProperty(_this, "updateSize", function (size) {
50
51
  _this.rnd.updateSize(size);
@@ -163,7 +164,7 @@ var ResizeableWindow = /*#__PURE__*/function (_React$Component) {
163
164
  var splitTopAndBottomBar = _this.props.splitTopAndBottomBar && _this.props.splitScreenWhenDocked && (docked || maximized);
164
165
  var marginLeft = 0;
165
166
  var marginRight = 0;
166
- if (!splitTopAndBottomBar) {
167
+ if (!splitTopAndBottomBar && !_this.state.withinMapContainer) {
167
168
  marginLeft = _this.props.mapMargins.outerLeft + _this.props.menuMargins.left;
168
169
  marginRight = _this.props.mapMargins.outerRight + _this.props.menuMargins.right;
169
170
  }
@@ -282,6 +283,7 @@ var ResizeableWindow = /*#__PURE__*/function (_React$Component) {
282
283
  if (!container) {
283
284
  return;
284
285
  }
286
+ var withinMapContainer = !!container.closest('.map-container');
285
287
  var width = Math.min(_this.props.initialWidth, container.offsetWidth);
286
288
  var height = Math.min(_this.props.initialHeight, container.offsetHeight);
287
289
  var geometry = null;
@@ -304,7 +306,8 @@ var ResizeableWindow = /*#__PURE__*/function (_React$Component) {
304
306
  _this.props.setSplitScreen(_this.id, dockSide, dockSize, _this.props.splitTopAndBottomBar);
305
307
  }
306
308
  _this.setState({
307
- geometry: geometry
309
+ geometry: geometry,
310
+ withinMapContainer: withinMapContainer
308
311
  });
309
312
  });
310
313
  _defineProperty(_this, "computeInitialX", function (container, x) {
@@ -107,7 +107,7 @@ var EditDataset3D = /*#__PURE__*/function (_React$Component) {
107
107
  _this.transformControls.addEventListener('dragging-changed', function (event) {
108
108
  _this.props.sceneContext.scene.view.controls.enabled = !event.value;
109
109
  });
110
- _this.props.sceneContext.scene.view.controls.addEventListener('change', _this.updateTransformHelper);
110
+ _this.props.sceneContext.eventDispatcher.addEventListener('cameraChanged', _this.updateTransformHelper);
111
111
  _this.props.sceneContext.scene.notifyChange();
112
112
  });
113
113
  _defineProperty(_this, "onHide", function () {
@@ -117,7 +117,7 @@ var EditDataset3D = /*#__PURE__*/function (_React$Component) {
117
117
  _this.transformControls = null;
118
118
  var domElement = _this.props.sceneContext.scene.renderer.domElement;
119
119
  domElement.removeEventListener('keydown', _this.onKeyDown);
120
- _this.props.sceneContext.scene.view.controls.removeEventListener('change', _this.updateTransformHelper);
120
+ _this.props.sceneContext.eventDispatcher.removeEventListener('cameraChanged', _this.updateTransformHelper);
121
121
  _this.props.sceneContext.scene.notifyChange();
122
122
  _this.setState(EditDataset3D.defaultState);
123
123
  });
@@ -107,7 +107,7 @@ var HeightProfilePrintDialog = /*#__PURE__*/function (_React$PureComponent) {
107
107
  this.externalWindow.addEventListener('load', this.setWindowContent, false);
108
108
  this.externalWindow.addEventListener('resize', this.windowResized, false);
109
109
  window.addEventListener('beforeunload', this.closePrintWindow);
110
- this.props.sceneContext.scene.view.controls.addEventListener('change', this.scheduleRefreshImage);
110
+ this.props.sceneContext.eventDispatcher.addEventListener('cameraChanged', this.scheduleRefreshImage);
111
111
  }
112
112
  }, {
113
113
  key: "componentDidUpdate",
@@ -121,7 +121,7 @@ var HeightProfilePrintDialog = /*#__PURE__*/function (_React$PureComponent) {
121
121
  value: function componentWillUnmount() {
122
122
  this.closePrintWindow();
123
123
  window.removeEventListener('beforeunload', this.closePrintWindow);
124
- this.props.sceneContext.scene.view.controls.removeEventListener('change', this.scheduleRefreshImage);
124
+ this.props.sceneContext.eventDispatcher.removeEventListener('cameraChanged', this.scheduleRefreshImage);
125
125
  }
126
126
  }, {
127
127
  key: "render",
@@ -721,6 +721,12 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
721
721
  _defineProperty(_this2, "getMap", function () {
722
722
  return _this2.map;
723
723
  });
724
+ _defineProperty(_this2, "onCameraChanged", function (center, camera, fov) {
725
+ _this2.state.sceneContext.eventDispatcher.dispatchEvent({
726
+ type: 'cameraChanged'
727
+ });
728
+ _this2.props.onCameraChanged(center, camera, fov);
729
+ });
724
730
  _defineProperty(_this2, "renderBaseLayer", function () {
725
731
  var baseLayer = _this2.state.sceneContext.baseLayers.find(function (e) {
726
732
  return e.visibility === true;
@@ -1456,7 +1462,7 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
1456
1462
  }, /*#__PURE__*/React.createElement(MapControls3D, {
1457
1463
  controlsPosition: this.props.controlsPosition,
1458
1464
  mouseButtons: this.props.mouseButtons,
1459
- onCameraChanged: this.props.onCameraChanged,
1465
+ onCameraChanged: this.onCameraChanged,
1460
1466
  onControlsSet: this.setupControls,
1461
1467
  sceneContext: this.state.sceneContext
1462
1468
  }, /*#__PURE__*/React.createElement(EditDataset3D, {
@@ -129,10 +129,10 @@ var SearchField3D = /*#__PURE__*/function (_React$Component) {
129
129
  pin.scale.set(scale, scale, scale);
130
130
  pin.updateMatrixWorld();
131
131
  };
132
- sceneContext.scene.view.controls.addEventListener('change', scaleSearchMarker);
132
+ sceneContext.eventDispatcher.addEventListener('cameraChanged', scaleSearchMarker);
133
133
  searchMarker.addEventListener('removed', function () {
134
134
  var _labelEl$parentNode, _labelEl$parentNode$r;
135
- sceneContext.scene.view.controls.removeEventListener('change', scaleSearchMarker);
135
+ sceneContext.eventDispatcher.removeEventListener('cameraChanged', scaleSearchMarker);
136
136
  // The label DOM element is not removed when the searchMarker group is removed from the instance
137
137
  (_labelEl$parentNode = labelEl.parentNode) === null || _labelEl$parentNode === void 0 || (_labelEl$parentNode$r = _labelEl$parentNode.removeChild) === null || _labelEl$parentNode$r === void 0 || _labelEl$parentNode$r.call(_labelEl$parentNode, labelEl);
138
138
  });
@@ -571,7 +571,7 @@ var EditTool3D = /*#__PURE__*/function (_React$Component) {
571
571
  selectCount: 1
572
572
  });
573
573
  }
574
- this.props.sceneContext.scene.view.controls.addEventListener('change', this.updateTransformHelper);
574
+ this.props.sceneContext.eventDispatcher.addEventListener('cameraChanged', this.updateTransformHelper);
575
575
  this.props.sceneContext.scene.notifyChange();
576
576
  }
577
577
  }, {
@@ -647,7 +647,7 @@ var EditTool3D = /*#__PURE__*/function (_React$Component) {
647
647
  this.props.sceneContext.scene.remove(this.transformControls.getHelper());
648
648
  this.transformControls.dispose();
649
649
  var domElement = this.props.sceneContext.scene.renderer.domElement;
650
- this.props.sceneContext.scene.view.controls.removeEventListener('change', this.updateTransformHelper);
650
+ this.props.sceneContext.eventDispatcher.removeEventListener('cameraChanged', this.updateTransformHelper);
651
651
  domElement.removeEventListener("pointerdown", this.selectShapeOnRelease);
652
652
  domElement.removeEventListener('keydown', this.onKeyDown);
653
653
  this.props.sceneContext.scene.notifyChange();
@@ -66,7 +66,9 @@ export default {
66
66
  var crs = CoordinateSystem.get(projection);
67
67
  return new StaticFeatureSource({
68
68
  coordinateSystem: crs,
69
- features: colorlayer.source.source.getFeatures()
69
+ features: colorlayer.source.source.getFeatures().filter(function (f) {
70
+ return f.getGeometry().getType() === "Polygon";
71
+ })
70
72
  });
71
73
  }
72
74
  };
@@ -288,6 +288,11 @@ var FirstPersonControls3D = /*#__PURE__*/function (_Controls) {
288
288
  this.update();
289
289
  }
290
290
  }
291
+ }, {
292
+ key: "getAzimuthalAngle",
293
+ value: function getAzimuthalAngle() {
294
+ return this.yaw;
295
+ }
291
296
  }, {
292
297
  key: "dispose",
293
298
  value: function dispose() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qwc2",
3
- "version": "2026.07.30",
3
+ "version": "2026.08.02",
4
4
  "description": "QGIS Web Client",
5
5
  "author": "Sourcepole AG",
6
6
  "license": "BSD-2-Clause",
@@ -212,6 +212,18 @@ var ObliqueView = /*#__PURE__*/function (_React$Component) {
212
212
  _this.focusedMap = null;
213
213
  }
214
214
  });
215
+ _defineProperty(_this, "trackPointerFocus", function (ev) {
216
+ var _this$map2, _this$map2$getTargetE, _mapEl$contains2, _mapObliqueEl$contain2;
217
+ var mapEl = document.getElementById("map");
218
+ var mapObliqueEl = (_this$map2 = _this.map) === null || _this$map2 === void 0 || (_this$map2$getTargetE = _this$map2.getTargetElement) === null || _this$map2$getTargetE === void 0 ? void 0 : _this$map2$getTargetE.call(_this$map2);
219
+ if (mapEl !== null && mapEl !== void 0 && (_mapEl$contains2 = mapEl.contains) !== null && _mapEl$contains2 !== void 0 && _mapEl$contains2.call(mapEl, ev.target)) {
220
+ _this.focusedMap = "map";
221
+ } else if (mapObliqueEl !== null && mapObliqueEl !== void 0 && (_mapObliqueEl$contain2 = mapObliqueEl.contains) !== null && _mapObliqueEl$contain2 !== void 0 && _mapObliqueEl$contain2.call(mapObliqueEl, ev.target)) {
222
+ _this.focusedMap = "mapOblique";
223
+ } else {
224
+ _this.focusedMap = null;
225
+ }
226
+ });
215
227
  var controls = ol.control.defaults({
216
228
  zoom: false,
217
229
  attribution: false,
@@ -251,6 +263,7 @@ var ObliqueView = /*#__PURE__*/function (_React$Component) {
251
263
  key: "componentDidMount",
252
264
  value: function componentDidMount() {
253
265
  window.addEventListener('focus', this.trackFocus, true);
266
+ window.addEventListener('pointerdown', this.trackPointerFocus);
254
267
  if (this.props.startupParams.v === "oblique") {
255
268
  this.props.setViewMode(ViewMode._Oblique);
256
269
  }
@@ -259,6 +272,7 @@ var ObliqueView = /*#__PURE__*/function (_React$Component) {
259
272
  key: "componentWillUnmount",
260
273
  value: function componentWillUnmount() {
261
274
  window.removeEventListener('focus', this.trackFocus);
275
+ window.removeEventListener('pointerdown', this.trackPointerFocus);
262
276
  }
263
277
  }, {
264
278
  key: "componentDidUpdate",
package/plugins/View3D.js CHANGED
@@ -168,6 +168,18 @@ var View3D = /*#__PURE__*/function (_React$Component) {
168
168
  _this.focusedMap = null;
169
169
  }
170
170
  });
171
+ _defineProperty(_this, "trackPointerFocus", function (ev) {
172
+ var _mapEl$contains2, _map3dEl$contains2;
173
+ var mapEl = document.getElementById("map");
174
+ var map3dEl = document.getElementById("map3d");
175
+ if (mapEl !== null && mapEl !== void 0 && (_mapEl$contains2 = mapEl.contains) !== null && _mapEl$contains2 !== void 0 && _mapEl$contains2.call(mapEl, ev.target)) {
176
+ _this.focusedMap = "map";
177
+ } else if (map3dEl !== null && map3dEl !== void 0 && (_map3dEl$contains2 = map3dEl.contains) !== null && _map3dEl$contains2 !== void 0 && _map3dEl$contains2.call(map3dEl, ev.target)) {
178
+ _this.focusedMap = "map3d";
179
+ } else {
180
+ _this.focusedMap = null;
181
+ }
182
+ });
171
183
  _this.map3dComponent = null;
172
184
  _this.map3dComponentRef = null;
173
185
  _this.focusedMap = null;
@@ -255,12 +267,14 @@ var View3D = /*#__PURE__*/function (_React$Component) {
255
267
  this.props.setViewMode(ViewMode._3DSplitscreen);
256
268
  }
257
269
  window.addEventListener('focus', this.trackFocus, true);
270
+ window.addEventListener('pointerdown', this.trackPointerFocus);
258
271
  this.syncParentStore({});
259
272
  }
260
273
  }, {
261
274
  key: "componentWillUnmount",
262
275
  value: function componentWillUnmount() {
263
276
  window.removeEventListener('focus', this.trackFocus);
277
+ window.removeEventListener('pointerdown', this.trackPointerFocus);
264
278
  }
265
279
  }, {
266
280
  key: "componentDidUpdate",
@@ -152,6 +152,14 @@ var RedliningSupport = /*#__PURE__*/function (_React$Component) {
152
152
  deletedKeys.forEach(function (key) {
153
153
  _this.selectedFeatures[0].unset(key);
154
154
  });
155
+ if (_this.props.redlining.showmeasurements) {
156
+ var settings = {
157
+ displayCrs: _this.props.displayCrs,
158
+ lenUnit: _this.props.redlining.lenUnit,
159
+ areaUnit: _this.props.redlining.areaUnit
160
+ };
161
+ MeasureUtils.updateFeatureMeasurements(_this.selectedFeatures[0], _this.selectedFeatures[0].get('shape'), _this.props.mapCrs, settings);
162
+ }
155
163
  _this.props.changeRedliningState({
156
164
  selectedFeature: feature,
157
165
  geomType: feature.shape
@@ -121,14 +121,13 @@ var Compare3D = /*#__PURE__*/function (_React$Component) {
121
121
  });
122
122
  _defineProperty(_this, "enableArrows", function () {
123
123
  _this.props.sceneContext.addSceneObject("__compareArrows", _this.arrows);
124
- _this.props.sceneContext.scene.view.controls.addEventListener('change', _this.centerArrowsInView);
124
+ _this.props.sceneContext.eventDispatcher.addEventListener('cameraChanged', _this.centerArrowsInView);
125
125
  var renderer = _this.props.sceneContext.scene.renderer;
126
126
  renderer.domElement.addEventListener("pointerdown", _this.dragArrows);
127
127
  _this.centerArrowsInView();
128
128
  });
129
129
  _defineProperty(_this, "disableArrows", function () {
130
- var _this$props$sceneCont, _this$props$sceneCont2;
131
- (_this$props$sceneCont = _this.props.sceneContext.scene.view.controls) === null || _this$props$sceneCont === void 0 || (_this$props$sceneCont2 = _this$props$sceneCont.removeEventListener) === null || _this$props$sceneCont2 === void 0 || _this$props$sceneCont2.call(_this$props$sceneCont, 'change', _this.centerArrowsInView);
130
+ _this.props.sceneContext.eventDispatcher.removeEventListener('cameraChanged', _this.centerArrowsInView);
132
131
  _this.props.sceneContext.removeSceneObject("__compareArrows");
133
132
  _this.props.sceneContext.scene.renderer.domElement.removeEventListener("pointerdown", _this.dragArrows);
134
133
  });
@@ -186,11 +185,11 @@ var Compare3D = /*#__PURE__*/function (_React$Component) {
186
185
  _this.positionArrows(newPos.x, newPos.y, _this.state.planeA);
187
186
  });
188
187
  _defineProperty(_this, "positionArrows", function (x, y, alpha) {
189
- var _this$props$sceneCont3;
188
+ var _this$props$sceneCont;
190
189
  var target = new Vector3(x, y, 0);
191
190
  var distance = _this.props.sceneContext.scene.view.camera.position.distanceTo(target);
192
191
  var scale = Math.max(1, distance / 200);
193
- var z = (_this$props$sceneCont3 = _this.props.sceneContext.getTerrainHeightFromMap([x, y])) !== null && _this$props$sceneCont3 !== void 0 ? _this$props$sceneCont3 : 0;
192
+ var z = (_this$props$sceneCont = _this.props.sceneContext.getTerrainHeightFromMap([x, y])) !== null && _this$props$sceneCont !== void 0 ? _this$props$sceneCont : 0;
194
193
  _this.arrows.position.x = target.x;
195
194
  _this.arrows.position.y = target.y;
196
195
  _this.arrows.position.z = z;
@@ -302,9 +301,9 @@ var Compare3D = /*#__PURE__*/function (_React$Component) {
302
301
  if (intersection) {
303
302
  sceneTarget = intersection.point;
304
303
  } else {
305
- var _this$props$sceneCont4;
304
+ var _this$props$sceneCont2;
306
305
  sceneTarget = _this.props.sceneContext.scene.view.controls.target.clone();
307
- sceneTarget.z = (_this$props$sceneCont4 = _this.props.sceneContext.getTerrainHeightFromMap([sceneTarget.x, sceneTarget.y])) !== null && _this$props$sceneCont4 !== void 0 ? _this$props$sceneCont4 : 0 + 2;
306
+ sceneTarget.z = (_this$props$sceneCont2 = _this.props.sceneContext.getTerrainHeightFromMap([sceneTarget.x, sceneTarget.y])) !== null && _this$props$sceneCont2 !== void 0 ? _this$props$sceneCont2 : 0 + 2;
308
307
  }
309
308
  newState.planeX = sceneTarget.x;
310
309
  newState.planeY = sceneTarget.y;
@@ -521,7 +521,7 @@ var MapLight3D = /*#__PURE__*/function (_React$Component) {
521
521
  var shadowCameraHelper = new CameraHelper(sunLight.shadow.camera);
522
522
  this.props.sceneContext.addSceneObject("__shadowCameraHelper", shadowCameraHelper);
523
523
  }
524
- this.props.sceneContext.scene.view.controls.addEventListener('change', this.setLighting);
524
+ this.props.sceneContext.eventDispatcher.addEventListener('cameraChanged', this.setLighting);
525
525
  this.setLighting();
526
526
  } else if (this.state.lightParams !== prevState.lightParams) {
527
527
  if (this.state.lightParams.helpersVisible && !prevState.lightParams.helpersVisible) {
@@ -545,6 +545,7 @@ var MapLight3D = /*#__PURE__*/function (_React$Component) {
545
545
  this.props.sceneContext.removeSceneObject("__moonLight");
546
546
  this.props.sceneContext.removeSceneObject("__sunLightHelper");
547
547
  this.props.sceneContext.removeSceneObject("__shadowCameraHelper");
548
+ this.props.sceneContext.eventDispatcher.removeEventListener('cameraChanged', this.setLighting);
548
549
  }
549
550
  }, {
550
551
  key: "render",
@@ -60,12 +60,12 @@ var OverviewMap3D = /*#__PURE__*/function (_React$Component) {
60
60
  return _createClass(OverviewMap3D, [{
61
61
  key: "componentDidMount",
62
62
  value: function componentDidMount() {
63
- this.props.sceneContext.scene.view.controls.addEventListener('change', this.updateViewCone);
63
+ this.props.sceneContext.eventDispatcher.addEventListener('cameraChanged', this.updateViewCone);
64
64
  }
65
65
  }, {
66
66
  key: "componentWillUnmount",
67
67
  value: function componentWillUnmount() {
68
- this.props.sceneContext.scene.view.controls.removeEventListener('change', this.updateViewCone);
68
+ this.props.sceneContext.eventDispatcher.removeEventListener('cameraChanged', this.updateViewCone);
69
69
  }
70
70
  }, {
71
71
  key: "componentDidUpdate",
@@ -126,7 +126,7 @@ var Viewshed3D = /*#__PURE__*/function (_React$Component) {
126
126
  _this.transformControls.attach(_this.observerMesh);
127
127
  _this.transformControls.getHelper().updateMatrixWorld();
128
128
  scene.add(_this.transformControls.getHelper());
129
- _this.props.sceneContext.scene.view.controls.addEventListener('change', _this.updateTransformHelper);
129
+ _this.props.sceneContext.eventDispatcher.addEventListener('cameraChanged', _this.updateTransformHelper);
130
130
  _this.props.sceneContext.scene.notifyChange();
131
131
  });
132
132
  _defineProperty(_this, "onHide", function () {
@@ -134,7 +134,7 @@ var Viewshed3D = /*#__PURE__*/function (_React$Component) {
134
134
  _this.transformControls.removeEventListener('dragging-changed', _this.onControlDrag);
135
135
  _this.transformControls.removeEventListener('objectChange', _this.onControlChange);
136
136
  _this.transformControls.removeEventListener('change', _this.onControlChange);
137
- _this.props.sceneContext.scene.view.controls.removeEventListener('change', _this.updateTransformHelper);
137
+ _this.props.sceneContext.eventDispatcher.removeEventListener('cameraChanged', _this.updateTransformHelper);
138
138
  _this.overriddenMaterials.forEach(function (material) {
139
139
  material.onBeforeCompile = material.userData.originalOnBeforeCompile;
140
140
  delete material.userData.originalOnBeforeCompile;
@@ -523,7 +523,7 @@ var ServiceLayerUtils = {
523
523
  parseAttributeValue: true,
524
524
  removeNSPrefix: true,
525
525
  processEntities: {
526
- maxTotalExpansions: 10000
526
+ maxTotalExpansions: ConfigUtils.getConfigProp("xmlMaxTotalExpansions", null, 10000)
527
527
  }
528
528
  };
529
529
  resolve({