qwc2 2026.7.18 → 2026.7.29
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/components/IdentifyViewer.js +1 -7
- package/components/LayerInfoWindow.js +1 -2
- package/components/LocationRecorder.js +1 -1
- package/components/PickFeature.js +4 -2
- package/components/ResizeableWindow.js +1 -1
- package/components/SearchBox.js +6 -6
- package/components/ServiceInfoWindow.js +5 -18
- package/components/ThemeList.js +1 -2
- package/components/map3d/Map3D.js +23 -2
- package/components/map3d/utils/OrbitControls3D.js +2 -1
- package/components/style/ResizeableWindow.css +10 -0
- package/components/widgets/ColorButton.js +38 -30
- package/components/widgets/LayerCatalogWidget.js +14 -6
- package/components/widgets/TextInput.js +4 -5
- package/components/widgets/style/ColorButton.css +15 -4
- package/package.json +1 -1
- package/plugins/FeatureForm.js +1 -2
- package/plugins/HeightProfile.js +4 -0
- package/plugins/Identify.js +28 -7
- package/plugins/LayerCatalog.js +5 -0
- package/plugins/LayerTree.js +24 -10
- package/plugins/MapCopyright.js +2 -2
- package/plugins/MapExport.js +4 -0
- package/plugins/MapTip.js +2 -4
- package/plugins/Print.js +4 -0
- package/plugins/Routing.js +1 -1
- package/plugins/ServiceInfo.js +109 -0
- package/plugins/TaskButton.js +2 -10
- package/plugins/TopBar.js +1 -1
- package/plugins/VisibilityPreset.js +14 -14
- package/plugins/map3d/Compare3D.js +11 -2
- package/plugins/map3d/Identify3D.js +1 -2
- package/plugins/map3d/MapCopyright3D.js +2 -2
- package/plugins/map3d/Viewshed3D.js +387 -0
- package/plugins/map3d/style/Viewshed3D.css +26 -0
- package/plugins/redlining/RedliningFeatureLabelSupport.js +5 -5
- package/static/translations/bg-BG.json +9 -0
- package/static/translations/ca-ES.json +9 -0
- package/static/translations/cs-CZ.json +9 -0
- package/static/translations/de-CH.json +9 -0
- package/static/translations/de-DE.json +9 -0
- package/static/translations/en-US.json +9 -0
- package/static/translations/es-ES.json +9 -0
- package/static/translations/fi-FI.json +9 -0
- package/static/translations/fr-FR.json +10 -1
- package/static/translations/hu-HU.json +9 -0
- package/static/translations/it-IT.json +9 -0
- package/static/translations/ja-JP.json +9 -0
- package/static/translations/nl-NL.json +9 -0
- package/static/translations/no-NO.json +9 -0
- package/static/translations/pl-PL.json +9 -0
- package/static/translations/pt-BR.json +9 -0
- package/static/translations/pt-PT.json +9 -0
- package/static/translations/ro-RO.json +9 -0
- package/static/translations/ru-RU.json +9 -0
- package/static/translations/sv-SE.json +9 -0
- package/static/translations/tr-TR.json +9 -0
- package/static/translations/tsconfig.json +8 -0
- package/static/translations/uk-UA.json +9 -0
- package/utils/EditingUtils.js +16 -13
- package/utils/LayerUtils.js +3 -2
- package/utils/MiscUtils.js +9 -0
- package/utils/VectorLayerUtils.js +67 -28
- package/utils/expr_grammar/grammar.js +78 -24
- package/utils/expr_grammar/grammar.ne +2 -1
- package/utils/expr_grammar/test.js +6 -0
- package/actions/serviceinfo.js +0 -18
- package/reducers/serviceinfo.js +0 -30
|
@@ -37,7 +37,6 @@ import React from 'react';
|
|
|
37
37
|
import { connect } from 'react-redux';
|
|
38
38
|
import axios from 'axios';
|
|
39
39
|
import clone from 'clone';
|
|
40
|
-
import DOMPurify from 'dompurify';
|
|
41
40
|
import FileSaver from 'file-saver';
|
|
42
41
|
import JSZip from 'jszip';
|
|
43
42
|
import isEmpty from 'lodash.isempty';
|
|
@@ -1164,12 +1163,7 @@ var IdentifyViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
1164
1163
|
return _this.parsedContent(text);
|
|
1165
1164
|
});
|
|
1166
1165
|
_defineProperty(_this, "parsedContent", function (text) {
|
|
1167
|
-
text =
|
|
1168
|
-
ADD_ATTR: ['target'],
|
|
1169
|
-
ADD_TAGS: ["iframe"],
|
|
1170
|
-
FORCE_BODY: true,
|
|
1171
|
-
ALLOW_UNKNOWN_PROTOCOLS: true
|
|
1172
|
-
}).replace(' ', '<br />');
|
|
1166
|
+
text = MiscUtils.sanitizeHtml(text).replace(' ', '<br />');
|
|
1173
1167
|
var options = {
|
|
1174
1168
|
replace: function replace(node) {
|
|
1175
1169
|
if (node.name === "a") {
|
|
@@ -22,7 +22,6 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
22
22
|
|
|
23
23
|
import React from 'react';
|
|
24
24
|
import { connect } from 'react-redux';
|
|
25
|
-
import DOMPurify from 'dompurify';
|
|
26
25
|
import PropTypes from 'prop-types';
|
|
27
26
|
import { setActiveLayerInfo } from '../actions/layerinfo';
|
|
28
27
|
import ResizeableWindow from '../components/ResizeableWindow';
|
|
@@ -45,7 +44,7 @@ var LayerInfoWindow = /*#__PURE__*/function (_React$Component) {
|
|
|
45
44
|
if (content) {
|
|
46
45
|
return /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, title, ":"), html ? /*#__PURE__*/React.createElement("td", {
|
|
47
46
|
dangerouslySetInnerHTML: {
|
|
48
|
-
__html: MiscUtils.addLinkAnchors(
|
|
47
|
+
__html: MiscUtils.addLinkAnchors(MiscUtils.sanitizeHtml(content))
|
|
49
48
|
}
|
|
50
49
|
}) : /*#__PURE__*/React.createElement("td", null, content));
|
|
51
50
|
}
|
|
@@ -45,7 +45,7 @@ var LocationRecorder = /*#__PURE__*/function (_React$Component) {
|
|
|
45
45
|
} else {
|
|
46
46
|
_this.props.drawInteraction.abortDrawing();
|
|
47
47
|
_this.props.drawInteraction.setActive(false);
|
|
48
|
-
// Re-add overlay to map, removed by setActive(false), to ensure traced feature is
|
|
48
|
+
// Re-add overlay to map, removed by setActive(false), to ensure traced feature is visible
|
|
49
49
|
_this.props.drawInteraction.getOverlay().setMap(_this.props.map);
|
|
50
50
|
_this.setState({
|
|
51
51
|
recording: true
|
|
@@ -94,7 +94,7 @@ var PickFeature = /*#__PURE__*/function (_React$Component) {
|
|
|
94
94
|
};
|
|
95
95
|
if (newState.pendingQueries === 0) {
|
|
96
96
|
if (newState.pickResults.length === 1) {
|
|
97
|
-
_this.props.featurePicked(newState.pickResults[0].layer, newState.pickResults[0].feature, newState.pickResults[0].mapName);
|
|
97
|
+
_this.props.featurePicked(newState.pickResults[0].layer, newState.pickResults[0].feature, newState.pickResults[0].mapName, state.mapPos);
|
|
98
98
|
newState.pickResults = null;
|
|
99
99
|
newState.pickGeom = null;
|
|
100
100
|
} else if (newState.pickResults.length === 0) {
|
|
@@ -237,6 +237,7 @@ var PickFeature = /*#__PURE__*/function (_React$Component) {
|
|
|
237
237
|
return {
|
|
238
238
|
pickResults: pickResults,
|
|
239
239
|
clickPos: clickPos,
|
|
240
|
+
mapPos: [maxX, maxY],
|
|
240
241
|
pendingQueries: queryWmsLayers.length,
|
|
241
242
|
reqId: reqId
|
|
242
243
|
};
|
|
@@ -261,7 +262,7 @@ var PickFeature = /*#__PURE__*/function (_React$Component) {
|
|
|
261
262
|
return /*#__PURE__*/React.createElement("div", {
|
|
262
263
|
key: key,
|
|
263
264
|
onClick: function onClick() {
|
|
264
|
-
return _this3.props.featurePicked(entry.layer, entry.feature, entry.mapName);
|
|
265
|
+
return _this3.props.featurePicked(entry.layer, entry.feature, entry.mapName, _this3.state.mapPos);
|
|
265
266
|
},
|
|
266
267
|
onMouseOut: function onMouseOut() {
|
|
267
268
|
return _this3.clearHighlight(key, entry.feature);
|
|
@@ -330,6 +331,7 @@ _defineProperty(PickFeature, "defaultState", {
|
|
|
330
331
|
pickGeom: null,
|
|
331
332
|
pickResults: null,
|
|
332
333
|
clickPos: null,
|
|
334
|
+
mapPos: null,
|
|
333
335
|
highlightedFeature: null,
|
|
334
336
|
pendingQueries: 0,
|
|
335
337
|
reqId: null
|
|
@@ -319,7 +319,7 @@ var ResizeableWindow = /*#__PURE__*/function (_React$Component) {
|
|
|
319
319
|
}, _this.renderTitleBar(), /*#__PURE__*/React.createElement("div", {
|
|
320
320
|
className: "resizeable-window-body"
|
|
321
321
|
}, _this.portalNode ? /*#__PURE__*/React.createElement("div", {
|
|
322
|
-
className: "resizeable-window-portal-container"
|
|
322
|
+
className: "resizeable-window-portal-container resizeable-window-portal-container-detached"
|
|
323
323
|
}, /*#__PURE__*/React.createElement(portals.OutPortal, {
|
|
324
324
|
node: _this.portalNode
|
|
325
325
|
})) : _this.props.children)), _this.state.externalWindow.document.body);
|
package/components/SearchBox.js
CHANGED
|
@@ -36,7 +36,6 @@ import React from 'react';
|
|
|
36
36
|
import { connect } from 'react-redux';
|
|
37
37
|
import axios from 'axios';
|
|
38
38
|
import classnames from 'classnames';
|
|
39
|
-
import DOMPurify from 'dompurify';
|
|
40
39
|
import isEmpty from 'lodash.isempty';
|
|
41
40
|
import pointInPolygon from 'point-in-polygon';
|
|
42
41
|
import polygonIntersectTest from 'polygon-intersect-test';
|
|
@@ -410,7 +409,7 @@ var SearchBox = /*#__PURE__*/function (_React$Component) {
|
|
|
410
409
|
}) : null, /*#__PURE__*/React.createElement("span", {
|
|
411
410
|
className: "searchbox-result-label",
|
|
412
411
|
dangerouslySetInnerHTML: {
|
|
413
|
-
__html:
|
|
412
|
+
__html: MiscUtils.sanitizeHtml(result.text).replace(/<br\s*\/>/ig, ' ')
|
|
414
413
|
},
|
|
415
414
|
title: (_result$label = result.label) !== null && _result$label !== void 0 ? _result$label : result.text
|
|
416
415
|
}), result.externalLink ? /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -468,7 +467,7 @@ var SearchBox = /*#__PURE__*/function (_React$Component) {
|
|
|
468
467
|
}) : null, /*#__PURE__*/React.createElement("span", {
|
|
469
468
|
className: "searchbox-result-label",
|
|
470
469
|
dangerouslySetInnerHTML: {
|
|
471
|
-
__html:
|
|
470
|
+
__html: MiscUtils.sanitizeHtml(result.text).replace(/<br\s*\/>/ig, ' ')
|
|
472
471
|
},
|
|
473
472
|
title: (_result$label3 = result.label) !== null && _result$label3 !== void 0 ? _result$label3 : result.text
|
|
474
473
|
}), result.theme && addThemes ? /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -501,7 +500,7 @@ var SearchBox = /*#__PURE__*/function (_React$Component) {
|
|
|
501
500
|
}) : null), _this.state.activeLayerInfo === key ? /*#__PURE__*/React.createElement("div", {
|
|
502
501
|
className: "searchbox-result-abstract",
|
|
503
502
|
dangerouslySetInnerHTML: {
|
|
504
|
-
__html: MiscUtils.addLinkAnchors(
|
|
503
|
+
__html: MiscUtils.addLinkAnchors(MiscUtils.sanitizeHtml(((_result$layer = result.layer) === null || _result$layer === void 0 ? void 0 : _result$layer["abstract"]) || "")) || LocaleUtils.tr("search.nodescription")
|
|
505
504
|
},
|
|
506
505
|
disabled: true,
|
|
507
506
|
key: key + ":abstract",
|
|
@@ -533,13 +532,14 @@ var SearchBox = /*#__PURE__*/function (_React$Component) {
|
|
|
533
532
|
}), /*#__PURE__*/React.createElement("span", {
|
|
534
533
|
className: "searchbox-result-label",
|
|
535
534
|
dangerouslySetInnerHTML: {
|
|
536
|
-
__html:
|
|
535
|
+
__html: MiscUtils.sanitizeHtml(result.text).replace(/<br\s*\/>/ig, ' ')
|
|
537
536
|
},
|
|
538
537
|
title: (_result$label5 = result.label) !== null && _result$label5 !== void 0 ? _result$label5 : result.text
|
|
539
538
|
}), result.theme && addThemes ? /*#__PURE__*/React.createElement(Icon, {
|
|
540
539
|
icon: "plus",
|
|
541
540
|
onClick: function onClick(ev) {
|
|
542
|
-
|
|
541
|
+
MiscUtils.killEvent(ev);
|
|
542
|
+
_this.addThemeLayers(result.layer);
|
|
543
543
|
},
|
|
544
544
|
title: LocaleUtils.tr("themeswitcher.addtotheme")
|
|
545
545
|
}) : null);
|
|
@@ -21,10 +21,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
import React from 'react';
|
|
24
|
-
import { connect } from 'react-redux';
|
|
25
|
-
import DOMPurify from 'dompurify';
|
|
26
24
|
import PropTypes from 'prop-types';
|
|
27
|
-
import { setActiveServiceInfo } from '../actions/serviceinfo';
|
|
28
25
|
import ResizeableWindow from '../components/ResizeableWindow';
|
|
29
26
|
import LocaleUtils from '../utils/LocaleUtils';
|
|
30
27
|
import MiscUtils from '../utils/MiscUtils';
|
|
@@ -42,15 +39,12 @@ var ServiceInfoWindow = /*#__PURE__*/function (_React$Component) {
|
|
|
42
39
|
if (content) {
|
|
43
40
|
return /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, title, ":"), html ? /*#__PURE__*/React.createElement("td", {
|
|
44
41
|
dangerouslySetInnerHTML: {
|
|
45
|
-
__html: MiscUtils.addLinkAnchors(
|
|
42
|
+
__html: MiscUtils.addLinkAnchors(MiscUtils.sanitizeHtml(content))
|
|
46
43
|
}
|
|
47
44
|
}) : /*#__PURE__*/React.createElement("td", null, content));
|
|
48
45
|
}
|
|
49
46
|
return null;
|
|
50
47
|
});
|
|
51
|
-
_defineProperty(_this, "onClose", function () {
|
|
52
|
-
_this.props.setActiveServiceInfo(null);
|
|
53
|
-
});
|
|
54
48
|
return _this;
|
|
55
49
|
}
|
|
56
50
|
_inherits(ServiceInfoWindow, _React$Component);
|
|
@@ -82,7 +76,7 @@ var ServiceInfoWindow = /*#__PURE__*/function (_React$Component) {
|
|
|
82
76
|
initialX: this.props.layerInfoGeometry.initialX,
|
|
83
77
|
initialY: this.props.layerInfoGeometry.initialY,
|
|
84
78
|
initiallyDocked: this.props.layerInfoGeometry.initiallyDocked,
|
|
85
|
-
onClose: this.onClose,
|
|
79
|
+
onClose: this.props.onClose,
|
|
86
80
|
title: LocaleUtils.tr("serviceinfo.title")
|
|
87
81
|
}, /*#__PURE__*/React.createElement("div", {
|
|
88
82
|
className: "service-info-window-body"
|
|
@@ -98,14 +92,7 @@ var ServiceInfoWindow = /*#__PURE__*/function (_React$Component) {
|
|
|
98
92
|
}(React.Component);
|
|
99
93
|
_defineProperty(ServiceInfoWindow, "propTypes", {
|
|
100
94
|
layerInfoGeometry: PropTypes.object,
|
|
101
|
-
|
|
102
|
-
|
|
95
|
+
onClose: PropTypes.func,
|
|
96
|
+
service: PropTypes.object
|
|
103
97
|
});
|
|
104
|
-
|
|
105
|
-
return {
|
|
106
|
-
service: state.serviceinfo.service
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
export default connect(selector, {
|
|
110
|
-
setActiveServiceInfo: setActiveServiceInfo
|
|
111
|
-
})(ServiceInfoWindow);
|
|
98
|
+
export default ServiceInfoWindow;
|
package/components/ThemeList.js
CHANGED
|
@@ -29,7 +29,6 @@ import React from 'react';
|
|
|
29
29
|
import { connect } from 'react-redux';
|
|
30
30
|
import axios from 'axios';
|
|
31
31
|
import { remove as removeDiacritics } from 'diacritics';
|
|
32
|
-
import DOMPurify from 'dompurify';
|
|
33
32
|
import isEmpty from 'lodash.isempty';
|
|
34
33
|
import PropTypes from 'prop-types';
|
|
35
34
|
import { setActiveLayerInfo } from '../actions/layerinfo';
|
|
@@ -180,7 +179,7 @@ var ThemeList = /*#__PURE__*/function (_React$Component) {
|
|
|
180
179
|
}, item.description ? /*#__PURE__*/React.createElement("div", {
|
|
181
180
|
className: "theme-item-description",
|
|
182
181
|
dangerouslySetInnerHTML: {
|
|
183
|
-
__html:
|
|
182
|
+
__html: MiscUtils.sanitizeHtml(item.description)
|
|
184
183
|
}
|
|
185
184
|
}) : null, /*#__PURE__*/React.createElement("img", {
|
|
186
185
|
className: "theme-item-thumbnail",
|
|
@@ -148,6 +148,8 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
148
148
|
zoomToObject: function zoomToObject(objectId) {},
|
|
149
149
|
objectIsVisible: function objectIsVisible(objectId) {},
|
|
150
150
|
objectContainsPoints: function objectContainsPoints(object) {},
|
|
151
|
+
addObjectAddedListener: function addObjectAddedListener(callback) {},
|
|
152
|
+
removeObjectAddedListener: function removeObjectAddedListener(callback) {},
|
|
151
153
|
getMap: function getMap() {},
|
|
152
154
|
computeBoundsTree: function computeBoundsTree(object) {},
|
|
153
155
|
setViewToExtent: function setViewToExtent(bounds, angle) {},
|
|
@@ -384,6 +386,7 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
384
386
|
}
|
|
385
387
|
_this2.computeBoundsTree(scene);
|
|
386
388
|
_this2.instance.notifyChange(tiles);
|
|
389
|
+
_this2.notifyObjectAdded(scene);
|
|
387
390
|
});
|
|
388
391
|
// Show/hide labels when tile visibility changes
|
|
389
392
|
tiles.tiles.addEventListener('tile-visibility-change', function (_ref3) {
|
|
@@ -394,6 +397,9 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
394
397
|
l.labelObject.visible = visible;
|
|
395
398
|
l.labelObject.element.style.display = visible ? 'initial' : 'none';
|
|
396
399
|
});
|
|
400
|
+
if (visible) {
|
|
401
|
+
_this2.notifyObjectAdded(scene);
|
|
402
|
+
}
|
|
397
403
|
});
|
|
398
404
|
tiles.castShadow = true;
|
|
399
405
|
tiles.receiveShadow = true;
|
|
@@ -473,6 +479,7 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
473
479
|
});
|
|
474
480
|
} else {
|
|
475
481
|
_this2.sceneObjectGroup.add(object);
|
|
482
|
+
_this2.notifyObjectAdded(object);
|
|
476
483
|
callback === null || callback === void 0 || callback();
|
|
477
484
|
}
|
|
478
485
|
_this2.objectMap[objectId] = object;
|
|
@@ -583,7 +590,7 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
583
590
|
var changed = false;
|
|
584
591
|
if (options.visibility !== prevOptions.visibility || options.opacity !== (prevOptions === null || prevOptions === void 0 ? void 0 : prevOptions.opacity)) {
|
|
585
592
|
var _objectTree$options$p2;
|
|
586
|
-
//
|
|
593
|
+
// Visible if object is visible and parents also
|
|
587
594
|
var isVisible = options.opacity > 0 && options.visibility;
|
|
588
595
|
for (var curId = options.parent; isVisible && curId !== undefined; curId = objectTree[curId].parent) {
|
|
589
596
|
isVisible && (isVisible = objectTree[curId].visibility);
|
|
@@ -647,6 +654,11 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
647
654
|
}
|
|
648
655
|
});
|
|
649
656
|
});
|
|
657
|
+
_defineProperty(_this2, "notifyObjectAdded", function (obj) {
|
|
658
|
+
_this2.objectAddedListeners.forEach(function (listener) {
|
|
659
|
+
return listener(obj);
|
|
660
|
+
});
|
|
661
|
+
});
|
|
650
662
|
_defineProperty(_this2, "loadTilesetStyle", function (objectId, url) {
|
|
651
663
|
var applyTilesetStyle = function applyTilesetStyle(styleurl) {
|
|
652
664
|
var tiles3d = _this2.objectMap[objectId];
|
|
@@ -690,7 +702,7 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
690
702
|
var objectTree = _this2.state.sceneContext.objectTree;
|
|
691
703
|
var options = objectTree[objectId];
|
|
692
704
|
var isVisible = options.opacity > 0 && options.visibility;
|
|
693
|
-
for (var curId = options.parent; isVisible && curId !== undefined; curId = objectTree[curId].parent) {
|
|
705
|
+
for (var curId = options.parent; isVisible && curId !== undefined && objectTree[curId]; curId = objectTree[curId].parent) {
|
|
694
706
|
isVisible && (isVisible = objectTree[curId].visibility);
|
|
695
707
|
}
|
|
696
708
|
return isVisible;
|
|
@@ -1302,6 +1314,7 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
1302
1314
|
_this2.sceneObjectGroup = null;
|
|
1303
1315
|
_this2.objectMap = {};
|
|
1304
1316
|
_this2.tilesetStyles = {};
|
|
1317
|
+
_this2.objectAddedListeners = [];
|
|
1305
1318
|
_this2.state.sceneContext.eventDispatcher = new EventDispatcher();
|
|
1306
1319
|
_this2.state.sceneContext.addLayer = _this2.addLayer;
|
|
1307
1320
|
_this2.state.sceneContext.getLayer = _this2.getLayer;
|
|
@@ -1314,6 +1327,14 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
|
|
|
1314
1327
|
_this2.state.sceneContext.getSceneObject = _this2.getSceneObject;
|
|
1315
1328
|
_this2.state.sceneContext.removeSceneObject = _this2.removeSceneObject;
|
|
1316
1329
|
_this2.state.sceneContext.updateSceneObject = _this2.updateSceneObject;
|
|
1330
|
+
_this2.state.sceneContext.addObjectAddedListener = function (callback) {
|
|
1331
|
+
return _this2.objectAddedListeners.push(callback);
|
|
1332
|
+
};
|
|
1333
|
+
_this2.state.sceneContext.removeObjectAddedListener = function (callback) {
|
|
1334
|
+
_this2.objectAddedListeners = _this2.objectAddedListeners.filter(function (cb) {
|
|
1335
|
+
return cb !== callback;
|
|
1336
|
+
});
|
|
1337
|
+
};
|
|
1317
1338
|
_this2.state.sceneContext.zoomToObject = _this2.zoomToObject;
|
|
1318
1339
|
_this2.state.sceneContext.objectIsVisible = _this2.objectIsVisible;
|
|
1319
1340
|
_this2.state.sceneContext.objectContainsPoints = _this2.objectContainsPoints;
|
|
@@ -79,12 +79,13 @@ var OrbitControls3D = /*#__PURE__*/function (_MapControls) {
|
|
|
79
79
|
key: "disconnect",
|
|
80
80
|
value: function disconnect() {
|
|
81
81
|
this.animationId = null;
|
|
82
|
-
_superPropGet(OrbitControls3D, "disconnect", this, 3)([]);
|
|
83
82
|
this.enabled = false;
|
|
84
83
|
this.sceneContext.scene.view.setControls(null);
|
|
85
84
|
this.domElement.removeEventListener('pointerdown', this.stopAnimations);
|
|
86
85
|
this.domElement.removeEventListener('wheel', this.stopAnimations);
|
|
87
86
|
this.removeEventListener('change', this.updateControlsTarget);
|
|
87
|
+
_superPropGet(OrbitControls3D, "disconnect", this, 3)([]);
|
|
88
|
+
this.domElement = null;
|
|
88
89
|
}
|
|
89
90
|
}, {
|
|
90
91
|
key: "setView",
|
|
@@ -16,6 +16,16 @@ div.resizeable-window-portal-container > div {
|
|
|
16
16
|
height: 100%;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
div.resizeable-window-portal-container-detached {
|
|
20
|
+
position: fixed;
|
|
21
|
+
left: 0;
|
|
22
|
+
right: 0;
|
|
23
|
+
bottom: 0;
|
|
24
|
+
top: 2.5em;
|
|
25
|
+
padding: 0.25em;
|
|
26
|
+
background-color: var(--container-bg-color);
|
|
27
|
+
}
|
|
28
|
+
|
|
19
29
|
div.resizeable-window-contents {
|
|
20
30
|
display: flex;
|
|
21
31
|
flex-direction: column;
|
|
@@ -29,6 +29,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
29
29
|
import { ColorPicker } from '@vtaits/react-color-picker';
|
|
30
30
|
import '@vtaits/react-color-picker/index.css';
|
|
31
31
|
import React from 'react';
|
|
32
|
+
import ReactDOM from 'react-dom';
|
|
32
33
|
import PropTypes from 'prop-types';
|
|
33
34
|
import MiscUtils from '../../utils/MiscUtils';
|
|
34
35
|
import './style/ColorButton.css';
|
|
@@ -41,26 +42,36 @@ var ColorButton = /*#__PURE__*/function (_React$Component) {
|
|
|
41
42
|
_classCallCheck(this, ColorButton);
|
|
42
43
|
_this = _callSuper(this, ColorButton, [props]);
|
|
43
44
|
_defineProperty(_this, "state", {
|
|
44
|
-
colors: defaultColors
|
|
45
|
+
colors: defaultColors,
|
|
46
|
+
pickerPos: null,
|
|
47
|
+
hexStr: null
|
|
45
48
|
});
|
|
46
49
|
_defineProperty(_this, "togglePicker", function (ev) {
|
|
47
|
-
if (
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
if (_this.menuContainer) {
|
|
51
|
+
// Should not happen...
|
|
52
|
+
_this.menuContainer.parentElement.removeChild(_this.menuContainer);
|
|
53
|
+
_this.menuContainer = null;
|
|
51
54
|
}
|
|
52
|
-
ev.
|
|
53
|
-
_this.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
_this.menuContainer = ev.view.document.createElement("div");
|
|
56
|
+
_this.menuContainer.className = "colorbutton-picker-container";
|
|
57
|
+
ev.view.document.body.appendChild(_this.menuContainer);
|
|
58
|
+
_this.menuContainer.addEventListener('click', function (ev2) {
|
|
59
|
+
if (ev2.currentTarget === ev2.target) {
|
|
60
|
+
_this.setState({
|
|
61
|
+
pickerPos: null,
|
|
62
|
+
hexStr: null
|
|
63
|
+
}, function () {
|
|
64
|
+
_this.menuContainer.parentElement.removeChild(_this.menuContainer);
|
|
65
|
+
_this.menuContainer = null;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
58
68
|
});
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
69
|
+
var rect = ev.currentTarget.getBoundingClientRect();
|
|
70
|
+
_this.setState({
|
|
71
|
+
hexStr: null,
|
|
72
|
+
pickerPos: [rect.left + 0.5 * rect.width, rect.bottom]
|
|
73
|
+
});
|
|
74
|
+
ev.stopPropagation();
|
|
64
75
|
});
|
|
65
76
|
_defineProperty(_this, "selectColor", function (idx) {
|
|
66
77
|
_this.setState({
|
|
@@ -99,11 +110,7 @@ var ColorButton = /*#__PURE__*/function (_React$Component) {
|
|
|
99
110
|
var newColor = [].concat(_toConsumableArray(_this.props.color.slice(0, 3)), [parseFloat(alpha)]);
|
|
100
111
|
_this.props.onColorChanged(newColor);
|
|
101
112
|
});
|
|
102
|
-
_this.
|
|
103
|
-
pickerVisible: false,
|
|
104
|
-
hexStr: null
|
|
105
|
-
};
|
|
106
|
-
_this.pickerEl = null;
|
|
113
|
+
_this.menuContainer = null;
|
|
107
114
|
_this.state.colors = props.defaultColors;
|
|
108
115
|
return _this;
|
|
109
116
|
}
|
|
@@ -112,10 +119,13 @@ var ColorButton = /*#__PURE__*/function (_React$Component) {
|
|
|
112
119
|
key: "render",
|
|
113
120
|
value: function render() {
|
|
114
121
|
var _this2 = this;
|
|
115
|
-
var pickerStyle = {
|
|
116
|
-
visibility: this.state.pickerVisible ? 'visible' : 'hidden'
|
|
117
|
-
};
|
|
118
122
|
var curColor = this.props.color;
|
|
123
|
+
var pickerStyle = function pickerStyle() {
|
|
124
|
+
return {
|
|
125
|
+
left: "calc(".concat(_this2.state.pickerPos[0], "px - 6.5em)"),
|
|
126
|
+
top: "calc(".concat(_this2.state.pickerPos[1], "px + 0.7em)")
|
|
127
|
+
};
|
|
128
|
+
};
|
|
119
129
|
return /*#__PURE__*/React.createElement("div", {
|
|
120
130
|
className: "ColorButton"
|
|
121
131
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -127,12 +137,9 @@ var ColorButton = /*#__PURE__*/function (_React$Component) {
|
|
|
127
137
|
style: {
|
|
128
138
|
backgroundColor: this.cssColor(curColor)
|
|
129
139
|
}
|
|
130
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
140
|
+
})), this.state.pickerPos ? /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/React.createElement("div", {
|
|
131
141
|
className: "colorbutton-picker",
|
|
132
|
-
|
|
133
|
-
_this2.pickerEl = el;
|
|
134
|
-
},
|
|
135
|
-
style: pickerStyle
|
|
142
|
+
style: pickerStyle()
|
|
136
143
|
}, /*#__PURE__*/React.createElement("div", {
|
|
137
144
|
className: "colorbutton-picker-icons"
|
|
138
145
|
}, this.state.colors.map(function (color, idx) {
|
|
@@ -156,6 +163,7 @@ var ColorButton = /*#__PURE__*/function (_React$Component) {
|
|
|
156
163
|
className: "colorbutton-picker-spectrum",
|
|
157
164
|
onDrag: this.changeColor,
|
|
158
165
|
saturationHeight: 150,
|
|
166
|
+
saturationWidth: null,
|
|
159
167
|
value: this.cssColorRGB(curColor)
|
|
160
168
|
}), /*#__PURE__*/React.createElement("div", {
|
|
161
169
|
className: "colorbutton-picker-input controlgroup"
|
|
@@ -182,7 +190,7 @@ var ColorButton = /*#__PURE__*/function (_React$Component) {
|
|
|
182
190
|
step: "0.1",
|
|
183
191
|
type: "range",
|
|
184
192
|
value: curColor[3]
|
|
185
|
-
}))) : null)));
|
|
193
|
+
}))) : null)), this.menuContainer) : null);
|
|
186
194
|
}
|
|
187
195
|
}, {
|
|
188
196
|
key: "cssColor",
|
|
@@ -45,10 +45,10 @@ var LayerCatalogWidget = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
45
45
|
filteredCatalog: null,
|
|
46
46
|
filter: ""
|
|
47
47
|
});
|
|
48
|
-
_defineProperty(_this, "entryClicked", function (entry, path) {
|
|
48
|
+
_defineProperty(_this, "entryClicked", function (entry, path, asGroup) {
|
|
49
49
|
if (entry.type || entry.resource) {
|
|
50
50
|
var _entry$resource;
|
|
51
|
-
if (
|
|
51
|
+
if (asGroup === true && ((_entry$resource = entry.resource) !== null && _entry$resource !== void 0 ? _entry$resource : entry.type).startsWith("wms")) {
|
|
52
52
|
if (!isEmpty(entry.sublayers) && entry.resource) {
|
|
53
53
|
_this.checkAddGroup(entry);
|
|
54
54
|
} else {
|
|
@@ -165,7 +165,7 @@ var LayerCatalogWidget = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
165
165
|
var groupUrl = stripQuery(resource.url);
|
|
166
166
|
var _collectSublayers = function collectSublayers(entry) {
|
|
167
167
|
var _entry$resource2;
|
|
168
|
-
var entryParams = LayerUtils.splitLayerUrlParam((_entry$resource2 = entry.resource) !== null && _entry$resource2 !== void 0 ? _entry$resource2 : "");
|
|
168
|
+
var entryParams = LayerUtils.splitLayerUrlParam((_entry$resource2 = entry.resource) !== null && _entry$resource2 !== void 0 ? _entry$resource2 : "", true);
|
|
169
169
|
if (isEmpty(entry.sublayers) && stripQuery(entryParams.url) === groupUrl) {
|
|
170
170
|
sublayers[entryParams.name] = entryParams;
|
|
171
171
|
}
|
|
@@ -219,7 +219,12 @@ var LayerCatalogWidget = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
219
219
|
var _filterSublayers = function filterSublayers(sublayers) {
|
|
220
220
|
return sublayers.map(function (sublayer) {
|
|
221
221
|
if (sublayer.name in sublayerSubset) {
|
|
222
|
-
|
|
222
|
+
var _sublayerSubset$subla, _sublayerSubset$subla2;
|
|
223
|
+
return _objectSpread(_objectSpread(_objectSpread({}, sublayer), sublayerSubset[sublayer.name]), {}, {
|
|
224
|
+
visibility: sublayer.visibility,
|
|
225
|
+
opacity: (_sublayerSubset$subla = sublayerSubset[sublayer.name].opacity) !== null && _sublayerSubset$subla !== void 0 ? _sublayerSubset$subla : sublayer.opacity,
|
|
226
|
+
style: (_sublayerSubset$subla2 = sublayerSubset[sublayer.name].style) !== null && _sublayerSubset$subla2 !== void 0 ? _sublayerSubset$subla2 : sublayer.style
|
|
227
|
+
});
|
|
223
228
|
} else if (sublayer.sublayers) {
|
|
224
229
|
return _objectSpread(_objectSpread({}, sublayer), {}, {
|
|
225
230
|
sublayers: _filterSublayers(sublayer.sublayers)
|
|
@@ -280,6 +285,7 @@ var LayerCatalogWidget = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
280
285
|
key: "renderCatalogEntry",
|
|
281
286
|
value: function renderCatalogEntry(entry, path) {
|
|
282
287
|
var _this2 = this,
|
|
288
|
+
_entry$asGroup,
|
|
283
289
|
_ref2,
|
|
284
290
|
_entry$resource3;
|
|
285
291
|
var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
@@ -291,6 +297,7 @@ var LayerCatalogWidget = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
291
297
|
var type = entry.resource ? entry.resource.slice(0, entry.resource.indexOf(":")) : entry.type;
|
|
292
298
|
var key = (entry.resource || entry.type + ":" + entry.name) + ":" + idx;
|
|
293
299
|
var indentSize = !this.props.levelBasedIndentSize && level > 0 ? 1.5 : level;
|
|
300
|
+
var asGroup = (_entry$asGroup = entry.asGroup) !== null && _entry$asGroup !== void 0 ? _entry$asGroup : this.props.defaultAsGroupValue;
|
|
294
301
|
return /*#__PURE__*/React.createElement("div", {
|
|
295
302
|
key: key,
|
|
296
303
|
style: {
|
|
@@ -308,13 +315,13 @@ var LayerCatalogWidget = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
308
315
|
}), /*#__PURE__*/React.createElement("span", {
|
|
309
316
|
className: "layer-catalog-widget-entry-contents",
|
|
310
317
|
onClick: function onClick() {
|
|
311
|
-
return _this2.entryClicked(entry, path);
|
|
318
|
+
return _this2.entryClicked(entry, path, asGroup);
|
|
312
319
|
},
|
|
313
320
|
onKeyDown: MiscUtils.checkKeyActivate,
|
|
314
321
|
tabIndex: 0
|
|
315
322
|
}, type ? /*#__PURE__*/React.createElement("span", {
|
|
316
323
|
className: "layer-catalog-widget-entry-service"
|
|
317
|
-
}, type) : null, entry.title), (hasSublayers && !
|
|
324
|
+
}, type) : null, entry.title), (hasSublayers && !asGroup || asGroup === "option") && ((_ref2 = (_entry$resource3 = entry.resource) !== null && _entry$resource3 !== void 0 ? _entry$resource3 : entry.type) !== null && _ref2 !== void 0 ? _ref2 : "").startsWith("wms") ? /*#__PURE__*/React.createElement(Icon, {
|
|
318
325
|
icon: "group",
|
|
319
326
|
onClick: function onClick() {
|
|
320
327
|
return hasSublayers && entry.resource ? _this2.checkAddGroup(entry) : _this2.checkAddServiceLayer(entry, true);
|
|
@@ -379,6 +386,7 @@ _defineProperty(LayerCatalogWidget, "propTypes", {
|
|
|
379
386
|
addLayer: PropTypes.func,
|
|
380
387
|
catalog: PropTypes.array,
|
|
381
388
|
closeWindow: PropTypes.func,
|
|
389
|
+
defaultAsGroupValue: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
382
390
|
layers: PropTypes.array,
|
|
383
391
|
levelBasedIndentSize: PropTypes.bool,
|
|
384
392
|
mapCrs: PropTypes.string,
|
|
@@ -24,7 +24,6 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
24
24
|
|
|
25
25
|
import React from 'react';
|
|
26
26
|
import classNames from 'classnames';
|
|
27
|
-
import DOMPurify from 'dompurify';
|
|
28
27
|
import PropTypes from 'prop-types';
|
|
29
28
|
import { v4 as uuidv4 } from 'uuid';
|
|
30
29
|
import LocaleUtils from '../../utils/LocaleUtils';
|
|
@@ -47,7 +46,7 @@ var TextInput = /*#__PURE__*/function (_React$Component) {
|
|
|
47
46
|
});
|
|
48
47
|
_defineProperty(_this, "setDefaultValue", function (value, valueRev, prevValueRef) {
|
|
49
48
|
if (valueRev > prevValueRef) {
|
|
50
|
-
_this.input.innerHTML =
|
|
49
|
+
_this.input.innerHTML = MiscUtils.sanitizeHtml((value || "").replaceAll('\n', _this.props.multiline ? '<br />' : ''));
|
|
51
50
|
}
|
|
52
51
|
});
|
|
53
52
|
_defineProperty(_this, "storeRef", function (el) {
|
|
@@ -87,7 +86,7 @@ var TextInput = /*#__PURE__*/function (_React$Component) {
|
|
|
87
86
|
_this.input.innerHTML = clearValue;
|
|
88
87
|
});
|
|
89
88
|
_defineProperty(_this, "onChange", function (ev) {
|
|
90
|
-
var curValue =
|
|
89
|
+
var curValue = MiscUtils.sanitizeHtml(ev.target.innerText.replace(/<br\s*\/?>$/, '').replace(/\n$/, ''));
|
|
91
90
|
if (!_this.props.multiline) {
|
|
92
91
|
curValue = curValue.replace('\n', '');
|
|
93
92
|
}
|
|
@@ -122,7 +121,7 @@ var TextInput = /*#__PURE__*/function (_React$Component) {
|
|
|
122
121
|
});
|
|
123
122
|
_defineProperty(_this, "onMouseDown", function (ev) {
|
|
124
123
|
var el = document.elementFromPoint(ev.clientX, ev.clientY);
|
|
125
|
-
if ((el === null || el === void 0 ? void 0 : el.nodeName) === 'A' && ev.ctrlKey) {
|
|
124
|
+
if ((el === null || el === void 0 ? void 0 : el.nodeName) === 'A' && (_this.props.readOnly || _this.props.disabled || ev.ctrlKey)) {
|
|
126
125
|
window.open(el.href, el.target);
|
|
127
126
|
}
|
|
128
127
|
});
|
|
@@ -312,7 +311,7 @@ var TextInput = /*#__PURE__*/function (_React$Component) {
|
|
|
312
311
|
return {
|
|
313
312
|
value: nextProps.value,
|
|
314
313
|
valueRev: state.valueRev + 1,
|
|
315
|
-
curValue:
|
|
314
|
+
curValue: MiscUtils.sanitizeHtml(nextProps.value || ""),
|
|
316
315
|
changed: false
|
|
317
316
|
};
|
|
318
317
|
}
|
|
@@ -21,11 +21,16 @@ div.colorbutton-icon > span {
|
|
|
21
21
|
display: inline-block;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
div.colorbutton-picker-container {
|
|
25
|
+
position: fixed;
|
|
26
|
+
left: 0;
|
|
27
|
+
right: 0;
|
|
28
|
+
top: 0;
|
|
29
|
+
bottom: 0;
|
|
30
|
+
z-index: 10000;
|
|
31
|
+
}
|
|
24
32
|
div.colorbutton-picker {
|
|
25
|
-
visibility: hidden;
|
|
26
33
|
position: absolute;
|
|
27
|
-
left: -5.5em;
|
|
28
|
-
top: 2.75em;
|
|
29
34
|
background-color: white;
|
|
30
35
|
box-shadow: 0px 0px 5px rgba(136, 136, 136, 1);
|
|
31
36
|
border-radius: 0.25em;
|
|
@@ -91,8 +96,14 @@ div.colorbutton-picker-spectrum {
|
|
|
91
96
|
display: flex;
|
|
92
97
|
height: 150px;
|
|
93
98
|
margin: 0 0.25em;
|
|
99
|
+
gap: 0.25em;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
div.colorbutton-picker-spectrum > div.react-color-picker__saturation-spectrum {
|
|
103
|
+
flex: 1 1 auto;
|
|
94
104
|
}
|
|
95
105
|
|
|
96
106
|
div.colorbutton-picker-spectrum > div.react-color-picker__hue-spectrum {
|
|
97
|
-
margin-left: 0
|
|
107
|
+
margin-left: 0!important;
|
|
108
|
+
flex: 0 0 2em;
|
|
98
109
|
}
|
package/package.json
CHANGED
package/plugins/FeatureForm.js
CHANGED
|
@@ -203,8 +203,7 @@ var FeatureForm = /*#__PURE__*/function (_React$Component) {
|
|
|
203
203
|
} else if (this.props.theme !== prevProps.theme || !this.props.enabled && prevProps.enabled) {
|
|
204
204
|
this.clearResults();
|
|
205
205
|
}
|
|
206
|
-
|
|
207
|
-
if (this.props.enabled && this.state.pendingRequests === 0 && isAllowedContext && !this.props.editContext.changed) {
|
|
206
|
+
if (this.props.enabled && this.state.pendingRequests === 0 && !this.props.editContext.changed) {
|
|
208
207
|
var clickPoint = this.queryPoint(prevProps);
|
|
209
208
|
if (clickPoint) {
|
|
210
209
|
this.queryFeatures(clickPoint);
|
package/plugins/HeightProfile.js
CHANGED
|
@@ -163,6 +163,10 @@ var HeightProfilePrintDialog_ = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
163
163
|
HIGHLIGHT_LABELSIZE: highlightParams.labelSizes.join(";"),
|
|
164
164
|
HIGHLIGHT_LABEL_DISTANCE: highlightParams.labelDist.join(";"),
|
|
165
165
|
HIGHLIGHT_LABEL_ROTATION: highlightParams.labelRotations.join(";"),
|
|
166
|
+
HIGHLIGHT_LABELFRAMEBACKGROUNDCOLOR: highlightParams.labelFrameColors.join(";"),
|
|
167
|
+
HIGHLIGHT_LABELFRAMEOUTLINECOLOR: highlightParams.labelFrameOutlines.join(";"),
|
|
168
|
+
HIGHLIGHT_LABELFRAMESIZE: highlightParams.labelFrameSizes.join(";"),
|
|
169
|
+
HIGHLIGHT_LABELFRAMEOUTLINEWIDTH: highlightParams.labelFrameOutlineWidths.join(";"),
|
|
166
170
|
csrf_token: MiscUtils.getCsrfToken()
|
|
167
171
|
}, exportParams);
|
|
168
172
|
var baseUrl = _this.props.theme.url.split("?")[0];
|