qwc2 2026.2.23 → 2026.2.25
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.
- package/actions/theme.js +2 -1
- package/components/AttributeTableWidget.js +28 -21
- package/components/SearchBox.js +15 -13
- package/components/map/layers/WMSLayer.js +7 -7
- package/components/map3d/Map3D.js +91 -37
- package/components/map3d/layers/VectorLayer3D.js +5 -4
- package/components/map3d/layers/WMSLayer3D.js +17 -8
- package/package.json +1 -1
- package/plugins/API.js +34 -22
- package/plugins/Editing.js +27 -20
- package/plugins/FeatureForm.js +21 -13
- package/plugins/MapLegend.js +4 -1
- package/plugins/TopBar.js +2 -0
- package/plugins/map3d/LayerTree3D.js +112 -74
- package/plugins/map3d/style/LayerTree3D.css +6 -0
- package/reducers/layers.js +0 -1
- package/scripts/gen-plugin-docs.js +17 -5
- package/scripts/themesConfig.js +1 -0
- package/scripts/themesConfig.py +1 -0
- package/utils/EditingUtils.js +4 -4
- package/utils/SearchProviders.js +14 -11
package/actions/theme.js
CHANGED
|
@@ -163,7 +163,7 @@ export function setCurrentTheme(theme, themes) {
|
|
|
163
163
|
var themeLayerRestorer = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
|
|
164
164
|
var externalLayerRestorer = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : null;
|
|
165
165
|
return function (dispatch, getState) {
|
|
166
|
-
var _getState$layers;
|
|
166
|
+
var _getState$layers, _ref, _theme$mapTips;
|
|
167
167
|
var curLayers = ((_getState$layers = getState().layers) === null || _getState$layers === void 0 ? void 0 : _getState$layers.flat) || [];
|
|
168
168
|
var mapCrs = theme.mapCrs || themes.defaultMapCrs || "EPSG:3857";
|
|
169
169
|
if (!(mapCrs in CoordinatesUtils.getAvailableCRS())) {
|
|
@@ -230,6 +230,7 @@ export function setCurrentTheme(theme, themes) {
|
|
|
230
230
|
printGrid: theme.printGrid || themes.defaultPrintGrid || undefined,
|
|
231
231
|
searchProviders: theme.searchProviders || themes.defaultSearchProviders || undefined,
|
|
232
232
|
backgroundLayers: theme.backgroundLayers || themes.defaultBackgroundLayers || [],
|
|
233
|
+
mapTips: (_ref = (_theme$mapTips = theme.mapTips) !== null && _theme$mapTips !== void 0 ? _theme$mapTips : themes.defaultMapTips) !== null && _ref !== void 0 ? _ref : undefined,
|
|
233
234
|
defaultDisplayCrs: theme.defaultDisplayCrs || themes.defaultDisplayCrs || undefined
|
|
234
235
|
});
|
|
235
236
|
|
|
@@ -1098,22 +1098,7 @@ var AttributeTableWidget = /*#__PURE__*/function (_React$Component) {
|
|
|
1098
1098
|
sitekey: ConfigUtils.getConfigProp("editServiceCaptchaSiteKey")
|
|
1099
1099
|
}));
|
|
1100
1100
|
}
|
|
1101
|
-
|
|
1102
|
-
className: "AttributeTable"
|
|
1103
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
1104
|
-
className: "attribtable-toolbar"
|
|
1105
|
-
}, this.props.showLayerSelection ? /*#__PURE__*/React.createElement("select", {
|
|
1106
|
-
disabled: loading || editing,
|
|
1107
|
-
onChange: function onChange(ev) {
|
|
1108
|
-
return _this2.setState({
|
|
1109
|
-
selectedLayer: ev.target.value
|
|
1110
|
-
});
|
|
1111
|
-
},
|
|
1112
|
-
value: this.state.selectedLayer || ""
|
|
1113
|
-
}, /*#__PURE__*/React.createElement("option", {
|
|
1114
|
-
disabled: true,
|
|
1115
|
-
value: ""
|
|
1116
|
-
}, LocaleUtils.tr("common.selectlayer")), Object.entries(this.props.editConfigs).map(function (_ref3) {
|
|
1101
|
+
var editLayers = Object.entries(this.props.editConfigs).map(function (_ref3) {
|
|
1117
1102
|
var _ref4 = _slicedToArray(_ref3, 2),
|
|
1118
1103
|
wmsName = _ref4[0],
|
|
1119
1104
|
serviceConfigs = _ref4[1];
|
|
@@ -1134,12 +1119,34 @@ var AttributeTableWidget = /*#__PURE__*/function (_React$Component) {
|
|
|
1134
1119
|
})) === null || _this2$props$layers$f === void 0 ? void 0 : _this2$props$layers$f.translations;
|
|
1135
1120
|
layerTitle = (_ref9 = (_translations$layertr = translations === null || translations === void 0 || (_translations$layertr2 = translations.layertree) === null || _translations$layertr2 === void 0 ? void 0 : _translations$layertr2[layerName]) !== null && _translations$layertr !== void 0 ? _translations$layertr : editConfig.layerTitle) !== null && _ref9 !== void 0 ? _ref9 : layerName;
|
|
1136
1121
|
}
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
}, layerTitle);
|
|
1122
|
+
return {
|
|
1123
|
+
value: wmsName + "#" + layerName,
|
|
1124
|
+
title: layerTitle
|
|
1125
|
+
};
|
|
1142
1126
|
});
|
|
1127
|
+
}).flat().filter(Boolean).sort(function (a, b) {
|
|
1128
|
+
return a.title.localeCompare(b.title);
|
|
1129
|
+
});
|
|
1130
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1131
|
+
className: "AttributeTable"
|
|
1132
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1133
|
+
className: "attribtable-toolbar"
|
|
1134
|
+
}, this.props.showLayerSelection ? /*#__PURE__*/React.createElement("select", {
|
|
1135
|
+
disabled: loading || editing,
|
|
1136
|
+
onChange: function onChange(ev) {
|
|
1137
|
+
return _this2.setState({
|
|
1138
|
+
selectedLayer: ev.target.value
|
|
1139
|
+
});
|
|
1140
|
+
},
|
|
1141
|
+
value: this.state.selectedLayer || ""
|
|
1142
|
+
}, /*#__PURE__*/React.createElement("option", {
|
|
1143
|
+
disabled: true,
|
|
1144
|
+
value: ""
|
|
1145
|
+
}, LocaleUtils.tr("common.selectlayer")), editLayers.map(function (entry) {
|
|
1146
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
1147
|
+
key: entry.value,
|
|
1148
|
+
value: entry.value
|
|
1149
|
+
}, entry.title);
|
|
1143
1150
|
})) : null, /*#__PURE__*/React.createElement("button", {
|
|
1144
1151
|
className: "button",
|
|
1145
1152
|
disabled: !this.state.selectedLayer || editing || loading,
|
package/components/SearchBox.js
CHANGED
|
@@ -866,7 +866,7 @@ var SearchBox = /*#__PURE__*/function (_React$Component) {
|
|
|
866
866
|
});
|
|
867
867
|
});
|
|
868
868
|
_defineProperty(_this, "startSearch", function () {
|
|
869
|
-
var _this$state$filterGeo2;
|
|
869
|
+
var _ref5, _this$state$filterGeo2;
|
|
870
870
|
var provider = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
871
871
|
var uniquePlaceResult = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
872
872
|
var availableProviders = _this.props.searchProviders;
|
|
@@ -893,15 +893,16 @@ var SearchBox = /*#__PURE__*/function (_React$Component) {
|
|
|
893
893
|
var searchParams = {
|
|
894
894
|
mapcrs: _this.props.map.projection,
|
|
895
895
|
displaycrs: _this.props.map.displayCrs,
|
|
896
|
+
extracrs: (_ref5 = _this.props.searchOptions.extraCoordinateSearchCrs === "mousecrs" ? _this.props.theme.additionalMouseCrs : _this.props.searchOptions.extraCoordinateSearchCrs) !== null && _ref5 !== void 0 ? _ref5 : [],
|
|
896
897
|
lang: LocaleUtils.lang(),
|
|
897
898
|
limit: _this.props.searchOptions.resultLimit,
|
|
898
899
|
filterPoly: (_this$state$filterGeo2 = _this.state.filterGeometry) === null || _this$state$filterGeo2 === void 0 || (_this$state$filterGeo2 = _this$state$filterGeo2.coordinates) === null || _this$state$filterGeo2 === void 0 ? void 0 : _this$state$filterGeo2[0],
|
|
899
900
|
filterBBox: _this.state.filterGeometry ? VectorLayerUtils.computeFeatureBBox(_this.state.filterGeometry) : null
|
|
900
901
|
};
|
|
901
|
-
Object.entries(availableProviders).forEach(function (
|
|
902
|
-
var
|
|
903
|
-
provKey =
|
|
904
|
-
prov =
|
|
902
|
+
Object.entries(availableProviders).forEach(function (_ref6) {
|
|
903
|
+
var _ref7 = _slicedToArray(_ref6, 2),
|
|
904
|
+
provKey = _ref7[0],
|
|
905
|
+
prov = _ref7[1];
|
|
905
906
|
prov.onSearch(searchText, _objectSpread(_objectSpread({
|
|
906
907
|
cfgParams: prov.cfgParams
|
|
907
908
|
}, prov.params), searchParams), function (response) {
|
|
@@ -930,10 +931,10 @@ var SearchBox = /*#__PURE__*/function (_React$Component) {
|
|
|
930
931
|
return entry !== provKey;
|
|
931
932
|
});
|
|
932
933
|
if (isEmpty(newPendingSearches) && uniquePlaceResult) {
|
|
933
|
-
var providersWithResults = Object.entries(searchResults).filter(function (
|
|
934
|
-
var
|
|
935
|
-
_ =
|
|
936
|
-
providerResults =
|
|
934
|
+
var providersWithResults = Object.entries(searchResults).filter(function (_ref8) {
|
|
935
|
+
var _ref9 = _slicedToArray(_ref8, 2),
|
|
936
|
+
_ = _ref9[0],
|
|
937
|
+
providerResults = _ref9[1];
|
|
937
938
|
return providerResults.tot_result_count > 0;
|
|
938
939
|
});
|
|
939
940
|
if (providersWithResults.length === 1 && providersWithResults[0][1].tot_result_count === 1) {
|
|
@@ -1076,8 +1077,8 @@ var SearchBox = /*#__PURE__*/function (_React$Component) {
|
|
|
1076
1077
|
}
|
|
1077
1078
|
// Label first feature
|
|
1078
1079
|
if (!_this.props.searchOptions.hideResultLabels) {
|
|
1079
|
-
var
|
|
1080
|
-
var label = ((
|
|
1080
|
+
var _ref0, _item$label;
|
|
1081
|
+
var label = ((_ref0 = (_item$label = item.label) !== null && _item$label !== void 0 ? _item$label : item.text) !== null && _ref0 !== void 0 ? _ref0 : '').replace(/<\/?\w+\s*\/?>/g, '');
|
|
1081
1082
|
features[0].properties = _objectSpread(_objectSpread({}, features[0].properties), {}, {
|
|
1082
1083
|
label: label
|
|
1083
1084
|
});
|
|
@@ -1097,8 +1098,8 @@ var SearchBox = /*#__PURE__*/function (_React$Component) {
|
|
|
1097
1098
|
styleName: 'marker'
|
|
1098
1099
|
};
|
|
1099
1100
|
if (!_this.props.searchOptions.hideResultLabels) {
|
|
1100
|
-
var
|
|
1101
|
-
var _label = ((
|
|
1101
|
+
var _ref1, _item$label2;
|
|
1102
|
+
var _label = ((_ref1 = (_item$label2 = item.label) !== null && _item$label2 !== void 0 ? _item$label2 : item.text) !== null && _ref1 !== void 0 ? _ref1 : '').replace(/<\/?\w+\s*\/?>/g, '');
|
|
1102
1103
|
marker.properties = {
|
|
1103
1104
|
label: _label
|
|
1104
1105
|
};
|
|
@@ -1266,6 +1267,7 @@ _defineProperty(SearchBox, "propTypes", {
|
|
|
1266
1267
|
searchOptions: PropTypes.shape({
|
|
1267
1268
|
allowAddLayerAsGroup: PropTypes.bool,
|
|
1268
1269
|
allowSearchFilters: PropTypes.bool,
|
|
1270
|
+
extraCoordinateSearchCrs: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
|
|
1269
1271
|
focusOnStartup: PropTypes.bool,
|
|
1270
1272
|
hideResultLabels: PropTypes.bool,
|
|
1271
1273
|
highlightStyle: PropTypes.object,
|
|
@@ -138,8 +138,8 @@ export default {
|
|
|
138
138
|
}, options.sourceConfig || {}))
|
|
139
139
|
}, options.layerConfig || {}));
|
|
140
140
|
}
|
|
141
|
-
layer.setVisible(queryParameters.LAYERS && options.visibility);
|
|
142
|
-
layer.setOpacity(clientSideOpacity !== null && clientSideOpacity !== void 0 ? clientSideOpacity :
|
|
141
|
+
layer.setVisible(queryParameters.LAYERS !== "" && options.visibility);
|
|
142
|
+
layer.setOpacity(clientSideOpacity !== null && clientSideOpacity !== void 0 ? clientSideOpacity : 1);
|
|
143
143
|
return layer;
|
|
144
144
|
},
|
|
145
145
|
update: function update(layer, newOptions, oldOptions) {
|
|
@@ -147,7 +147,7 @@ export default {
|
|
|
147
147
|
if (oldOptions && layer !== null && layer !== void 0 && (_layer$getSource = layer.getSource()) !== null && _layer$getSource !== void 0 && _layer$getSource.updateParams) {
|
|
148
148
|
var changed = (oldOptions.rev || 0) !== (newOptions.rev || 0);
|
|
149
149
|
var oldParams = wmsToOpenlayersOptions(oldOptions);
|
|
150
|
-
getClientSideOpacity(oldOptions, oldParams);
|
|
150
|
+
getClientSideOpacity(oldOptions, oldParams); // Make getClientSideOpacity transform oldParams if necessary
|
|
151
151
|
var newParams = wmsToOpenlayersOptions(newOptions);
|
|
152
152
|
var clientSideOpacity = getClientSideOpacity(newOptions, newParams);
|
|
153
153
|
Object.keys(oldParams).forEach(function (key) {
|
|
@@ -168,18 +168,18 @@ export default {
|
|
|
168
168
|
if (layer.get("updateTimeout")) {
|
|
169
169
|
clearTimeout(layer.get("updateTimeout"));
|
|
170
170
|
}
|
|
171
|
-
if (!newOptions.visibility ||
|
|
171
|
+
if (!newOptions.visibility || queryParameters.LAYERS === "") {
|
|
172
172
|
layer.setVisible(false);
|
|
173
173
|
}
|
|
174
|
-
layer.setOpacity(clientSideOpacity !== null && clientSideOpacity !== void 0 ? clientSideOpacity :
|
|
174
|
+
layer.setOpacity(clientSideOpacity !== null && clientSideOpacity !== void 0 ? clientSideOpacity : 1);
|
|
175
175
|
layer.set("updateTimeout", setTimeout(function () {
|
|
176
|
-
layer.setVisible(queryParameters.LAYERS && newOptions.visibility);
|
|
176
|
+
layer.setVisible(queryParameters.LAYERS !== "" && newOptions.visibility);
|
|
177
177
|
layer.getSource().updateParams(queryParameters);
|
|
178
178
|
layer.getSource().changed();
|
|
179
179
|
layer.set("updateTimeout", null);
|
|
180
180
|
}, 500));
|
|
181
181
|
} else {
|
|
182
|
-
layer.setOpacity(clientSideOpacity !== null && clientSideOpacity !== void 0 ? clientSideOpacity :
|
|
182
|
+
layer.setOpacity(clientSideOpacity !== null && clientSideOpacity !== void 0 ? clientSideOpacity : 1);
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
}
|
|
@@ -115,7 +115,7 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
115
115
|
addLayer: function addLayer(layer) {},
|
|
116
116
|
getLayer: function getLayer(layerId) {},
|
|
117
117
|
removeLayer: function removeLayer(layerId) {},
|
|
118
|
-
updateColorLayer: function updateColorLayer(layerId, options,
|
|
118
|
+
updateColorLayer: function updateColorLayer(layerId, options, flags) {},
|
|
119
119
|
setBaseLayer: function setBaseLayer(layer, visibility) {},
|
|
120
120
|
importTiles3D: function importTiles3D(url, name) {
|
|
121
121
|
var addToLayerTree = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
@@ -136,7 +136,7 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
136
136
|
},
|
|
137
137
|
getSceneObject: function getSceneObject(objectId) {},
|
|
138
138
|
removeSceneObject: function removeSceneObject(objectId) {},
|
|
139
|
-
updateSceneObject: function updateSceneObject(objectId, options) {},
|
|
139
|
+
updateSceneObject: function updateSceneObject(objectId, options, flags) {},
|
|
140
140
|
zoomToObject: function zoomToObject(objectId) {},
|
|
141
141
|
getMap: function getMap() {},
|
|
142
142
|
setViewToExtent: function setViewToExtent(bounds, angle) {},
|
|
@@ -199,7 +199,7 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
199
199
|
return _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, layer.id, layer));
|
|
200
200
|
}, {});
|
|
201
201
|
return _this2.props.layers.reduce(function (colorLayers, layer) {
|
|
202
|
-
var _prevOptions$visibili, _prevOptions$opacity, _prevOptions$extrusio, _prevOptions$fields;
|
|
202
|
+
var _prevOptions$projecti, _prevOptions$visibili, _prevOptions$opacity, _prevOptions$extrusio, _prevOptions$fields;
|
|
203
203
|
if (layer.role !== LayerRole.THEME && layer.role !== LayerRole.USERLAYER) {
|
|
204
204
|
return colorLayers;
|
|
205
205
|
}
|
|
@@ -231,6 +231,7 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
231
231
|
});
|
|
232
232
|
};
|
|
233
233
|
colorLayers[layer.id] = _objectSpread(_objectSpread({}, layer), {}, {
|
|
234
|
+
projection: (_prevOptions$projecti = prevOptions === null || prevOptions === void 0 ? void 0 : prevOptions.projection) !== null && _prevOptions$projecti !== void 0 ? _prevOptions$projecti : _this2.props.theme.mapCrs,
|
|
234
235
|
visibility: (_prevOptions$visibili = prevOptions === null || prevOptions === void 0 ? void 0 : prevOptions.visibility) !== null && _prevOptions$visibili !== void 0 ? _prevOptions$visibili : false,
|
|
235
236
|
opacity: (_prevOptions$opacity = prevOptions === null || prevOptions === void 0 ? void 0 : prevOptions.opacity) !== null && _prevOptions$opacity !== void 0 ? _prevOptions$opacity : 255,
|
|
236
237
|
extrusionHeight: (_prevOptions$extrusio = prevOptions === null || prevOptions === void 0 ? void 0 : prevOptions.extrusionHeight) !== null && _prevOptions$extrusio !== void 0 ? _prevOptions$extrusio : layerCreator.createFeatureSource ? 0 : undefined,
|
|
@@ -262,14 +263,17 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
262
263
|
var layerCreator = LayerRegistry[options.type];
|
|
263
264
|
var mapLayer = _this2.getLayer(layerId);
|
|
264
265
|
if (mapLayer) {
|
|
265
|
-
layerCreator.update3d(mapLayer
|
|
266
|
+
layerCreator.update3d(mapLayer, options, prevOptions, _this2.state.sceneContext.mapCrs);
|
|
266
267
|
} else {
|
|
267
268
|
mapLayer = layerCreator.create3d(options, _this2.state.sceneContext.mapCrs);
|
|
268
269
|
_this2.addLayer(layerId, mapLayer);
|
|
269
270
|
}
|
|
270
271
|
_this2.map.insertLayerAfter(mapLayer, layerBelow);
|
|
271
|
-
|
|
272
|
-
|
|
272
|
+
// WMS layer handles visibility and opacity internally
|
|
273
|
+
if (options.type !== "wms") {
|
|
274
|
+
mapLayer.visible = options.visibility;
|
|
275
|
+
mapLayer.opacity = options.opacity / 255;
|
|
276
|
+
}
|
|
273
277
|
layerBelow = mapLayer;
|
|
274
278
|
if (options.extrusionHeight !== undefined && options.extrusionHeight !== 0) {
|
|
275
279
|
_this2.createUpdateExtrudedLayer(layerCreator, mapLayer, options, options.features !== (prevOptions === null || prevOptions === void 0 ? void 0 : prevOptions.features));
|
|
@@ -381,16 +385,45 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
381
385
|
});
|
|
382
386
|
});
|
|
383
387
|
_defineProperty(_this2, "updateColorLayer", function (layerId, options) {
|
|
384
|
-
var
|
|
388
|
+
var flags = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
385
389
|
_this2.setState(function (state) {
|
|
390
|
+
var _flags$path;
|
|
386
391
|
var entry = _objectSpread({}, state.sceneContext.colorLayers[layerId]);
|
|
387
392
|
var subentry = entry;
|
|
388
|
-
|
|
393
|
+
var parent = null;
|
|
394
|
+
((_flags$path = flags.path) !== null && _flags$path !== void 0 ? _flags$path : []).forEach(function (idx) {
|
|
389
395
|
subentry.sublayers = _toConsumableArray(subentry.sublayers);
|
|
390
396
|
subentry.sublayers[idx] = _objectSpread({}, subentry.sublayers[idx]);
|
|
397
|
+
parent = subentry;
|
|
391
398
|
subentry = subentry.sublayers[idx];
|
|
392
399
|
});
|
|
400
|
+
var prevOptions = _objectSpread({}, subentry);
|
|
393
401
|
Object.assign(subentry, options);
|
|
402
|
+
if (subentry.visibility !== prevOptions.visibility) {
|
|
403
|
+
var _parent;
|
|
404
|
+
if (!isEmpty(subentry.sublayers) && flags.groupTogglesSublayers) {
|
|
405
|
+
// Propagate visibility to children
|
|
406
|
+
var _setChildVisibilities = function setChildVisibilities(child) {
|
|
407
|
+
child.sublayers = child.sublayers.map(function (gchild) {
|
|
408
|
+
var ngchild = _objectSpread(_objectSpread({}, gchild), {}, {
|
|
409
|
+
visibility: options.visibility
|
|
410
|
+
});
|
|
411
|
+
if (!isEmpty(ngchild.sublayers)) {
|
|
412
|
+
_setChildVisibilities(ngchild);
|
|
413
|
+
}
|
|
414
|
+
return ngchild;
|
|
415
|
+
});
|
|
416
|
+
};
|
|
417
|
+
_setChildVisibilities(subentry);
|
|
418
|
+
}
|
|
419
|
+
if ((_parent = parent) !== null && _parent !== void 0 && _parent.mutuallyExclusive) {
|
|
420
|
+
parent.sublayers = parent.sublayers.map(function (sublayer) {
|
|
421
|
+
return sublayer === subentry ? subentry : _objectSpread(_objectSpread({}, sublayer), {}, {
|
|
422
|
+
visibility: false
|
|
423
|
+
});
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
}
|
|
394
427
|
Object.assign(entry, LayerUtils.buildWMSLayerParams(entry));
|
|
395
428
|
return {
|
|
396
429
|
sceneContext: _objectSpread(_objectSpread({}, state.sceneContext), {}, {
|
|
@@ -593,18 +626,19 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
593
626
|
}
|
|
594
627
|
});
|
|
595
628
|
_defineProperty(_this2, "updateSceneObject", function (objectId, options) {
|
|
629
|
+
var flags = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
596
630
|
_this2.setState(function (state) {
|
|
597
|
-
var objectTree = state.sceneContext.objectTree;
|
|
631
|
+
var objectTree = _objectSpread({}, state.sceneContext.objectTree);
|
|
598
632
|
var prevOptions = objectTree[objectId] || {};
|
|
599
633
|
options = _objectSpread(_objectSpread({}, prevOptions), options);
|
|
600
634
|
if (options.objectId) {
|
|
601
635
|
_this2.applySceneObjectState(objectId, options, prevOptions, objectTree);
|
|
602
|
-
} else if (options.children) {
|
|
603
|
-
_this2.setChildObjectVisibility(objectTree, options.children, options.visibility);
|
|
636
|
+
} else if (options.children && options.visibility !== prevOptions.visibility) {
|
|
637
|
+
_this2.setChildObjectVisibility(objectTree, options.children, options.visibility, flags.groupTogglesSublayers);
|
|
604
638
|
}
|
|
605
639
|
return {
|
|
606
640
|
sceneContext: _objectSpread(_objectSpread({}, state.sceneContext), {}, {
|
|
607
|
-
objectTree: _objectSpread(_objectSpread({},
|
|
641
|
+
objectTree: _objectSpread(_objectSpread({}, objectTree), {}, _defineProperty({}, objectId, options))
|
|
608
642
|
})
|
|
609
643
|
};
|
|
610
644
|
});
|
|
@@ -613,6 +647,7 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
613
647
|
var object = _this2.objectMap[objectId];
|
|
614
648
|
var changed = false;
|
|
615
649
|
if (options.visibility !== prevOptions.visibility || options.opacity !== (prevOptions === null || prevOptions === void 0 ? void 0 : prevOptions.opacity)) {
|
|
650
|
+
var _objectTree$options$p;
|
|
616
651
|
// Visibile if object is visibile and parents also
|
|
617
652
|
var isVisible = options.opacity > 0 && options.visibility;
|
|
618
653
|
for (var curId = options.parent; isVisible && curId !== undefined; curId = objectTree[curId].parent) {
|
|
@@ -620,6 +655,15 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
620
655
|
}
|
|
621
656
|
changed |= object.visible !== isVisible;
|
|
622
657
|
object.visible = isVisible;
|
|
658
|
+
if ((_objectTree$options$p = objectTree[options.parent]) !== null && _objectTree$options$p !== void 0 && _objectTree$options$p.mutuallyExclusive && objectTree[options.parent].children) {
|
|
659
|
+
objectTree[options.parent].children.forEach(function (child) {
|
|
660
|
+
if (child !== objectId) {
|
|
661
|
+
objectTree[child] = _objectSpread(_objectSpread({}, objectTree[child]), {}, {
|
|
662
|
+
visibility: false
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
});
|
|
666
|
+
}
|
|
623
667
|
}
|
|
624
668
|
if (options.opacity !== (prevOptions === null || prevOptions === void 0 ? void 0 : prevOptions.opacity)) {
|
|
625
669
|
if (object.opacity !== undefined) {
|
|
@@ -643,6 +687,26 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
643
687
|
_this2.loadTilesetStyle(objectId, (_options$styles = options.styles) === null || _options$styles === void 0 ? void 0 : _options$styles[options.style]);
|
|
644
688
|
}
|
|
645
689
|
});
|
|
690
|
+
_defineProperty(_this2, "setChildObjectVisibility", function (objectTree, children, visibility, groupTogglesSublayers) {
|
|
691
|
+
children.forEach(function (nodeId) {
|
|
692
|
+
if (objectTree[nodeId].children) {
|
|
693
|
+
_this2.setChildObjectVisibility(objectTree, objectTree[nodeId].children, visibility && objectTree[nodeId].visibility);
|
|
694
|
+
} else {
|
|
695
|
+
if (groupTogglesSublayers) {
|
|
696
|
+
objectTree[nodeId] = _objectSpread(_objectSpread({}, objectTree[nodeId]), {}, {
|
|
697
|
+
visibility: visibility
|
|
698
|
+
});
|
|
699
|
+
}
|
|
700
|
+
var child = objectTree[nodeId];
|
|
701
|
+
var newVisible = visibility && child.visibility && child.opacity > 0;
|
|
702
|
+
var changed = newVisible !== _this2.objectMap[child.objectId].visible;
|
|
703
|
+
_this2.objectMap[child.objectId].visible = newVisible;
|
|
704
|
+
if (changed) {
|
|
705
|
+
_this2.instance.notifyChange(_this2.objectMap[child.objectId]);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
});
|
|
709
|
+
});
|
|
646
710
|
_defineProperty(_this2, "loadTilesetStyle", function (objectId, url) {
|
|
647
711
|
var applyTilesetStyle = function applyTilesetStyle(styleurl) {
|
|
648
712
|
var tiles3d = _this2.objectMap[objectId];
|
|
@@ -668,21 +732,6 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
668
732
|
applyTilesetStyle(url);
|
|
669
733
|
}
|
|
670
734
|
});
|
|
671
|
-
_defineProperty(_this2, "setChildObjectVisibility", function (objectTree, children, visibility) {
|
|
672
|
-
children.forEach(function (nodeId) {
|
|
673
|
-
if (objectTree[nodeId].children) {
|
|
674
|
-
_this2.setChildObjectVisibility(objectTree, objectTree[nodeId].children, visibility && objectTree[nodeId].visibility);
|
|
675
|
-
} else {
|
|
676
|
-
var child = objectTree[nodeId];
|
|
677
|
-
var newVisible = visibility && child.visibility && child.opacity > 0;
|
|
678
|
-
var changed = newVisible !== _this2.objectMap[child.objectId].visible;
|
|
679
|
-
_this2.objectMap[child.objectId].visible = newVisible;
|
|
680
|
-
if (changed) {
|
|
681
|
-
_this2.instance.notifyChange(_this2.objectMap[child.objectId]);
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
});
|
|
685
|
-
});
|
|
686
735
|
_defineProperty(_this2, "zoomToObject", function (objectId) {
|
|
687
736
|
var margin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 20;
|
|
688
737
|
var obj = _this2.state.sceneContext.getSceneObject(objectId);
|
|
@@ -704,12 +753,14 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
704
753
|
if (el) {
|
|
705
754
|
_this2.container = el;
|
|
706
755
|
el.resizeObserver = new ResizeObserver(function (entries) {
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
756
|
+
if (_this2.state.sceneContext.scene) {
|
|
757
|
+
var rect = entries[0].contentRect;
|
|
758
|
+
_this2.state.sceneContext.scene.view.dispatchEvent({
|
|
759
|
+
type: 'view-resized',
|
|
760
|
+
width: rect.width,
|
|
761
|
+
height: rect.height
|
|
762
|
+
});
|
|
763
|
+
}
|
|
713
764
|
});
|
|
714
765
|
el.resizeObserver.observe(el);
|
|
715
766
|
_this2.setupInstance();
|
|
@@ -841,12 +892,14 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
841
892
|
var nodeIds = [];
|
|
842
893
|
entries.forEach(function (entry) {
|
|
843
894
|
if (entry.type === "group") {
|
|
844
|
-
var _entry$visibility;
|
|
895
|
+
var _entry$visibility, _entry$mutuallyExclus, _entry$expanded;
|
|
845
896
|
var groupId = uuidv4();
|
|
846
897
|
objectTree[groupId] = {
|
|
847
898
|
parent: parentId,
|
|
848
899
|
title: entry.title,
|
|
849
|
-
visibility: (_entry$visibility = entry.visibility) !== null && _entry$visibility !== void 0 ? _entry$visibility : true
|
|
900
|
+
visibility: (_entry$visibility = entry.visibility) !== null && _entry$visibility !== void 0 ? _entry$visibility : true,
|
|
901
|
+
mutuallyExclusive: (_entry$mutuallyExclus = entry.mutuallyExclusive) !== null && _entry$mutuallyExclus !== void 0 ? _entry$mutuallyExclus : false,
|
|
902
|
+
expanded: (_entry$expanded = entry.expanded) !== null && _entry$expanded !== void 0 ? _entry$expanded : true
|
|
850
903
|
};
|
|
851
904
|
// Need this separately to ensure object[groupId] is already assigned
|
|
852
905
|
objectTree[groupId].children = _buildObjectTree(entry.items, groupId);
|
|
@@ -1198,7 +1251,8 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
1198
1251
|
options: {
|
|
1199
1252
|
visibility: options.visibility,
|
|
1200
1253
|
opacity: options.opacity,
|
|
1201
|
-
extrusionHeight: options.extrusionHeight
|
|
1254
|
+
extrusionHeight: options.extrusionHeight,
|
|
1255
|
+
expanded: options.expanded
|
|
1202
1256
|
}
|
|
1203
1257
|
};
|
|
1204
1258
|
});
|
|
@@ -1307,7 +1361,7 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
1307
1361
|
};
|
|
1308
1362
|
});
|
|
1309
1363
|
}
|
|
1310
|
-
} else if (this.props.layers !== prevProps.layers) {
|
|
1364
|
+
} else if (this.props.layers !== prevProps.layers && this.instance) {
|
|
1311
1365
|
this.setState(function (state) {
|
|
1312
1366
|
return {
|
|
1313
1367
|
sceneContext: _objectSpread(_objectSpread({}, state.sceneContext), {}, {
|
|
@@ -36,15 +36,16 @@ export default {
|
|
|
36
36
|
});
|
|
37
37
|
},
|
|
38
38
|
update3d: function update3d(layer, newOptions, oldOptions, projection) {
|
|
39
|
+
var source = layer.source.source;
|
|
39
40
|
if (newOptions.styleName !== oldOptions.styleName || newOptions.styleOptions !== oldOptions.styleOptions) {
|
|
40
|
-
|
|
41
|
+
source.setStyle(featureStyleFunction(newOptions));
|
|
41
42
|
} else if (newOptions.styleFunction !== oldOptions.styleFunction) {
|
|
42
|
-
|
|
43
|
+
source.setStyle(newOptions.styleFunction);
|
|
43
44
|
}
|
|
44
45
|
if (newOptions.features !== oldOptions.features) {
|
|
45
|
-
updateFeatures(
|
|
46
|
+
updateFeatures(source, newOptions, oldOptions, projection, true);
|
|
46
47
|
} else if ((oldOptions.rev || 0) !== (newOptions.rev || 0)) {
|
|
47
|
-
|
|
48
|
+
source.update();
|
|
48
49
|
}
|
|
49
50
|
},
|
|
50
51
|
getFields: function getFields(options) {
|
|
@@ -15,14 +15,16 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
15
15
|
import ColorLayer from '@giro3d/giro3d/core/layer/ColorLayer';
|
|
16
16
|
import TiledImageSource from '@giro3d/giro3d/sources/TiledImageSource.js';
|
|
17
17
|
import ol from 'openlayers';
|
|
18
|
-
import { wmsImageLoadFunction, wmsToOpenlayersOptions } from '../../map/layers/WMSLayer';
|
|
18
|
+
import { wmsImageLoadFunction, wmsToOpenlayersOptions, getClientSideOpacity } from '../../map/layers/WMSLayer';
|
|
19
19
|
export default {
|
|
20
20
|
create3d: function create3d(options, projection) {
|
|
21
21
|
var queryParameters = _objectSpread(_objectSpread({}, wmsToOpenlayersOptions(options)), {}, {
|
|
22
22
|
__t: +new Date()
|
|
23
23
|
});
|
|
24
|
-
|
|
24
|
+
var clientSideOpacity = getClientSideOpacity(options, queryParameters);
|
|
25
|
+
var layer = new ColorLayer({
|
|
25
26
|
name: options.name,
|
|
27
|
+
opacity: clientSideOpacity !== null && clientSideOpacity !== void 0 ? clientSideOpacity : 1,
|
|
26
28
|
source: new TiledImageSource({
|
|
27
29
|
source: new ol.source.TileWMS({
|
|
28
30
|
url: options.url.split("?")[0],
|
|
@@ -35,13 +37,17 @@ export default {
|
|
|
35
37
|
})
|
|
36
38
|
})
|
|
37
39
|
});
|
|
40
|
+
layer.visible = queryParameters.LAYERS !== "" && options.visibility;
|
|
41
|
+
return layer;
|
|
38
42
|
},
|
|
39
43
|
update3d: function update3d(layer, newOptions, oldOptions, projection) {
|
|
40
|
-
var
|
|
41
|
-
if (oldOptions &&
|
|
44
|
+
var source = layer.source.source;
|
|
45
|
+
if (oldOptions && source.updateParams) {
|
|
42
46
|
var changed = (oldOptions.rev || 0) !== (newOptions.rev || 0);
|
|
43
47
|
var oldParams = wmsToOpenlayersOptions(oldOptions);
|
|
48
|
+
getClientSideOpacity(oldOptions, oldParams); // Make getClientSideOpacity transform oldParams if necessary
|
|
44
49
|
var newParams = wmsToOpenlayersOptions(newOptions);
|
|
50
|
+
var clientSideOpacity = getClientSideOpacity(newOptions, newParams);
|
|
45
51
|
Object.keys(oldParams).forEach(function (key) {
|
|
46
52
|
if (!(key in newParams)) {
|
|
47
53
|
newParams[key] = undefined;
|
|
@@ -60,15 +66,18 @@ export default {
|
|
|
60
66
|
if (layer.__updateTimeout) {
|
|
61
67
|
clearTimeout(layer.__updateTimeout);
|
|
62
68
|
}
|
|
63
|
-
if (!newOptions.visibility ||
|
|
69
|
+
if (!newOptions.visibility || queryParameters.LAYERS === "") {
|
|
64
70
|
layer.visible = false;
|
|
65
71
|
}
|
|
72
|
+
layer.opacity = clientSideOpacity !== null && clientSideOpacity !== void 0 ? clientSideOpacity : 1;
|
|
66
73
|
layer.__updateTimeout = setTimeout(function () {
|
|
67
|
-
layer.visible = queryParameters.LAYERS && newOptions.visibility;
|
|
68
|
-
|
|
69
|
-
layer.update();
|
|
74
|
+
layer.visible = queryParameters.LAYERS !== "" && newOptions.visibility;
|
|
75
|
+
source.updateParams(queryParameters);
|
|
76
|
+
layer.source.update();
|
|
70
77
|
layer.__updateTimeout = null;
|
|
71
78
|
}, 500);
|
|
79
|
+
} else {
|
|
80
|
+
layer.opacity = clientSideOpacity !== null && clientSideOpacity !== void 0 ? clientSideOpacity : 1;
|
|
72
81
|
}
|
|
73
82
|
}
|
|
74
83
|
}
|
package/package.json
CHANGED
package/plugins/API.js
CHANGED
|
@@ -154,6 +154,16 @@ var actionFunctions = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_o
|
|
|
154
154
|
* "params": [[2684764, 1247841], 18, "EPSG:2056"]
|
|
155
155
|
* }, "http://<qwc_hostname>:<port>")
|
|
156
156
|
* ```
|
|
157
|
+
* You can also post multiple calls at once as follows:
|
|
158
|
+
* ```
|
|
159
|
+
* * qwcframe.contentWindow.postMessage([{
|
|
160
|
+
* "method": "zoomToPoint",
|
|
161
|
+
* "params": [[2684764, 1247841], 18, "EPSG:2056"]
|
|
162
|
+
* }, {
|
|
163
|
+
* "method": "addMarker",
|
|
164
|
+
* "params": ["mymarker", [2684764, 1247841], "Hello world", "EPSG:2056"]
|
|
165
|
+
* }], "http://<qwc_hostname>:<port>")
|
|
166
|
+
* ```
|
|
157
167
|
* If you call a method which returns a value, pass a `requestId` and listen to response messages:
|
|
158
168
|
*
|
|
159
169
|
* ```
|
|
@@ -267,7 +277,6 @@ var API = /*#__PURE__*/function (_React$Component) {
|
|
|
267
277
|
}
|
|
268
278
|
_this = _callSuper(this, API, [].concat(_args));
|
|
269
279
|
_defineProperty(_this, "handleMessage", function (ev) {
|
|
270
|
-
var _ev$data;
|
|
271
280
|
if (!_this.props.allowedMessageOrigins.includes(ev.origin)) {
|
|
272
281
|
/* eslint-disable-next-line */
|
|
273
282
|
console.warn("Discarding message from not-allowed origin " + ev.origin);
|
|
@@ -289,28 +298,31 @@ var API = /*#__PURE__*/function (_React$Component) {
|
|
|
289
298
|
/* eslint-disable-next-line */
|
|
290
299
|
console.log(signatures);
|
|
291
300
|
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
var
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
301
|
+
var messages = Array.isArray(ev.data) ? ev.data : [ev.data];
|
|
302
|
+
messages.forEach(function (message) {
|
|
303
|
+
if (message !== null && message !== void 0 && message.method) {
|
|
304
|
+
var _message$params;
|
|
305
|
+
var func = message.method;
|
|
306
|
+
var args = (_message$params = message.params) !== null && _message$params !== void 0 ? _message$params : [];
|
|
307
|
+
var result = null;
|
|
308
|
+
if (func in actionFunctions) {
|
|
309
|
+
var _this$props;
|
|
310
|
+
result = (_this$props = _this.props)[func].apply(_this$props, _toConsumableArray(args));
|
|
311
|
+
} else if (allowedMemberFunctions.includes(func)) {
|
|
312
|
+
var _this2;
|
|
313
|
+
result = (_this2 = _this)[func].apply(_this2, _toConsumableArray(args));
|
|
314
|
+
} else {
|
|
315
|
+
/* eslint-disable-next-line */
|
|
316
|
+
console.warn("Unhandeled message: " + JSON.stringify(message));
|
|
317
|
+
}
|
|
318
|
+
if (message.requestId) {
|
|
319
|
+
ev.source.postMessage({
|
|
320
|
+
requestId: ev.data.requestId,
|
|
321
|
+
result: result
|
|
322
|
+
}, ev.origin);
|
|
323
|
+
}
|
|
312
324
|
}
|
|
313
|
-
}
|
|
325
|
+
});
|
|
314
326
|
});
|
|
315
327
|
/**
|
|
316
328
|
* Add custom plugin
|
package/plugins/Editing.js
CHANGED
|
@@ -245,21 +245,7 @@ var Editing = /*#__PURE__*/function (_React$Component) {
|
|
|
245
245
|
translations: translations
|
|
246
246
|
});
|
|
247
247
|
}
|
|
248
|
-
|
|
249
|
-
className: "editing-body"
|
|
250
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
251
|
-
className: "editing-layer-selection"
|
|
252
|
-
}, /*#__PURE__*/React.createElement("select", {
|
|
253
|
-
className: "combo editing-layer-select",
|
|
254
|
-
disabled: _this.props.editContext.changed === true || _this.props.editContext.id !== _this.props.currentEditContext,
|
|
255
|
-
onChange: function onChange(ev) {
|
|
256
|
-
return _this.changeSelectedLayer(ev.target.value);
|
|
257
|
-
},
|
|
258
|
-
value: _this.state.selectedLayer || ""
|
|
259
|
-
}, /*#__PURE__*/React.createElement("option", {
|
|
260
|
-
disabled: true,
|
|
261
|
-
value: ""
|
|
262
|
-
}, LocaleUtils.tr("common.selectlayer")), Object.entries(_this.props.editConfigs).map(function (_ref) {
|
|
248
|
+
var editLayers = Object.entries(_this.props.editConfigs).map(function (_ref) {
|
|
263
249
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
264
250
|
mapName = _ref2[0],
|
|
265
251
|
serviceConfigs = _ref2[1];
|
|
@@ -278,12 +264,33 @@ var Editing = /*#__PURE__*/function (_React$Component) {
|
|
|
278
264
|
return null;
|
|
279
265
|
}
|
|
280
266
|
var layerTitle = (_ref5 = (_ref6 = (_match$layer$translat = (_match$layer$translat2 = match.layer.translations) === null || _match$layer$translat2 === void 0 || (_match$layer$translat2 = _match$layer$translat2.layertree) === null || _match$layer$translat2 === void 0 ? void 0 : _match$layer$translat2[layerName]) !== null && _match$layer$translat !== void 0 ? _match$layer$translat : edConfig.layerTitle) !== null && _ref6 !== void 0 ? _ref6 : match === null || match === void 0 || (_match$sublayer = match.sublayer) === null || _match$sublayer === void 0 ? void 0 : _match$sublayer.title) !== null && _ref5 !== void 0 ? _ref5 : layerName;
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}, layerTitle);
|
|
267
|
+
return {
|
|
268
|
+
value: mapName + "#" + layerName,
|
|
269
|
+
title: layerTitle
|
|
270
|
+
};
|
|
286
271
|
});
|
|
272
|
+
}).flat().filter(Boolean).sort(function (a, b) {
|
|
273
|
+
return a.title.localeCompare(b.title);
|
|
274
|
+
});
|
|
275
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
276
|
+
className: "editing-body"
|
|
277
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
278
|
+
className: "editing-layer-selection"
|
|
279
|
+
}, /*#__PURE__*/React.createElement("select", {
|
|
280
|
+
className: "combo editing-layer-select",
|
|
281
|
+
disabled: _this.props.editContext.changed === true || _this.props.editContext.id !== _this.props.currentEditContext,
|
|
282
|
+
onChange: function onChange(ev) {
|
|
283
|
+
return _this.changeSelectedLayer(ev.target.value);
|
|
284
|
+
},
|
|
285
|
+
value: _this.state.selectedLayer || ""
|
|
286
|
+
}, /*#__PURE__*/React.createElement("option", {
|
|
287
|
+
disabled: true,
|
|
288
|
+
value: ""
|
|
289
|
+
}, LocaleUtils.tr("common.selectlayer")), editLayers.map(function (entry) {
|
|
290
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
291
|
+
key: entry.value,
|
|
292
|
+
value: entry.value
|
|
293
|
+
}, entry.title);
|
|
287
294
|
}))), /*#__PURE__*/React.createElement(ButtonBar, {
|
|
288
295
|
active: _this.state.drawPick ? "Draw" : _this.props.editContext.action,
|
|
289
296
|
buttons: actionButtons,
|
package/plugins/FeatureForm.js
CHANGED
|
@@ -249,16 +249,7 @@ var FeatureForm = /*#__PURE__*/function (_React$Component) {
|
|
|
249
249
|
translations: translations
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
|
-
|
|
253
|
-
className: "feature-query-body"
|
|
254
|
-
}, Object.keys(this.state.pickedFeatures).length > 1 ? /*#__PURE__*/React.createElement("div", {
|
|
255
|
-
className: "feature-query-selection"
|
|
256
|
-
}, /*#__PURE__*/React.createElement("select", {
|
|
257
|
-
onChange: function onChange(ev) {
|
|
258
|
-
return _this2.setSelectedFeature(ev.target.value);
|
|
259
|
-
},
|
|
260
|
-
value: this.state.selectedFeature
|
|
261
|
-
}, Object.entries(this.state.pickedFeatures).map(function (_ref7) {
|
|
252
|
+
var results = Object.entries(this.state.pickedFeatures).map(function (_ref7) {
|
|
262
253
|
var _ref9, _ref0, _match$layer$translat, _match$layer$translat2, _match$sublayer;
|
|
263
254
|
var _ref8 = _slicedToArray(_ref7, 2),
|
|
264
255
|
id = _ref8[0],
|
|
@@ -272,10 +263,27 @@ var FeatureForm = /*#__PURE__*/function (_React$Component) {
|
|
|
272
263
|
var match = LayerUtils.searchLayer(_this2.props.layers, 'wms_name', mapName, 'name', layerName);
|
|
273
264
|
var layerTitle = (_ref9 = (_ref0 = (_match$layer$translat = (_match$layer$translat2 = match.layer.translations) === null || _match$layer$translat2 === void 0 || (_match$layer$translat2 = _match$layer$translat2.layertree) === null || _match$layer$translat2 === void 0 ? void 0 : _match$layer$translat2[layerName]) !== null && _match$layer$translat !== void 0 ? _match$layer$translat : editConfig.layerTitle) !== null && _ref0 !== void 0 ? _ref0 : match === null || match === void 0 || (_match$sublayer = match.sublayer) === null || _match$sublayer === void 0 ? void 0 : _match$sublayer.title) !== null && _ref9 !== void 0 ? _ref9 : layerName;
|
|
274
265
|
var featureName = editConfig.displayField ? feature.properties[editConfig.displayField] : featureText + " " + featureId;
|
|
266
|
+
return {
|
|
267
|
+
value: id,
|
|
268
|
+
title: layerTitle + ": " + featureName
|
|
269
|
+
};
|
|
270
|
+
}).sort(function (a, b) {
|
|
271
|
+
return a.title.localeCompare(b.title);
|
|
272
|
+
});
|
|
273
|
+
body = /*#__PURE__*/React.createElement("div", {
|
|
274
|
+
className: "feature-query-body"
|
|
275
|
+
}, Object.keys(this.state.pickedFeatures).length > 1 ? /*#__PURE__*/React.createElement("div", {
|
|
276
|
+
className: "feature-query-selection"
|
|
277
|
+
}, /*#__PURE__*/React.createElement("select", {
|
|
278
|
+
onChange: function onChange(ev) {
|
|
279
|
+
return _this2.setSelectedFeature(ev.target.value);
|
|
280
|
+
},
|
|
281
|
+
value: this.state.selectedFeature
|
|
282
|
+
}, results.map(function (entry) {
|
|
275
283
|
return /*#__PURE__*/React.createElement("option", {
|
|
276
|
-
key:
|
|
277
|
-
value:
|
|
278
|
-
},
|
|
284
|
+
key: entry.value,
|
|
285
|
+
value: entry.value
|
|
286
|
+
}, entry.title);
|
|
279
287
|
}))) : null, attributeForm);
|
|
280
288
|
}
|
|
281
289
|
resultWindow = /*#__PURE__*/React.createElement(ResizeableWindow, {
|
package/plugins/MapLegend.js
CHANGED
|
@@ -110,6 +110,7 @@ var MapLegend = /*#__PURE__*/function (_React$Component) {
|
|
|
110
110
|
_this.state.onlyVisibleLegend = props.onlyVisibleLegend;
|
|
111
111
|
_this.state.bboxDependentLegend = props.bboxDependentLegend;
|
|
112
112
|
_this.state.scaleDependentLegend = props.scaleDependentLegend;
|
|
113
|
+
_this.state.visible = props.showOnStartup;
|
|
113
114
|
return _this;
|
|
114
115
|
}
|
|
115
116
|
_inherits(MapLegend, _React$Component);
|
|
@@ -233,7 +234,9 @@ _defineProperty(MapLegend, "propTypes", {
|
|
|
233
234
|
onlyVisibleLegend: PropTypes.bool,
|
|
234
235
|
/** Whether to display a scale-dependent legend by default. */
|
|
235
236
|
scaleDependentLegend: PropTypes.bool,
|
|
236
|
-
setCurrentTask: PropTypes.func
|
|
237
|
+
setCurrentTask: PropTypes.func,
|
|
238
|
+
/** Whether to show the MapLegend on startup. Useful if `startupTask` is already set to another task. */
|
|
239
|
+
showOnStartup: PropTypes.bool
|
|
237
240
|
});
|
|
238
241
|
_defineProperty(MapLegend, "defaultProps", {
|
|
239
242
|
addGroupTitles: false,
|
package/plugins/TopBar.js
CHANGED
|
@@ -245,6 +245,8 @@ _defineProperty(TopBar, "propTypes", {
|
|
|
245
245
|
allowAddLayerAsGroup: PropTypes.bool,
|
|
246
246
|
/** Whether to show the search filter widget. */
|
|
247
247
|
allowSearchFilters: PropTypes.bool,
|
|
248
|
+
/** List of additional CRS for which the coordinate search should display results. Alternatively, the string `mousecrs` to indicate the CRS listed in `additionalMouseCrs` of the current theme. */
|
|
249
|
+
extraCoordinateSearchCrs: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
|
|
248
250
|
/** Whether to focus the search field on startup. */
|
|
249
251
|
focusOnStartup: PropTypes.bool,
|
|
250
252
|
/** Whether to hide the result labels on the map. */
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2
4
|
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
3
5
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
6
|
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
@@ -40,6 +42,7 @@ import Icon from '../../components/Icon';
|
|
|
40
42
|
import ImportObjects3D from '../../components/map3d/ImportObjects3D';
|
|
41
43
|
import SideBar from '../../components/SideBar';
|
|
42
44
|
import NumberInput from '../../components/widgets/NumberInput';
|
|
45
|
+
import LayerUtils from '../../utils/LayerUtils';
|
|
43
46
|
import LocaleUtils from '../../utils/LocaleUtils';
|
|
44
47
|
import './style/LayerTree3D.css';
|
|
45
48
|
|
|
@@ -61,19 +64,25 @@ var LayerTree3D = /*#__PURE__*/function (_React$Component) {
|
|
|
61
64
|
});
|
|
62
65
|
_defineProperty(_this, "renderBody", function () {
|
|
63
66
|
var sceneContext = _this.props.sceneContext;
|
|
67
|
+
var objectsHaveGroups = sceneContext.objectTree["null"].children.some(function (child) {
|
|
68
|
+
return !isEmpty(sceneContext.objectTree[child].children);
|
|
69
|
+
});
|
|
70
|
+
var layersHaveSublayers = Object.values(sceneContext.colorLayers).some(function (layer) {
|
|
71
|
+
return !isEmpty(layer.sublayers);
|
|
72
|
+
});
|
|
64
73
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
65
74
|
className: "layertree3d-layers"
|
|
66
75
|
}, /*#__PURE__*/React.createElement("div", {
|
|
67
76
|
className: "layertree3d-section"
|
|
68
77
|
}, LocaleUtils.tr("layertree3d.objects")), sceneContext.objectTree["null"].children.map(function (objectId) {
|
|
69
|
-
return _this.renderLayerEntry(objectId, sceneContext.objectTree[objectId],
|
|
78
|
+
return _this.renderLayerEntry(objectId, sceneContext.objectTree[objectId], null, _this.updateSceneObject, true, true, [], objectsHaveGroups);
|
|
70
79
|
}), /*#__PURE__*/React.createElement("div", {
|
|
71
80
|
className: "layertree3d-section"
|
|
72
81
|
}, LocaleUtils.tr("layertree3d.layers")), Object.entries(sceneContext.colorLayers).map(function (_ref) {
|
|
73
82
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
74
83
|
layerId = _ref2[0],
|
|
75
84
|
entry = _ref2[1];
|
|
76
|
-
return _this.renderLayerEntry(layerId, entry,
|
|
85
|
+
return _this.renderLayerEntry(layerId, entry, null, _this.updateColorLayer, false, true, [], layersHaveSublayers);
|
|
77
86
|
}), /*#__PURE__*/React.createElement("div", {
|
|
78
87
|
className: "layertree3d-option",
|
|
79
88
|
onClick: function onClick() {
|
|
@@ -90,45 +99,72 @@ var LayerTree3D = /*#__PURE__*/function (_React$Component) {
|
|
|
90
99
|
sceneContext: _this.props.sceneContext
|
|
91
100
|
}) : null);
|
|
92
101
|
});
|
|
93
|
-
_defineProperty(_this, "renderLayerEntry", function (entryId, entry, updateCallback, isObject) {
|
|
102
|
+
_defineProperty(_this, "renderLayerEntry", function (entryId, entry, parent, updateCallback, isObject, parentVisible, path) {
|
|
94
103
|
var _entry$title, _entry$title2;
|
|
95
|
-
var
|
|
104
|
+
var haveExpanders = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : true;
|
|
96
105
|
if (entry.layertree === false) {
|
|
97
106
|
return null;
|
|
98
107
|
}
|
|
108
|
+
var key = [entryId].concat(_toConsumableArray(path)).join(":");
|
|
99
109
|
var classes = classNames({
|
|
100
110
|
"layertree3d-item": true,
|
|
101
111
|
"layertree3d-item-disabled": !entry.visibility || !parentVisible
|
|
102
112
|
});
|
|
103
113
|
var styleMenuClasses = classNames({
|
|
104
114
|
"layertree3d-item-menubutton": true,
|
|
105
|
-
"layertree3d-item-menubutton-active": _this.state.activestylemenu ===
|
|
115
|
+
"layertree3d-item-menubutton-active": _this.state.activestylemenu === key
|
|
106
116
|
});
|
|
107
117
|
var optMenuClasses = classNames({
|
|
108
118
|
"layertree3d-item-menubutton": true,
|
|
109
|
-
"layertree3d-item-menubutton-active": _this.state.activemenu ===
|
|
119
|
+
"layertree3d-item-menubutton-active": _this.state.activemenu === key
|
|
110
120
|
});
|
|
121
|
+
var expander = null;
|
|
122
|
+
if (haveExpanders) {
|
|
123
|
+
expander = !isEmpty(entry.sublayers) || !isEmpty(entry.children) ? /*#__PURE__*/React.createElement(Icon, {
|
|
124
|
+
className: "layertree3d-item-expander",
|
|
125
|
+
icon: entry.expanded === false ? "tree_plus" : "tree_minus",
|
|
126
|
+
onClick: function onClick() {
|
|
127
|
+
var _entry$expanded;
|
|
128
|
+
return updateCallback(entryId, {
|
|
129
|
+
expanded: !((_entry$expanded = entry.expanded) !== null && _entry$expanded !== void 0 ? _entry$expanded : true)
|
|
130
|
+
}, {
|
|
131
|
+
path: path
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}) : /*#__PURE__*/React.createElement("span", {
|
|
135
|
+
className: "layertree3d-item-expander"
|
|
136
|
+
});
|
|
137
|
+
}
|
|
111
138
|
return /*#__PURE__*/React.createElement("div", {
|
|
112
139
|
className: "layertree3d-item-container",
|
|
113
|
-
key:
|
|
140
|
+
key: key
|
|
114
141
|
}, /*#__PURE__*/React.createElement("div", {
|
|
115
142
|
className: classes
|
|
116
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
143
|
+
}, expander, /*#__PURE__*/React.createElement(Icon, {
|
|
117
144
|
className: "layertree3d-item-checkbox",
|
|
118
|
-
icon:
|
|
145
|
+
icon: _this.computeVisibilityIcon(isObject, entry, parent),
|
|
119
146
|
onClick: function onClick() {
|
|
120
147
|
return updateCallback(entryId, {
|
|
121
148
|
visibility: !entry.visibility
|
|
149
|
+
}, {
|
|
150
|
+
path: path
|
|
122
151
|
});
|
|
123
152
|
}
|
|
124
153
|
}), /*#__PURE__*/React.createElement("span", {
|
|
125
154
|
className: "layertree3d-item-title",
|
|
155
|
+
onClick: function onClick() {
|
|
156
|
+
return updateCallback(entryId, {
|
|
157
|
+
visibility: !entry.visibility
|
|
158
|
+
}, {
|
|
159
|
+
path: path
|
|
160
|
+
});
|
|
161
|
+
},
|
|
126
162
|
title: (_entry$title = entry.title) !== null && _entry$title !== void 0 ? _entry$title : entryId
|
|
127
163
|
}, (_entry$title2 = entry.title) !== null && _entry$title2 !== void 0 ? _entry$title2 : entryId), Object.keys(entry.styles || {}).length > 1 ? /*#__PURE__*/React.createElement(Icon, {
|
|
128
164
|
className: styleMenuClasses,
|
|
129
165
|
icon: "paint",
|
|
130
166
|
onClick: function onClick() {
|
|
131
|
-
return _this.layerStyleMenuToggled(
|
|
167
|
+
return _this.layerStyleMenuToggled(key);
|
|
132
168
|
}
|
|
133
169
|
}) : null, entry.drawGroup || entry.imported ? /*#__PURE__*/React.createElement(Icon, {
|
|
134
170
|
className: "layertree3d-item-remove",
|
|
@@ -140,9 +176,9 @@ var LayerTree3D = /*#__PURE__*/function (_React$Component) {
|
|
|
140
176
|
className: optMenuClasses,
|
|
141
177
|
icon: "cog",
|
|
142
178
|
onClick: function onClick() {
|
|
143
|
-
return _this.layerMenuToggled(
|
|
179
|
+
return _this.layerMenuToggled(key);
|
|
144
180
|
}
|
|
145
|
-
})), _this.state.activemenu ===
|
|
181
|
+
})), _this.state.activemenu === key ? /*#__PURE__*/React.createElement("div", {
|
|
146
182
|
className: "layertree3d-item-optionsmenu"
|
|
147
183
|
}, /*#__PURE__*/React.createElement("div", {
|
|
148
184
|
className: "layertree3d-item-optionsmenu-row"
|
|
@@ -166,12 +202,25 @@ var LayerTree3D = /*#__PURE__*/function (_React$Component) {
|
|
|
166
202
|
onChange: function onChange(ev) {
|
|
167
203
|
return updateCallback(entryId, {
|
|
168
204
|
opacity: parseInt(ev.target.value, 10)
|
|
205
|
+
}, {
|
|
206
|
+
path: path
|
|
169
207
|
});
|
|
170
208
|
},
|
|
171
209
|
step: "1",
|
|
172
210
|
type: "range",
|
|
173
211
|
value: entry.opacity
|
|
174
|
-
})
|
|
212
|
+
}), (!isEmpty(entry.children) || !isEmpty(entry.sublayers)) && !_this.props.groupTogglesSublayers ? /*#__PURE__*/React.createElement(Icon, {
|
|
213
|
+
icon: "tree",
|
|
214
|
+
onClick: function onClick() {
|
|
215
|
+
return updateCallback(entryId, {
|
|
216
|
+
visibility: !entry.visibility
|
|
217
|
+
}, {
|
|
218
|
+
path: path,
|
|
219
|
+
groupTogglesSublayers: true
|
|
220
|
+
});
|
|
221
|
+
},
|
|
222
|
+
title: LocaleUtils.tr("layertree.togglegroup")
|
|
223
|
+
}) : null), entry.extrusionHeight !== undefined ? /*#__PURE__*/React.createElement("div", {
|
|
175
224
|
className: "layertree3d-item-optionsmenu-row"
|
|
176
225
|
}, /*#__PURE__*/React.createElement("span", null, "Extrude:"), /*#__PURE__*/React.createElement(React.Fragment, null, "\xA0"), /*#__PURE__*/React.createElement("select", {
|
|
177
226
|
onChange: function onChange(ev) {
|
|
@@ -196,7 +245,7 @@ var LayerTree3D = /*#__PURE__*/function (_React$Component) {
|
|
|
196
245
|
});
|
|
197
246
|
},
|
|
198
247
|
value: entry.extrusionHeight
|
|
199
|
-
}) : null) : null) : null, _this.state.activestylemenu ===
|
|
248
|
+
}) : null) : null) : null, _this.state.activestylemenu === key ? /*#__PURE__*/React.createElement("div", {
|
|
200
249
|
className: "layertree3d-item-stylemenu"
|
|
201
250
|
}, Object.keys(entry.styles).map(function (name) {
|
|
202
251
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -209,72 +258,47 @@ var LayerTree3D = /*#__PURE__*/function (_React$Component) {
|
|
|
209
258
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
210
259
|
icon: entry.style === name ? "radio_checked" : "radio_unchecked"
|
|
211
260
|
}), /*#__PURE__*/React.createElement("div", null, name));
|
|
212
|
-
})) : null, !isEmpty(entry.sublayers) ? /*#__PURE__*/React.createElement("div", {
|
|
261
|
+
})) : null, !isEmpty(entry.sublayers) && entry.expanded !== false ? /*#__PURE__*/React.createElement("div", {
|
|
213
262
|
className: "layertree3d-item-sublayers"
|
|
214
263
|
}, entry.sublayers.map(function (sublayer, idx) {
|
|
215
|
-
return _this.
|
|
216
|
-
})) : null, !isEmpty(entry.children) ? /*#__PURE__*/React.createElement("div", {
|
|
264
|
+
return _this.renderLayerEntry(entryId, sublayer, entry, updateCallback, isObject, parentVisible && entry.visibility, [].concat(_toConsumableArray(path), [idx]));
|
|
265
|
+
})) : null, !isEmpty(entry.children) && entry.expanded !== false ? /*#__PURE__*/React.createElement("div", {
|
|
217
266
|
className: "layertree3d-item-sublayers"
|
|
218
|
-
}, entry.children.map(function (childId) {
|
|
219
|
-
return _this.renderLayerEntry(childId, _this.props.sceneContext.objectTree[childId], updateCallback,
|
|
267
|
+
}, entry.children.map(function (childId, idx) {
|
|
268
|
+
return _this.renderLayerEntry(childId, _this.props.sceneContext.objectTree[childId], entry, updateCallback, isObject, parentVisible && entry.visibility, [].concat(_toConsumableArray(path), [idx]));
|
|
220
269
|
})) : null);
|
|
221
270
|
});
|
|
222
|
-
_defineProperty(_this, "
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
key: key
|
|
235
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
236
|
-
className: classes
|
|
237
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
238
|
-
className: "layertree3d-item-checkbox",
|
|
239
|
-
icon: sublayer.visibility ? "checked" : "unchecked",
|
|
240
|
-
onClick: function onClick() {
|
|
241
|
-
return updateCallback(entryId, {
|
|
242
|
-
visibility: !sublayer.visibility
|
|
243
|
-
}, path);
|
|
244
|
-
},
|
|
245
|
-
sublayer: "layertree3d-item-checkbox"
|
|
246
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
247
|
-
className: "layertree3d-item-title",
|
|
248
|
-
title: sublayer.title
|
|
249
|
-
}, sublayer.title), /*#__PURE__*/React.createElement(Icon, {
|
|
250
|
-
className: optMenuClasses,
|
|
251
|
-
icon: "cog",
|
|
252
|
-
onClick: function onClick() {
|
|
253
|
-
return _this.layerMenuToggled(key);
|
|
271
|
+
_defineProperty(_this, "computeVisibilityIcon", function (isObject, entry, parent) {
|
|
272
|
+
if (parent !== null && parent !== void 0 && parent.mutuallyExclusive) {
|
|
273
|
+
return entry.visibility ? "radio_checked" : "radio_unchecked";
|
|
274
|
+
}
|
|
275
|
+
if (!entry.visibility) {
|
|
276
|
+
return "unchecked";
|
|
277
|
+
} else {
|
|
278
|
+
if (_this.props.groupTogglesSublayers) {
|
|
279
|
+
var subtreevisibility = isObject ? _this.computeObjectTreeVisibility(entry) : LayerUtils.computeLayerVisibility(entry);
|
|
280
|
+
return subtreevisibility === 1 ? "checked" : "tristate";
|
|
281
|
+
} else {
|
|
282
|
+
return "checked";
|
|
254
283
|
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
}))) : null, !isEmpty(sublayer.sublayers) ? /*#__PURE__*/React.createElement("div", {
|
|
274
|
-
className: "layertree3d-item-sublayers"
|
|
275
|
-
}, sublayer.sublayers.map(function (child, idx) {
|
|
276
|
-
return _this.renderSublayer(child, entryId, updateCallback, [].concat(_toConsumableArray(path), [idx]), parentVisible && sublayer.visibility);
|
|
277
|
-
})) : null);
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
_defineProperty(_this, "computeObjectTreeVisibility", function (entry) {
|
|
287
|
+
if (isEmpty(entry.children) || entry.visibility === false) {
|
|
288
|
+
return entry.visibility ? 1 : 0;
|
|
289
|
+
}
|
|
290
|
+
var visible = 0;
|
|
291
|
+
entry.children.map(function (childId) {
|
|
292
|
+
var _child$visibility;
|
|
293
|
+
var child = _this.props.sceneContext.objectTree[childId];
|
|
294
|
+
var sublayervisibility = (_child$visibility = child.visibility) !== null && _child$visibility !== void 0 ? _child$visibility : true;
|
|
295
|
+
if (child.children && sublayervisibility) {
|
|
296
|
+
visible += _this.computeObjectTreeVisibility(entry);
|
|
297
|
+
} else {
|
|
298
|
+
visible += sublayervisibility ? 1 : 0;
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
return visible / entry.children.length;
|
|
278
302
|
});
|
|
279
303
|
_defineProperty(_this, "layerStyleMenuToggled", function (entryId) {
|
|
280
304
|
_this.setState(function (state) {
|
|
@@ -295,6 +319,18 @@ var LayerTree3D = /*#__PURE__*/function (_React$Component) {
|
|
|
295
319
|
objectId: objectId
|
|
296
320
|
});
|
|
297
321
|
});
|
|
322
|
+
_defineProperty(_this, "updateSceneObject", function (objectId, options) {
|
|
323
|
+
var flags = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
324
|
+
_this.props.sceneContext.updateSceneObject(objectId, options, _objectSpread({
|
|
325
|
+
groupTogglesSublayers: _this.props.groupTogglesSublayers
|
|
326
|
+
}, flags));
|
|
327
|
+
});
|
|
328
|
+
_defineProperty(_this, "updateColorLayer", function (objectId, options) {
|
|
329
|
+
var flags = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
330
|
+
_this.props.sceneContext.updateColorLayer(objectId, options, _objectSpread({
|
|
331
|
+
groupTogglesSublayers: _this.props.groupTogglesSublayers
|
|
332
|
+
}, flags));
|
|
333
|
+
});
|
|
298
334
|
return _this;
|
|
299
335
|
}
|
|
300
336
|
_inherits(LayerTree3D, _React$Component);
|
|
@@ -316,6 +352,8 @@ var LayerTree3D = /*#__PURE__*/function (_React$Component) {
|
|
|
316
352
|
}]);
|
|
317
353
|
}(React.Component);
|
|
318
354
|
_defineProperty(LayerTree3D, "propTypes", {
|
|
355
|
+
/** Whether toggling a group also toggles all sublayers. */
|
|
356
|
+
groupTogglesSublayers: PropTypes.bool,
|
|
319
357
|
/** Base URL of imported tile sets. */
|
|
320
358
|
importedTilesBaseUrl: PropTypes.string,
|
|
321
359
|
sceneContext: PropTypes.object,
|
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
padding: 0.25em 0 0 0.25em;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
#LayerTree3D span.layertree3d-item-expander {
|
|
10
|
+
margin-right: 0.25em;
|
|
11
|
+
flex: 0 0 1em;
|
|
12
|
+
}
|
|
13
|
+
|
|
9
14
|
#LayerTree3D div.layertree3d-item-container {
|
|
10
15
|
padding-left: 0.5em;
|
|
11
16
|
}
|
|
@@ -31,6 +36,7 @@
|
|
|
31
36
|
white-space: nowrap;
|
|
32
37
|
overflow: hidden;
|
|
33
38
|
text-overflow: ellipsis;
|
|
39
|
+
cursor: pointer;
|
|
34
40
|
}
|
|
35
41
|
|
|
36
42
|
#LayerTree3D span.layertree3d-item-transparency {
|
package/reducers/layers.js
CHANGED
|
@@ -81,6 +81,18 @@ function parsePropType(type) {
|
|
|
81
81
|
return type.name;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
+
function parsePropDesc(prop) {
|
|
85
|
+
if (prop.type.name === 'shape') {
|
|
86
|
+
return prop.description.replaceAll("\n", "<br />") + "<br />" + Object.entries(prop.type.value).map(function (_ref3) {
|
|
87
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
88
|
+
name = _ref4[0],
|
|
89
|
+
subprop = _ref4[1];
|
|
90
|
+
return "- " + name + ": " + subprop.description;
|
|
91
|
+
}).join("<br />");
|
|
92
|
+
} else {
|
|
93
|
+
return prop.description.replaceAll("\n", "<br />");
|
|
94
|
+
}
|
|
95
|
+
}
|
|
84
96
|
function genPluginDoc(plugin) {
|
|
85
97
|
var output = "";
|
|
86
98
|
if (!plugin.description) {
|
|
@@ -94,10 +106,10 @@ function genPluginDoc(plugin) {
|
|
|
94
106
|
if (props.length > 0) {
|
|
95
107
|
output += "| Property | Type | Description | Default value |\n";
|
|
96
108
|
output += "|----------|------|-------------|---------------|\n";
|
|
97
|
-
props.forEach(function (
|
|
98
|
-
var
|
|
99
|
-
name =
|
|
100
|
-
prop =
|
|
109
|
+
props.forEach(function (_ref5) {
|
|
110
|
+
var _ref6 = _slicedToArray(_ref5, 2),
|
|
111
|
+
name = _ref6[0],
|
|
112
|
+
prop = _ref6[1];
|
|
101
113
|
if (!prop.description) {
|
|
102
114
|
return;
|
|
103
115
|
}
|
|
@@ -105,7 +117,7 @@ function genPluginDoc(plugin) {
|
|
|
105
117
|
return '`' + x.replace(' ', ' ') + '`';
|
|
106
118
|
}).join("<br />") : "`undefined`";
|
|
107
119
|
var type = "`" + parsePropType(prop.type).replaceAll(' ', ' ').replaceAll("\n", "`<br />`") + "`";
|
|
108
|
-
output += "| ".concat(name, " | ").concat(type, " | ").concat(prop
|
|
120
|
+
output += "| ".concat(name, " | ").concat(type, " | ").concat(parsePropDesc(prop), " | ").concat(defaultValue, " |\n");
|
|
109
121
|
});
|
|
110
122
|
output += "\n";
|
|
111
123
|
}
|
package/scripts/themesConfig.js
CHANGED
|
@@ -668,6 +668,7 @@ function genThemes(themesConfig) {
|
|
|
668
668
|
defaultPrintResolutions: config.defaultPrintResolutions,
|
|
669
669
|
defaultPrintGrid: config.defaultPrintGrid,
|
|
670
670
|
defaultSearchProviders: config.defaultSearchProviders,
|
|
671
|
+
defaultMapTips: config.defaultMapTips,
|
|
671
672
|
defaultBackgroundLayers: config.defaultBackgroundLayers || [],
|
|
672
673
|
externalLayers: config.themes.externalLayers || [],
|
|
673
674
|
pluginData: config.themes.pluginData,
|
package/scripts/themesConfig.py
CHANGED
|
@@ -625,6 +625,7 @@ def genThemes(themesConfig):
|
|
|
625
625
|
"defaultPrintGrid": config["defaultPrintGrid"] if "defaultPrintGrid" in config else None,
|
|
626
626
|
"defaultSearchProviders": config["defaultSearchProviders"] if "defaultSearchProviders" in config else None,
|
|
627
627
|
"defaultBackgroundLayers": config["defaultBackgroundLayers"] if "defaultBackgroundLayers" in config else [],
|
|
628
|
+
"defaultMapTips": config["defaultMapTips"] if "defaultMapTips" in config else None,
|
|
628
629
|
"pluginData": config["themes"]["pluginData"] if "pluginData" in config["themes"] else [],
|
|
629
630
|
"themeInfoLinks": config["themes"]["themeInfoLinks"] if "themeInfoLinks" in config["themes"] else [],
|
|
630
631
|
"externalLayers": config["themes"]["externalLayers"] if "externalLayers" in config["themes"] else [],
|
package/utils/EditingUtils.js
CHANGED
|
@@ -193,11 +193,11 @@ export function parseExpression(expr, feature, editConfig, editIface, mapPrefix,
|
|
|
193
193
|
};
|
|
194
194
|
var result = null;
|
|
195
195
|
try {
|
|
196
|
-
parser.feed(expr.replace(/\n
|
|
196
|
+
parser.feed(expr.replace(/\n/g, ' '));
|
|
197
197
|
result = parser.results[0];
|
|
198
198
|
} catch (_unused2) {
|
|
199
199
|
/* eslint-disable-next-line */
|
|
200
|
-
console.warn("Failed to evaluate expression " + expr.replace(/\n
|
|
200
|
+
console.warn("Failed to evaluate expression " + expr.replace(/\n/g, ' '));
|
|
201
201
|
}
|
|
202
202
|
delete window.qwc2ExpressionParserContext;
|
|
203
203
|
if (promises.length > 0) {
|
|
@@ -244,13 +244,13 @@ export function parseExpressionsAsync(fieldExpressions, feature, editConfig, edi
|
|
|
244
244
|
expression = _ref.expression;
|
|
245
245
|
var parser = new nearley.Parser(nearley.Grammar.fromCompiled(grammar));
|
|
246
246
|
try {
|
|
247
|
-
parser.feed(expression.replace(/\n
|
|
247
|
+
parser.feed(expression.replace(/\n/g, ' '));
|
|
248
248
|
// NOTE: include intermediate results in next context feature
|
|
249
249
|
newfeature.properties[field] = parser.results[0];
|
|
250
250
|
return _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, field, parser.results[0]));
|
|
251
251
|
} catch (_unused3) {
|
|
252
252
|
/* eslint-disable-next-line */
|
|
253
|
-
console.warn("Failed to evaluate expression " + expression.replace(/\n
|
|
253
|
+
console.warn("Failed to evaluate expression " + expression.replace(/\n/g, ' '));
|
|
254
254
|
return res;
|
|
255
255
|
}
|
|
256
256
|
}, {});
|
package/utils/SearchProviders.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
3
|
-
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
4
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
6
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
7
3
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
8
4
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
10
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
11
5
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
6
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13
7
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -18,6 +12,12 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
|
|
|
18
12
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
19
13
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
20
14
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
16
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
18
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
19
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
20
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
21
21
|
/**
|
|
22
22
|
* Copyright 2016-2021 Sourcepole AG
|
|
23
23
|
* All rights reserved.
|
|
@@ -50,16 +50,19 @@ function coordinatesSearch(text, searchParams, callback) {
|
|
|
50
50
|
if (matches && matches.length >= 3) {
|
|
51
51
|
var x = parseFloat(matches[1]);
|
|
52
52
|
var y = parseFloat(matches[2]);
|
|
53
|
-
|
|
53
|
+
var searchCrs = [displaycrs].concat(_toConsumableArray(searchParams.extracrs.filter(function (crs) {
|
|
54
|
+
return !['EPSG:4326', displaycrs].includes(crs);
|
|
55
|
+
})));
|
|
56
|
+
searchCrs.forEach(function (crs) {
|
|
54
57
|
items.push({
|
|
55
|
-
id: "
|
|
56
|
-
text: x + ", " + y + " (" +
|
|
58
|
+
id: "coord" + items.length,
|
|
59
|
+
text: x + ", " + y + " (" + crs + ")",
|
|
57
60
|
x: x,
|
|
58
61
|
y: y,
|
|
59
|
-
crs:
|
|
62
|
+
crs: crs,
|
|
60
63
|
bbox: [x, y, x, y]
|
|
61
64
|
});
|
|
62
|
-
}
|
|
65
|
+
});
|
|
63
66
|
if (x >= -180 && x <= 180 && y >= -90 && y <= 90) {
|
|
64
67
|
var title = Math.abs(x) + (x >= 0 ? "°E" : "°W") + ", " + Math.abs(y) + (y >= 0 ? "°N" : "°S");
|
|
65
68
|
items.push({
|