qwc2 2026.2.2 → 2026.2.4
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.
|
@@ -82,7 +82,7 @@ var BuiltinExporters = [{
|
|
|
82
82
|
var feature = MiscUtils.objectOmit(entry, EXCLUDE_PROPS);
|
|
83
83
|
feature.properties = MiscUtils.objectOmit(feature.properties, EXCLUDE_ATTRS);
|
|
84
84
|
if (feature.geometry) {
|
|
85
|
-
feature.geometry = VectorLayerUtils.reprojectGeometry(feature.geometry, entry, 'EPSG:4326');
|
|
85
|
+
feature.geometry = VectorLayerUtils.reprojectGeometry(feature.geometry, entry.crs, 'EPSG:4326');
|
|
86
86
|
}
|
|
87
87
|
return feature;
|
|
88
88
|
})
|
|
@@ -132,8 +132,7 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
132
132
|
getSceneIntersection: function getSceneIntersection(x, y, objects) {},
|
|
133
133
|
getSetting: function getSetting(key) {},
|
|
134
134
|
setSetting: function setSetting(key, value) {}
|
|
135
|
-
})
|
|
136
|
-
sceneId: null
|
|
135
|
+
})
|
|
137
136
|
});
|
|
138
137
|
_defineProperty(_this2, "applyBaseLayer", function () {
|
|
139
138
|
var _baseLayer$name;
|
|
@@ -422,7 +421,7 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
422
421
|
url: MiscUtils.resolveAssetsPath(url)
|
|
423
422
|
});
|
|
424
423
|
// Recenter tile group
|
|
425
|
-
tiles.tiles.addEventListener('load-
|
|
424
|
+
tiles.tiles.addEventListener('load-tileset', function (_ref7) {
|
|
426
425
|
var tileSet = _ref7.tileSet;
|
|
427
426
|
if (tileSet.root.parent === null) {
|
|
428
427
|
var bbox = new Box3();
|
|
@@ -692,7 +691,7 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
692
691
|
url: MiscUtils.resolveAssetsPath(entry.url),
|
|
693
692
|
errorTarget: 32
|
|
694
693
|
});
|
|
695
|
-
tiles.tiles.addEventListener('load-
|
|
694
|
+
tiles.tiles.addEventListener('load-tileset', function () {
|
|
696
695
|
_this2.instance.notifyChange(tiles);
|
|
697
696
|
});
|
|
698
697
|
tiles.tiles.addEventListener('needs-update', function () {
|
|
@@ -774,6 +773,10 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
774
773
|
_this2.instance.addEventListener('after-entity-update', _this2.instanceOnAfterEntityUpdate);
|
|
775
774
|
});
|
|
776
775
|
_defineProperty(_this2, "instanceOnUpdateStart", function () {
|
|
776
|
+
var _this2$state$sceneCon2;
|
|
777
|
+
if (!((_this2$state$sceneCon2 = _this2.state.sceneContext.scene) !== null && _this2$state$sceneCon2 !== void 0 && (_this2$state$sceneCon2 = _this2$state$sceneCon2.view) !== null && _this2$state$sceneCon2 !== void 0 && _this2$state$sceneCon2.controls)) {
|
|
778
|
+
return;
|
|
779
|
+
}
|
|
777
780
|
var camera = _this2.instance.view.camera;
|
|
778
781
|
var quality = _this2.state.sceneContext.settings.sceneQuality;
|
|
779
782
|
var isFirstPerson = _this2.state.sceneContext.scene.view.controls.isFirstPerson;
|
|
@@ -803,6 +806,10 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
803
806
|
});
|
|
804
807
|
});
|
|
805
808
|
_defineProperty(_this2, "instanceOnUpdateEnd", function () {
|
|
809
|
+
var _this2$state$sceneCon3;
|
|
810
|
+
if (!((_this2$state$sceneCon3 = _this2.state.sceneContext.scene) !== null && _this2$state$sceneCon3 !== void 0 && (_this2$state$sceneCon3 = _this2$state$sceneCon3.view) !== null && _this2$state$sceneCon3 !== void 0 && _this2$state$sceneCon3.controls)) {
|
|
811
|
+
return;
|
|
812
|
+
}
|
|
806
813
|
Object.entries(_this2.state.sceneContext.sceneObjects).forEach(function (_ref12) {
|
|
807
814
|
var _ref13 = _slicedToArray(_ref12, 2),
|
|
808
815
|
objId = _ref13[0],
|
|
@@ -817,7 +824,11 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
817
824
|
});
|
|
818
825
|
});
|
|
819
826
|
_defineProperty(_this2, "instanceOnBeforeEntityUpdate", function (_ref14) {
|
|
827
|
+
var _this2$state$sceneCon4;
|
|
820
828
|
var entity = _ref14.entity;
|
|
829
|
+
if (!((_this2$state$sceneCon4 = _this2.state.sceneContext.scene) !== null && _this2$state$sceneCon4 !== void 0 && (_this2$state$sceneCon4 = _this2$state$sceneCon4.view) !== null && _this2$state$sceneCon4 !== void 0 && _this2$state$sceneCon4.controls)) {
|
|
830
|
+
return;
|
|
831
|
+
}
|
|
821
832
|
if (entity !== _this2.map) {
|
|
822
833
|
_this2.instance.view.camera.userData.__previousFar = _this2.instance.view.camera.far;
|
|
823
834
|
var quality = _this2.state.sceneContext.settings.sceneQuality;
|
|
@@ -827,7 +838,11 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
827
838
|
}
|
|
828
839
|
});
|
|
829
840
|
_defineProperty(_this2, "instanceOnAfterEntityUpdate", function (_ref15) {
|
|
841
|
+
var _this2$state$sceneCon5;
|
|
830
842
|
var entity = _ref15.entity;
|
|
843
|
+
if (!((_this2$state$sceneCon5 = _this2.state.sceneContext.scene) !== null && _this2$state$sceneCon5 !== void 0 && (_this2$state$sceneCon5 = _this2$state$sceneCon5.view) !== null && _this2$state$sceneCon5 !== void 0 && _this2$state$sceneCon5.camera)) {
|
|
844
|
+
return;
|
|
845
|
+
}
|
|
831
846
|
if (entity !== _this2.map) {
|
|
832
847
|
_this2.instance.view.camera.far = _this2.instance.view.camera.userData.__previousFar;
|
|
833
848
|
delete _this2.instance.view.camera.userData.__previousFar;
|
|
@@ -890,8 +905,12 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
890
905
|
});
|
|
891
906
|
_defineProperty(_this2, "onUnload", function (key) {
|
|
892
907
|
// Ensure scene has not already been disposed
|
|
893
|
-
if (_this2.state.sceneId === key) {
|
|
894
|
-
_this2.
|
|
908
|
+
if (_this2.state.sceneContext.sceneId === key) {
|
|
909
|
+
if (_this2.state.sceneContext.rebuildInstance) {
|
|
910
|
+
_this2.setupInstance();
|
|
911
|
+
} else {
|
|
912
|
+
_this2.disposeInstance();
|
|
913
|
+
}
|
|
895
914
|
}
|
|
896
915
|
});
|
|
897
916
|
_defineProperty(_this2, "setupControls", function (instance) {
|
|
@@ -1061,7 +1080,7 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
1061
1080
|
}).filter(Boolean);
|
|
1062
1081
|
return new Promise(function (resolve) {
|
|
1063
1082
|
Promise.all(promises).then(function (objects) {
|
|
1064
|
-
var _this2$state$
|
|
1083
|
+
var _this2$state$sceneCon6, _this2$state$sceneCon7;
|
|
1065
1084
|
var camera = _this2.state.sceneContext.scene.view.camera.position;
|
|
1066
1085
|
var target = _this2.state.sceneContext.scene.view.controls.target;
|
|
1067
1086
|
var layers = Object.entries(_this2.state.sceneContext.colorLayers).map(function (_ref20) {
|
|
@@ -1080,10 +1099,10 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
1080
1099
|
resolve({
|
|
1081
1100
|
objects: objects,
|
|
1082
1101
|
colorLayers: layers,
|
|
1083
|
-
baseLayer: ((_this2$state$
|
|
1102
|
+
baseLayer: ((_this2$state$sceneCon6 = _this2.state.sceneContext.baseLayers.find(function (layer) {
|
|
1084
1103
|
return layer.visibility === true;
|
|
1085
|
-
})) === null || _this2$state$
|
|
1086
|
-
personHeight: (_this2$state$
|
|
1104
|
+
})) === null || _this2$state$sceneCon6 === void 0 ? void 0 : _this2$state$sceneCon6.name) || "",
|
|
1105
|
+
personHeight: (_this2$state$sceneCon7 = _this2.state.sceneContext.scene.view.controls.personHeight) !== null && _this2$state$sceneCon7 !== void 0 ? _this2$state$sceneCon7 : 0,
|
|
1087
1106
|
camera: [camera.x, camera.y, camera.z],
|
|
1088
1107
|
target: [target.x, target.y, target.z]
|
|
1089
1108
|
});
|
|
@@ -1182,7 +1201,13 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
1182
1201
|
var _this3 = this;
|
|
1183
1202
|
if (this.props.theme !== prevProps.theme) {
|
|
1184
1203
|
if (this.props.theme.map3d) {
|
|
1185
|
-
this.
|
|
1204
|
+
this.setState(function (state) {
|
|
1205
|
+
return {
|
|
1206
|
+
sceneContext: _objectSpread(_objectSpread({}, state.sceneContext), {}, {
|
|
1207
|
+
rebuildInstance: true
|
|
1208
|
+
})
|
|
1209
|
+
};
|
|
1210
|
+
});
|
|
1186
1211
|
}
|
|
1187
1212
|
} else if (this.props.layers !== prevProps.layers) {
|
|
1188
1213
|
this.setState(function (state) {
|
|
@@ -1239,10 +1264,10 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
1239
1264
|
id: "map3d",
|
|
1240
1265
|
key: "Map3D",
|
|
1241
1266
|
ref: this.setupContainer
|
|
1242
|
-
}), this.context), this.state.sceneContext.scene ? /*#__PURE__*/React.createElement(UnloadWrapper, {
|
|
1243
|
-
key: this.state.sceneId,
|
|
1267
|
+
}), this.context), this.state.sceneContext.scene && !this.state.sceneContext.rebuildInstance ? /*#__PURE__*/React.createElement(UnloadWrapper, {
|
|
1268
|
+
key: this.state.sceneContext.sceneId,
|
|
1244
1269
|
onUnload: this.onUnload,
|
|
1245
|
-
sceneId: this.state.sceneId
|
|
1270
|
+
sceneId: this.state.sceneContext.sceneId
|
|
1246
1271
|
}, /*#__PURE__*/React.createElement(MapControls3D, {
|
|
1247
1272
|
controlsPosition: this.props.controlsPosition,
|
|
1248
1273
|
mouseButtons: this.props.mouseButtons,
|
|
@@ -1302,7 +1327,9 @@ _defineProperty(Map3D, "defaultSceneState", {
|
|
|
1302
1327
|
collisionObjects: [],
|
|
1303
1328
|
settings: {
|
|
1304
1329
|
sceneQuality: 100
|
|
1305
|
-
}
|
|
1330
|
+
},
|
|
1331
|
+
sceneId: null,
|
|
1332
|
+
rebuildInstance: false
|
|
1306
1333
|
});
|
|
1307
1334
|
export default connect(function (state) {
|
|
1308
1335
|
return {
|
|
@@ -28,6 +28,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
28
28
|
|
|
29
29
|
import React from 'react';
|
|
30
30
|
import ReactDOM from 'react-dom';
|
|
31
|
+
import CoordinateSystem from '@giro3d/giro3d/core/geographic/coordinate-system/CoordinateSystem';
|
|
31
32
|
import Coordinates from '@giro3d/giro3d/core/geographic/Coordinates';
|
|
32
33
|
import PropTypes from 'prop-types';
|
|
33
34
|
import { Box3 } from 'three';
|
|
@@ -137,7 +138,7 @@ var NumericInput3D = /*#__PURE__*/function (_React$Component) {
|
|
|
137
138
|
});
|
|
138
139
|
_defineProperty(_this, "elevationChanged", function (_ref) {
|
|
139
140
|
var extent = _ref.extent;
|
|
140
|
-
var crs = _this.props.sceneContext.mapCrs;
|
|
141
|
+
var crs = CoordinateSystem.fromSrid(_this.props.sceneContext.mapCrs);
|
|
141
142
|
var coo = new Coordinates(crs, _this.state.pos[0], _this.state.pos[1]);
|
|
142
143
|
if (extent.isPointInside(coo)) {
|
|
143
144
|
var _this$props$sceneCont2;
|
package/package.json
CHANGED