qwc2 2025.12.17 → 2025.12.18
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/AttributeForm.js +8 -8
- package/components/AttributeTableWidget.js +3 -3
- package/components/EditComboField.js +1 -1
- package/components/EditUploadField.js +1 -1
- package/components/IdentifyViewer.js +3 -4
- package/components/LinkFeatureForm.js +21 -4
- package/components/MeasureSwitcher.js +115 -0
- package/components/PluginsContainer.js +3 -2
- package/components/QtDesignerForm.js +2 -2
- package/components/ResizeableWindow.js +1 -1
- package/components/SearchBox.js +7 -7
- package/components/map3d/drawtool/EditTool3D.js +1 -1
- package/components/style/IdentifyViewer.css +1 -1
- package/components/style/LocationRecorder.css +1 -6
- package/components/style/PluginsContainer.css +11 -6
- package/components/timeline/FixedTimeline.js +2 -2
- package/components/timeline/InfiniteTimeline.js +2 -2
- package/components/timeline/TimelineFeaturesSlider.js +1 -1
- package/components/widgets/LayerCatalogWidget.js +1 -1
- package/package.json +1 -1
- package/plugins/Editing.js +20 -5
- package/plugins/FeatureForm.js +1 -1
- package/plugins/FeatureSearch.js +3 -3
- package/plugins/GeometryDigitizer.js +32 -18
- package/plugins/Identify.js +1 -4
- package/plugins/MapExport.js +4 -4
- package/plugins/MapFilter.js +10 -10
- package/plugins/NewsPopup.js +1 -1
- package/plugins/ObliqueView.js +88 -17
- package/plugins/Print.js +7 -7
- package/plugins/Redlining.js +25 -73
- package/plugins/Reports.js +3 -3
- package/plugins/Routing.js +4 -4
- package/plugins/ValueTool.js +1 -1
- package/plugins/View3D.js +2 -2
- package/plugins/ZoomButtons.js +1 -1
- package/plugins/map/EditingSupport.js +50 -20
- package/plugins/map/RedliningSupport.js +2 -2
- package/plugins/map/SnapSupport.js +12 -10
- package/plugins/map/style/SnappingSupport.css +1 -8
- package/plugins/map3d/Draw3D.js +2 -2
- package/plugins/map3d/ExportObjects3D.js +2 -2
- package/plugins/map3d/MapExport3D.js +4 -4
- package/reducers/editing.js +6 -1
- package/static/translations/bg-BG.json +39 -74
- package/static/translations/ca-ES.json +39 -74
- package/static/translations/cs-CZ.json +39 -74
- package/static/translations/de-CH.json +39 -74
- package/static/translations/de-DE.json +39 -74
- package/static/translations/en-US.json +39 -74
- package/static/translations/es-ES.json +39 -74
- package/static/translations/fi-FI.json +39 -74
- package/static/translations/fr-FR.json +39 -74
- package/static/translations/hu-HU.json +39 -74
- package/static/translations/it-IT.json +39 -74
- package/static/translations/ja-JP.json +39 -74
- package/static/translations/nl-NL.json +39 -74
- package/static/translations/no-NO.json +39 -74
- package/static/translations/pl-PL.json +39 -74
- package/static/translations/pt-BR.json +39 -74
- package/static/translations/pt-PT.json +39 -74
- package/static/translations/ro-RO.json +39 -74
- package/static/translations/ru-RU.json +39 -74
- package/static/translations/sv-SE.json +39 -74
- package/static/translations/tr-TR.json +39 -74
- package/static/translations/tsconfig.json +30 -67
- package/static/translations/uk-UA.json +39 -74
- package/utils/FeatureStyles.js +13 -18
- package/utils/IdentifyUtils.js +14 -11
- package/utils/SearchProviders.js +1 -1
package/plugins/Redlining.js
CHANGED
|
@@ -39,6 +39,7 @@ import { LayerRole, addLayer } from '../actions/layers';
|
|
|
39
39
|
import { setSnappingConfig } from '../actions/map';
|
|
40
40
|
import { changeRedliningState, resetRedliningState } from '../actions/redlining';
|
|
41
41
|
import Icon from '../components/Icon';
|
|
42
|
+
import MeasureSwitcher from '../components/MeasureSwitcher';
|
|
42
43
|
import TaskBar from '../components/TaskBar';
|
|
43
44
|
import ButtonBar from '../components/widgets/ButtonBar';
|
|
44
45
|
import ColorButton from '../components/widgets/ColorButton';
|
|
@@ -114,7 +115,7 @@ var Redlining = /*#__PURE__*/function (_React$Component) {
|
|
|
114
115
|
var activeButton = _this.props.redlining.action === "Draw" ? _this.props.redlining.geomType : _this.props.redlining.action;
|
|
115
116
|
var drawButtons = [{
|
|
116
117
|
key: "Point",
|
|
117
|
-
tooltip: LocaleUtils.tr("
|
|
118
|
+
tooltip: LocaleUtils.tr("common.point"),
|
|
118
119
|
icon: "point",
|
|
119
120
|
data: {
|
|
120
121
|
action: "Draw",
|
|
@@ -123,7 +124,7 @@ var Redlining = /*#__PURE__*/function (_React$Component) {
|
|
|
123
124
|
}
|
|
124
125
|
}, {
|
|
125
126
|
key: "LineString",
|
|
126
|
-
tooltip: LocaleUtils.tr("
|
|
127
|
+
tooltip: LocaleUtils.tr("common.line"),
|
|
127
128
|
icon: "line",
|
|
128
129
|
data: {
|
|
129
130
|
action: "Draw",
|
|
@@ -132,7 +133,7 @@ var Redlining = /*#__PURE__*/function (_React$Component) {
|
|
|
132
133
|
}
|
|
133
134
|
}, [{
|
|
134
135
|
key: "Polygon",
|
|
135
|
-
tooltip: LocaleUtils.tr("
|
|
136
|
+
tooltip: LocaleUtils.tr("common.polygon"),
|
|
136
137
|
icon: "polygon",
|
|
137
138
|
data: {
|
|
138
139
|
action: "Draw",
|
|
@@ -141,7 +142,7 @@ var Redlining = /*#__PURE__*/function (_React$Component) {
|
|
|
141
142
|
}
|
|
142
143
|
}, toolEnabled("Circle") ? {
|
|
143
144
|
key: "Circle",
|
|
144
|
-
tooltip: LocaleUtils.tr("
|
|
145
|
+
tooltip: LocaleUtils.tr("common.circle"),
|
|
145
146
|
icon: "circle",
|
|
146
147
|
data: {
|
|
147
148
|
action: "Draw",
|
|
@@ -150,7 +151,7 @@ var Redlining = /*#__PURE__*/function (_React$Component) {
|
|
|
150
151
|
}
|
|
151
152
|
} : null, toolEnabled("Ellipse") ? {
|
|
152
153
|
key: "Ellipse",
|
|
153
|
-
tooltip: LocaleUtils.tr("
|
|
154
|
+
tooltip: LocaleUtils.tr("common.ellipse"),
|
|
154
155
|
icon: "ellipse",
|
|
155
156
|
data: {
|
|
156
157
|
action: "Draw",
|
|
@@ -159,7 +160,7 @@ var Redlining = /*#__PURE__*/function (_React$Component) {
|
|
|
159
160
|
}
|
|
160
161
|
} : null, toolEnabled("Square") ? {
|
|
161
162
|
key: "Square",
|
|
162
|
-
tooltip: LocaleUtils.tr("
|
|
163
|
+
tooltip: LocaleUtils.tr("common.square"),
|
|
163
164
|
icon: "box",
|
|
164
165
|
data: {
|
|
165
166
|
action: "Draw",
|
|
@@ -168,7 +169,7 @@ var Redlining = /*#__PURE__*/function (_React$Component) {
|
|
|
168
169
|
}
|
|
169
170
|
} : null, toolEnabled("Box") ? {
|
|
170
171
|
key: "Box",
|
|
171
|
-
tooltip: LocaleUtils.tr("
|
|
172
|
+
tooltip: LocaleUtils.tr("common.rectangle"),
|
|
172
173
|
icon: "rect",
|
|
173
174
|
data: {
|
|
174
175
|
action: "Draw",
|
|
@@ -177,7 +178,7 @@ var Redlining = /*#__PURE__*/function (_React$Component) {
|
|
|
177
178
|
}
|
|
178
179
|
} : null].filter(Boolean), {
|
|
179
180
|
key: "Text",
|
|
180
|
-
tooltip: LocaleUtils.tr("
|
|
181
|
+
tooltip: LocaleUtils.tr("common.text"),
|
|
181
182
|
icon: "text",
|
|
182
183
|
data: {
|
|
183
184
|
action: "Draw",
|
|
@@ -204,7 +205,7 @@ var Redlining = /*#__PURE__*/function (_React$Component) {
|
|
|
204
205
|
}] : [];
|
|
205
206
|
var editButtons = [{
|
|
206
207
|
key: "Pick",
|
|
207
|
-
tooltip: LocaleUtils.tr("
|
|
208
|
+
tooltip: LocaleUtils.tr("common.pick"),
|
|
208
209
|
icon: "nodetool",
|
|
209
210
|
data: {
|
|
210
211
|
action: "Pick",
|
|
@@ -222,7 +223,7 @@ var Redlining = /*#__PURE__*/function (_React$Component) {
|
|
|
222
223
|
}
|
|
223
224
|
} : null, toolEnabled("Clone") ? {
|
|
224
225
|
key: "Clone",
|
|
225
|
-
tooltip: LocaleUtils.tr("
|
|
226
|
+
tooltip: LocaleUtils.tr("common.clone"),
|
|
226
227
|
icon: "clone",
|
|
227
228
|
data: {
|
|
228
229
|
action: "Clone",
|
|
@@ -231,7 +232,7 @@ var Redlining = /*#__PURE__*/function (_React$Component) {
|
|
|
231
232
|
disabled: !_this.props.redlining.selectedFeature
|
|
232
233
|
} : null, {
|
|
233
234
|
key: "Delete",
|
|
234
|
-
tooltip: LocaleUtils.tr("
|
|
235
|
+
tooltip: LocaleUtils.tr("common.delete"),
|
|
235
236
|
icon: "trash",
|
|
236
237
|
data: {
|
|
237
238
|
action: "Delete",
|
|
@@ -323,7 +324,7 @@ var Redlining = /*#__PURE__*/function (_React$Component) {
|
|
|
323
324
|
disabled: !haveLayer,
|
|
324
325
|
menuIcon: "export",
|
|
325
326
|
onActivate: _this["export"],
|
|
326
|
-
tooltip: LocaleUtils.tr("
|
|
327
|
+
tooltip: LocaleUtils.tr("common.export")
|
|
327
328
|
}, /*#__PURE__*/React.createElement("div", {
|
|
328
329
|
className: "redlining-export-menu-entry",
|
|
329
330
|
key: "GeoJSON",
|
|
@@ -341,7 +342,7 @@ var Redlining = /*#__PURE__*/function (_React$Component) {
|
|
|
341
342
|
});
|
|
342
343
|
});
|
|
343
344
|
_defineProperty(_this, "renderStandardControls", function () {
|
|
344
|
-
var sizeLabel = LocaleUtils.tr("
|
|
345
|
+
var sizeLabel = LocaleUtils.tr("common.line");
|
|
345
346
|
var showDash = true;
|
|
346
347
|
if (["Text", "Point"].includes(_this.props.redlining.geomType)) {
|
|
347
348
|
sizeLabel = LocaleUtils.tr("redlining.size");
|
|
@@ -491,21 +492,16 @@ var Redlining = /*#__PURE__*/function (_React$Component) {
|
|
|
491
492
|
})))) : null, /*#__PURE__*/React.createElement("div", {
|
|
492
493
|
className: "redlining-control redlining-control-fill"
|
|
493
494
|
}, /*#__PURE__*/React.createElement("div", {
|
|
494
|
-
className: "controlgroup"
|
|
495
|
-
}, _this.props.redlining.geomType !== 'Text' && _this.props.allowGeometryLabels ? /*#__PURE__*/React.createElement(
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
style: _objectSpread(_objectSpread({}, _this.props.redlining.style), {}, {
|
|
501
|
-
text: ''
|
|
502
|
-
})
|
|
503
|
-
});
|
|
495
|
+
className: "controlgroup" + (_this.props.redlining.showmeasurements ? " redlining-control-fill" : "")
|
|
496
|
+
}, _this.props.redlining.geomType !== 'Text' && _this.props.allowGeometryLabels ? /*#__PURE__*/React.createElement(MeasureSwitcher, {
|
|
497
|
+
changeMeasureState: function changeMeasureState(diff) {
|
|
498
|
+
return _this.props.changeRedliningState(_objectSpread(_objectSpread({}, diff), {}, {
|
|
499
|
+
text: ''
|
|
500
|
+
}));
|
|
504
501
|
},
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
})) : null, (_this.props.redlining.geomType === 'Text' || _this.props.allowGeometryLabels) && !_this.props.redlining.measurements ? /*#__PURE__*/React.createElement("input", {
|
|
502
|
+
geomType: _this.props.redlining.geomType,
|
|
503
|
+
measureState: _this.props.redlining
|
|
504
|
+
}) : null, (_this.props.redlining.geomType === 'Text' || _this.props.allowGeometryLabels) && !_this.props.redlining.showmeasurements ? /*#__PURE__*/React.createElement("input", {
|
|
509
505
|
className: "controlgroup-fillitem",
|
|
510
506
|
onChange: function onChange(ev) {
|
|
511
507
|
return _this.updateRedliningStyle({
|
|
@@ -513,57 +509,13 @@ var Redlining = /*#__PURE__*/function (_React$Component) {
|
|
|
513
509
|
});
|
|
514
510
|
},
|
|
515
511
|
placeholder: labelPlaceholder,
|
|
516
|
-
readOnly: _this.props.redlining.
|
|
512
|
+
readOnly: _this.props.redlining.showmeasurements,
|
|
517
513
|
ref: function ref(el) {
|
|
518
514
|
return _this.setLabelRef(el);
|
|
519
515
|
},
|
|
520
516
|
type: "text",
|
|
521
517
|
value: _this.props.redlining.style.text
|
|
522
|
-
}) : null
|
|
523
|
-
className: "controlgroup-fillitem",
|
|
524
|
-
onChange: function onChange(ev) {
|
|
525
|
-
return _this.props.changeRedliningState({
|
|
526
|
-
lenUnit: ev.target.value
|
|
527
|
-
});
|
|
528
|
-
},
|
|
529
|
-
value: _this.props.redlining.lenUnit
|
|
530
|
-
}, /*#__PURE__*/React.createElement("option", {
|
|
531
|
-
value: "metric"
|
|
532
|
-
}, LocaleUtils.tr("measureComponent.metric")), /*#__PURE__*/React.createElement("option", {
|
|
533
|
-
value: "imperial"
|
|
534
|
-
}, LocaleUtils.tr("measureComponent.imperial")), /*#__PURE__*/React.createElement("option", {
|
|
535
|
-
value: "m"
|
|
536
|
-
}, "m"), /*#__PURE__*/React.createElement("option", {
|
|
537
|
-
value: "km"
|
|
538
|
-
}, "km"), /*#__PURE__*/React.createElement("option", {
|
|
539
|
-
value: "ft"
|
|
540
|
-
}, "ft"), /*#__PURE__*/React.createElement("option", {
|
|
541
|
-
value: "mi"
|
|
542
|
-
}, "mi")) : null, _this.props.redlining.measurements && ['Polygon', 'Ellipse', 'Square', 'Box'].includes(_this.props.redlining.geomType) ? /*#__PURE__*/React.createElement("select", {
|
|
543
|
-
className: "controlgroup-fillitem",
|
|
544
|
-
onChange: function onChange(ev) {
|
|
545
|
-
return _this.props.changeRedliningState({
|
|
546
|
-
areaUnit: ev.target.value
|
|
547
|
-
});
|
|
548
|
-
},
|
|
549
|
-
value: _this.props.redlining.areaUnit
|
|
550
|
-
}, /*#__PURE__*/React.createElement("option", {
|
|
551
|
-
value: "metric"
|
|
552
|
-
}, LocaleUtils.tr("measureComponent.metric")), /*#__PURE__*/React.createElement("option", {
|
|
553
|
-
value: "imperial"
|
|
554
|
-
}, LocaleUtils.tr("measureComponent.imperial")), /*#__PURE__*/React.createElement("option", {
|
|
555
|
-
value: "sqm"
|
|
556
|
-
}, "m\xB2"), /*#__PURE__*/React.createElement("option", {
|
|
557
|
-
value: "ha"
|
|
558
|
-
}, "ha"), /*#__PURE__*/React.createElement("option", {
|
|
559
|
-
value: "sqkm"
|
|
560
|
-
}, "km\xB2"), /*#__PURE__*/React.createElement("option", {
|
|
561
|
-
value: "sqft"
|
|
562
|
-
}, "ft\xB2"), /*#__PURE__*/React.createElement("option", {
|
|
563
|
-
value: "acre"
|
|
564
|
-
}, "acre"), /*#__PURE__*/React.createElement("option", {
|
|
565
|
-
value: "sqmi"
|
|
566
|
-
}, "mi\xB2")) : null)));
|
|
518
|
+
}) : null)));
|
|
567
519
|
});
|
|
568
520
|
_defineProperty(_this, "setLabelRef", function (el) {
|
|
569
521
|
_this.labelInput = el;
|
package/plugins/Reports.js
CHANGED
|
@@ -71,7 +71,7 @@ var Reports = /*#__PURE__*/function (_React$Component) {
|
|
|
71
71
|
var pickButtons = [{
|
|
72
72
|
key: 'Pick',
|
|
73
73
|
icon: 'pick',
|
|
74
|
-
label: LocaleUtils.tr("
|
|
74
|
+
label: LocaleUtils.tr("common.pick")
|
|
75
75
|
}, {
|
|
76
76
|
key: 'Region',
|
|
77
77
|
icon: 'pick_region',
|
|
@@ -79,7 +79,7 @@ var Reports = /*#__PURE__*/function (_React$Component) {
|
|
|
79
79
|
}, {
|
|
80
80
|
key: 'All',
|
|
81
81
|
icon: 'ok',
|
|
82
|
-
label: LocaleUtils.tr("
|
|
82
|
+
label: LocaleUtils.tr("common.all"),
|
|
83
83
|
forceLabel: true
|
|
84
84
|
}];
|
|
85
85
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -113,7 +113,7 @@ var Reports = /*#__PURE__*/function (_React$Component) {
|
|
|
113
113
|
type: "button"
|
|
114
114
|
}, _this.state.generatingReport ? /*#__PURE__*/React.createElement(Spinner, null) : /*#__PURE__*/React.createElement(Icon, {
|
|
115
115
|
icon: "report"
|
|
116
|
-
}), /*#__PURE__*/React.createElement("span", null, LocaleUtils.tr("
|
|
116
|
+
}), /*#__PURE__*/React.createElement("span", null, LocaleUtils.tr("common.download")))));
|
|
117
117
|
});
|
|
118
118
|
_defineProperty(_this, "setLayerVisible", function (layerUrl, layerName) {
|
|
119
119
|
var path = [];
|
package/plugins/Routing.js
CHANGED
|
@@ -234,7 +234,7 @@ var Routing = /*#__PURE__*/function (_React$Component) {
|
|
|
234
234
|
}
|
|
235
235
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
236
236
|
icon: "clear"
|
|
237
|
-
}), " ", LocaleUtils.tr("
|
|
237
|
+
}), " ", LocaleUtils.tr("common.clear"))), _this.state.mode === 'transit' ? /*#__PURE__*/React.createElement("div", {
|
|
238
238
|
className: "routing-time-settings"
|
|
239
239
|
}, /*#__PURE__*/React.createElement("select", {
|
|
240
240
|
onChange: _this.updateTransitTimepoint,
|
|
@@ -330,7 +330,7 @@ var Routing = /*#__PURE__*/function (_React$Component) {
|
|
|
330
330
|
}), " ", /*#__PURE__*/React.createElement("a", {
|
|
331
331
|
href: "#",
|
|
332
332
|
onClick: _this.exportRoute
|
|
333
|
-
}, LocaleUtils.tr("
|
|
333
|
+
}, LocaleUtils.tr("common.export"))), /*#__PURE__*/React.createElement("span", {
|
|
334
334
|
className: "routing-result-spacer"
|
|
335
335
|
}), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Icon, {
|
|
336
336
|
icon: "layers"
|
|
@@ -467,7 +467,7 @@ var Routing = /*#__PURE__*/function (_React$Component) {
|
|
|
467
467
|
}
|
|
468
468
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
469
469
|
icon: "clear"
|
|
470
|
-
}), " ", LocaleUtils.tr("
|
|
470
|
+
}), " ", LocaleUtils.tr("common.clear")))), isoConfig.busy ? /*#__PURE__*/React.createElement("div", {
|
|
471
471
|
className: "routing-busy"
|
|
472
472
|
}, /*#__PURE__*/React.createElement(Spinner, null), " ", LocaleUtils.tr("routing.computing")) : null, isoConfig.result ? _this.renderIsochroneResult(isoConfig) : null);
|
|
473
473
|
});
|
|
@@ -486,7 +486,7 @@ var Routing = /*#__PURE__*/function (_React$Component) {
|
|
|
486
486
|
}), " ", /*#__PURE__*/React.createElement("a", {
|
|
487
487
|
href: "#",
|
|
488
488
|
onClick: _this.exportIsochrone
|
|
489
|
-
}, LocaleUtils.tr("
|
|
489
|
+
}, LocaleUtils.tr("common.export"))), /*#__PURE__*/React.createElement("span", {
|
|
490
490
|
className: "routing-result-spacer"
|
|
491
491
|
}), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Icon, {
|
|
492
492
|
icon: "layers"
|
package/plugins/ValueTool.js
CHANGED
|
@@ -178,7 +178,7 @@ var ValueTool = /*#__PURE__*/function (_React$Component) {
|
|
|
178
178
|
onChange: function onChange(value) {
|
|
179
179
|
return _this.setLayerBands(key, value);
|
|
180
180
|
},
|
|
181
|
-
placeholder: LocaleUtils.tr("
|
|
181
|
+
placeholder: LocaleUtils.tr("common.all"),
|
|
182
182
|
value: _this.state.selectedBands[key] || ""
|
|
183
183
|
})) : null);
|
|
184
184
|
});
|
package/plugins/View3D.js
CHANGED
|
@@ -68,11 +68,11 @@ var View3D = /*#__PURE__*/function (_React$Component) {
|
|
|
68
68
|
var extraControls = [{
|
|
69
69
|
icon: "sync",
|
|
70
70
|
callback: _this.sync2DExtent,
|
|
71
|
-
title: LocaleUtils.tr("
|
|
71
|
+
title: LocaleUtils.tr("common.sync2dview")
|
|
72
72
|
}, {
|
|
73
73
|
icon: "lock",
|
|
74
74
|
callback: _this.setLockViews,
|
|
75
|
-
title: LocaleUtils.tr("
|
|
75
|
+
title: LocaleUtils.tr("common.lock2dview"),
|
|
76
76
|
active: _this.state.viewsLocked
|
|
77
77
|
}];
|
|
78
78
|
if (!_this.state.windowDetached) {
|
package/plugins/ZoomButtons.js
CHANGED
|
@@ -96,7 +96,7 @@ var ZoomButton = /*#__PURE__*/function (_React$Component) {
|
|
|
96
96
|
}
|
|
97
97
|
var defaultPosition = this.props.direction > 0 ? 4 : 3;
|
|
98
98
|
var position = this.props.position >= 0 ? this.props.position : defaultPosition;
|
|
99
|
-
var tooltip = this.props.direction > 0 ? LocaleUtils.tr("
|
|
99
|
+
var tooltip = this.props.direction > 0 ? LocaleUtils.tr("common.zoomin") : LocaleUtils.tr("common.zoomout");
|
|
100
100
|
var active = this.props.enableZoomByBoxSelection && this.props.currentTask === this.task;
|
|
101
101
|
return [/*#__PURE__*/React.createElement(MapButton, {
|
|
102
102
|
active: active,
|
|
@@ -35,6 +35,7 @@ import PropTypes from 'prop-types';
|
|
|
35
35
|
import { setEditContext } from '../../actions/editing';
|
|
36
36
|
import LocationRecorder from '../../components/LocationRecorder';
|
|
37
37
|
import FeatureStyles from "../../utils/FeatureStyles";
|
|
38
|
+
import MeasureUtils from '../../utils/MeasureUtils';
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
41
|
* Editing support for the map component.
|
|
@@ -47,33 +48,33 @@ var EditingSupport = /*#__PURE__*/function (_React$Component) {
|
|
|
47
48
|
_defineProperty(_this, "state", {
|
|
48
49
|
showRecordLocation: false
|
|
49
50
|
});
|
|
50
|
-
_defineProperty(_this, "editStyle", function () {
|
|
51
|
-
var geometryFunction = function geometryFunction(
|
|
52
|
-
if (
|
|
53
|
-
return new ol.geom.MultiPoint([
|
|
54
|
-
} else if (
|
|
55
|
-
return new ol.geom.MultiPoint(
|
|
56
|
-
} else if (
|
|
57
|
-
return new ol.geom.MultiPoint(
|
|
58
|
-
} else if (
|
|
59
|
-
return
|
|
60
|
-
} else if (
|
|
61
|
-
return new ol.geom.MultiPoint(
|
|
62
|
-
} else if (
|
|
63
|
-
return new ol.geom.MultiPoint(
|
|
51
|
+
_defineProperty(_this, "editStyle", function (feature) {
|
|
52
|
+
var geometryFunction = function geometryFunction(f) {
|
|
53
|
+
if (f.getGeometry().getType() === "Point") {
|
|
54
|
+
return new ol.geom.MultiPoint([f.getGeometry().getCoordinates()]);
|
|
55
|
+
} else if (f.getGeometry().getType() === "LineString") {
|
|
56
|
+
return new ol.geom.MultiPoint(f.getGeometry().getCoordinates());
|
|
57
|
+
} else if (f.getGeometry().getType() === "Polygon") {
|
|
58
|
+
return new ol.geom.MultiPoint(f.getGeometry().getCoordinates()[0]);
|
|
59
|
+
} else if (f.getGeometry().getType() === "MultiPoint") {
|
|
60
|
+
return f.getGeometry();
|
|
61
|
+
} else if (f.getGeometry().getType() === "MultiLineString") {
|
|
62
|
+
return new ol.geom.MultiPoint(f.getGeometry().getCoordinates()[0]);
|
|
63
|
+
} else if (f.getGeometry().getType() === "MultiPolygon") {
|
|
64
|
+
return new ol.geom.MultiPoint(f.getGeometry().getCoordinates()[0][0]);
|
|
64
65
|
}
|
|
65
|
-
return
|
|
66
|
+
return f.getGeometry();
|
|
66
67
|
};
|
|
67
|
-
return [FeatureStyles.interaction(_this.props.editContext.geometryStyle), FeatureStyles.interactionVertex(_objectSpread({
|
|
68
|
+
return [FeatureStyles.interaction(feature, _this.props.editContext.geometryStyle), FeatureStyles.interactionVertex(_objectSpread({
|
|
68
69
|
geometryFunction: geometryFunction
|
|
69
|
-
}, _this.props.editContext.vertexStyle))];
|
|
70
|
+
}, _this.props.editContext.vertexStyle))].flat();
|
|
70
71
|
});
|
|
71
72
|
_defineProperty(_this, "createLayer", function () {
|
|
72
73
|
var source = new ol.source.Vector();
|
|
73
74
|
_this.layer = new ol.layer.Vector({
|
|
74
75
|
source: source,
|
|
75
76
|
zIndex: 1000000,
|
|
76
|
-
style: _this.editStyle
|
|
77
|
+
style: _this.editStyle
|
|
77
78
|
});
|
|
78
79
|
_this.props.map.addLayer(_this.layer);
|
|
79
80
|
});
|
|
@@ -88,10 +89,11 @@ var EditingSupport = /*#__PURE__*/function (_React$Component) {
|
|
|
88
89
|
condition: function condition(event) {
|
|
89
90
|
return event.originalEvent.buttons === 1;
|
|
90
91
|
},
|
|
91
|
-
style: _this.editStyle
|
|
92
|
+
style: _this.editStyle
|
|
92
93
|
});
|
|
93
94
|
drawInteraction.on('drawstart', function (evt) {
|
|
94
95
|
_this.currentFeature = evt.feature;
|
|
96
|
+
_this.currentFeature.on('change', _this.updateMeasurements);
|
|
95
97
|
}, _this);
|
|
96
98
|
drawInteraction.on('drawend', function () {
|
|
97
99
|
_this.setState({
|
|
@@ -112,6 +114,8 @@ var EditingSupport = /*#__PURE__*/function (_React$Component) {
|
|
|
112
114
|
_this.createLayer();
|
|
113
115
|
var format = new ol.format.GeoJSON();
|
|
114
116
|
_this.currentFeature = format.readFeature(_this.props.editContext.feature);
|
|
117
|
+
_this.currentFeature.on('change', _this.updateMeasurements);
|
|
118
|
+
_this.updateMeasurements();
|
|
115
119
|
_this.layer.getSource().addFeature(_this.currentFeature);
|
|
116
120
|
var modifyInteraction = new ol.interaction.Modify({
|
|
117
121
|
features: new ol.Collection([_this.currentFeature]),
|
|
@@ -134,6 +138,23 @@ var EditingSupport = /*#__PURE__*/function (_React$Component) {
|
|
|
134
138
|
_this.props.map.addInteraction(modifyInteraction);
|
|
135
139
|
_this.interaction = modifyInteraction;
|
|
136
140
|
});
|
|
141
|
+
_defineProperty(_this, "updateMeasurements", function () {
|
|
142
|
+
var _this$props$editConte;
|
|
143
|
+
if (!_this.currentFeature) {
|
|
144
|
+
return;
|
|
145
|
+
} else if (!((_this$props$editConte = _this.props.editContext.measurements) !== null && _this$props$editConte !== void 0 && _this$props$editConte.showmeasurements)) {
|
|
146
|
+
_this.currentFeature.set('measurements', undefined);
|
|
147
|
+
_this.currentFeature.set('segment_labels', undefined);
|
|
148
|
+
_this.currentFeature.set('label', undefined);
|
|
149
|
+
} else {
|
|
150
|
+
var settings = {
|
|
151
|
+
displayCrs: _this.props.displayCrs,
|
|
152
|
+
lenUnit: _this.props.editContext.measurements.lenUnit,
|
|
153
|
+
areaUnit: _this.props.editContext.measurements.areaUnit
|
|
154
|
+
};
|
|
155
|
+
MeasureUtils.updateFeatureMeasurements(_this.currentFeature, _this.props.editContext.geomType, _this.props.mapCrs, settings);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
137
158
|
_defineProperty(_this, "commitCurrentFeature", function () {
|
|
138
159
|
if (!_this.currentFeature) {
|
|
139
160
|
return;
|
|
@@ -161,6 +182,9 @@ var EditingSupport = /*#__PURE__*/function (_React$Component) {
|
|
|
161
182
|
_this.props.map.removeInteraction(_this.interaction);
|
|
162
183
|
}
|
|
163
184
|
_this.interaction = null;
|
|
185
|
+
if (_this.currentFeature) {
|
|
186
|
+
_this.currentFeature.un('change', _this.updateMeasurements);
|
|
187
|
+
}
|
|
164
188
|
_this.currentFeature = null;
|
|
165
189
|
if (_this.layer) {
|
|
166
190
|
_this.props.map.removeLayer(_this.layer);
|
|
@@ -178,6 +202,8 @@ var EditingSupport = /*#__PURE__*/function (_React$Component) {
|
|
|
178
202
|
value: function componentDidUpdate(prevProps) {
|
|
179
203
|
if (this.props.editContext === prevProps.editContext) {
|
|
180
204
|
// pass
|
|
205
|
+
} else if (this.props.editContext.measurements !== prevProps.editContext.measurements) {
|
|
206
|
+
this.updateMeasurements();
|
|
181
207
|
} else if (this.props.editContext.action === 'Pick' && this.props.editContext.feature) {
|
|
182
208
|
// If a feature without geometry was picked, enter draw mode, otherwise enter edit mode
|
|
183
209
|
if (!this.props.editContext.feature.geometry && this.props.editContext.geomType) {
|
|
@@ -213,13 +239,17 @@ var EditingSupport = /*#__PURE__*/function (_React$Component) {
|
|
|
213
239
|
}]);
|
|
214
240
|
}(React.Component);
|
|
215
241
|
_defineProperty(EditingSupport, "propTypes", {
|
|
242
|
+
displayCrs: PropTypes.string,
|
|
216
243
|
editContext: PropTypes.object,
|
|
217
244
|
map: PropTypes.object,
|
|
245
|
+
mapCrs: PropTypes.string,
|
|
218
246
|
setEditContext: PropTypes.func
|
|
219
247
|
});
|
|
220
248
|
export default connect(function (state) {
|
|
221
249
|
return {
|
|
222
|
-
editContext: state.editing.contexts[state.editing.currentContext] || {}
|
|
250
|
+
editContext: state.editing.contexts[state.editing.currentContext] || {},
|
|
251
|
+
displayCrs: state.map.displayCrs,
|
|
252
|
+
mapCrs: state.map.projection
|
|
223
253
|
};
|
|
224
254
|
}, {
|
|
225
255
|
setEditContext: setEditContext
|
|
@@ -189,7 +189,7 @@ var RedliningSupport = /*#__PURE__*/function (_React$Component) {
|
|
|
189
189
|
_this.blockOnChange = false;
|
|
190
190
|
});
|
|
191
191
|
_defineProperty(_this, "toggleFeatureMeasurements", function (feature) {
|
|
192
|
-
if (_this.props.redlining.
|
|
192
|
+
if (_this.props.redlining.showmeasurements) {
|
|
193
193
|
var settings = {
|
|
194
194
|
displayCrs: _this.props.displayCrs,
|
|
195
195
|
lenUnit: _this.props.redlining.lenUnit,
|
|
@@ -854,7 +854,7 @@ var RedliningSupport = /*#__PURE__*/function (_React$Component) {
|
|
|
854
854
|
this.selectedFeatures.forEach(this.updateFeatureStyle);
|
|
855
855
|
}
|
|
856
856
|
// Update current feature measurements
|
|
857
|
-
if (this.props.redlining.
|
|
857
|
+
if (this.props.redlining.showmeasurements !== prevProps.redlining.showmeasurements) {
|
|
858
858
|
this.selectedFeatures.forEach(this.toggleFeatureMeasurements);
|
|
859
859
|
} else if (this.props.map.displayCrs !== prevProps.map.displayCrs || this.props.redlining.lenUnit !== prevProps.redlining.lenUnit || this.props.redlining.areaUnit !== prevProps.redlining.areaUnit) {
|
|
860
860
|
this.selectedFeatures.forEach(function (feature) {
|
|
@@ -74,13 +74,13 @@ var SnapSupport = /*#__PURE__*/function (_React$Component) {
|
|
|
74
74
|
});
|
|
75
75
|
_defineProperty(_this, "getFeature", function () {
|
|
76
76
|
_this.timeoutId = null;
|
|
77
|
-
var
|
|
78
|
-
return
|
|
77
|
+
var layer = _this.props.layers.find(function (l) {
|
|
78
|
+
return l.role === LayerRole.THEME;
|
|
79
79
|
});
|
|
80
|
-
var queryLayers = _this.props.layers.reduce(function (accum,
|
|
81
|
-
return
|
|
80
|
+
var queryLayers = _this.props.layers.reduce(function (accum, l) {
|
|
81
|
+
return l.role === LayerRole.THEME ? accum.concat(l.queryLayers) : accum;
|
|
82
82
|
}, []).join(",");
|
|
83
|
-
if (!
|
|
83
|
+
if (!layer || !queryLayers) {
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
86
|
var options = {
|
|
@@ -90,11 +90,11 @@ var SnapSupport = /*#__PURE__*/function (_React$Component) {
|
|
|
90
90
|
FI_LINE_TOLERANCE: 8,
|
|
91
91
|
FI_POLYGON_TOLERANCE: 4
|
|
92
92
|
};
|
|
93
|
-
var request = IdentifyUtils.buildRequest(
|
|
93
|
+
var request = IdentifyUtils.buildRequest(layer, queryLayers, _this.state.mousePos.coordinate, _this.props.mapObj, options);
|
|
94
94
|
axios.get(request.url, {
|
|
95
95
|
params: request.params
|
|
96
96
|
}).then(function (response) {
|
|
97
|
-
var results = IdentifyUtils.parseXmlResponse(response.data, _this.props.mapObj.projection,
|
|
97
|
+
var results = IdentifyUtils.parseXmlResponse(response.data, _this.props.mapObj.projection, layer);
|
|
98
98
|
var features = [];
|
|
99
99
|
results.forEach(function (result) {
|
|
100
100
|
var _iterator2 = _createForOfIteratorHelper(result),
|
|
@@ -159,9 +159,11 @@ var SnapSupport = /*#__PURE__*/function (_React$Component) {
|
|
|
159
159
|
_this.snapLayer = new ol.layer.Vector({
|
|
160
160
|
source: _this.snapSource,
|
|
161
161
|
zIndex: 1000000,
|
|
162
|
-
style:
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
style: function style(feature) {
|
|
163
|
+
return [FeatureStyles.interaction(feature, {}, true), FeatureStyles.interactionVertex({
|
|
164
|
+
geometryFunction: geometryFunction
|
|
165
|
+
}, true)].flat();
|
|
166
|
+
}
|
|
165
167
|
});
|
|
166
168
|
_this.props.map.addLayer(_this.snapLayer);
|
|
167
169
|
_this.curPos = null;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
div.snapping-toolbar {
|
|
2
|
-
display:
|
|
2
|
+
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
|
-
line-height: 1.5em;
|
|
5
|
-
position: relative;
|
|
6
|
-
padding: 0.25em 0.5em;
|
|
7
|
-
order: 0;
|
|
8
|
-
background-color: var(--container-bg-color);
|
|
9
|
-
box-shadow: 0px -2px 4px rgba(136, 136, 136, 0.5);
|
|
10
|
-
border-bottom: 1px solid rgba(136, 136, 136, 0.5);
|
|
11
4
|
}
|
|
12
5
|
|
|
13
6
|
div.snapping-toolbar-container div.spinner {
|
package/plugins/map3d/Draw3D.js
CHANGED
|
@@ -174,7 +174,7 @@ var Draw3D = /*#__PURE__*/function (_React$Component) {
|
|
|
174
174
|
}]];
|
|
175
175
|
var editButtons = [{
|
|
176
176
|
key: "Pick",
|
|
177
|
-
tooltip: LocaleUtils.tr("
|
|
177
|
+
tooltip: LocaleUtils.tr("common.pick"),
|
|
178
178
|
icon: "nodetool",
|
|
179
179
|
data: {
|
|
180
180
|
action: "Pick",
|
|
@@ -182,7 +182,7 @@ var Draw3D = /*#__PURE__*/function (_React$Component) {
|
|
|
182
182
|
}
|
|
183
183
|
}, {
|
|
184
184
|
key: "Delete",
|
|
185
|
-
tooltip: LocaleUtils.tr("
|
|
185
|
+
tooltip: LocaleUtils.tr("common.delete"),
|
|
186
186
|
icon: "trash",
|
|
187
187
|
data: {
|
|
188
188
|
action: "Delete",
|
|
@@ -107,7 +107,7 @@ var ExportObjects3D = /*#__PURE__*/function (_React$Component) {
|
|
|
107
107
|
onSubmit: _this.exportArea
|
|
108
108
|
}, /*#__PURE__*/React.createElement("table", {
|
|
109
109
|
className: "options-table"
|
|
110
|
-
}, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, LocaleUtils.tr("
|
|
110
|
+
}, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, LocaleUtils.tr("common.format")), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("select", {
|
|
111
111
|
name: "FORMAT",
|
|
112
112
|
onChange: _this.formatChanged,
|
|
113
113
|
value: _this.state.selectedFormat
|
|
@@ -127,7 +127,7 @@ var ExportObjects3D = /*#__PURE__*/function (_React$Component) {
|
|
|
127
127
|
type: "submit"
|
|
128
128
|
}, _this.state.exporting ? /*#__PURE__*/React.createElement("span", {
|
|
129
129
|
className: "mapexport-wait"
|
|
130
|
-
}, /*#__PURE__*/React.createElement(Spinner, null), " ", LocaleUtils.tr("
|
|
130
|
+
}, /*#__PURE__*/React.createElement(Spinner, null), " ", LocaleUtils.tr("common.wait")) : LocaleUtils.tr("common.export")))));
|
|
131
131
|
});
|
|
132
132
|
_defineProperty(_this, "restart", function () {
|
|
133
133
|
if (_this.abortController) {
|
|
@@ -191,7 +191,7 @@ var MapExport3D = /*#__PURE__*/function (_React$Component) {
|
|
|
191
191
|
onSubmit: _this["export"]
|
|
192
192
|
}, /*#__PURE__*/React.createElement("table", {
|
|
193
193
|
className: "options-table"
|
|
194
|
-
}, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, LocaleUtils.tr("
|
|
194
|
+
}, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, LocaleUtils.tr("common.format")), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("select", {
|
|
195
195
|
name: "FORMAT",
|
|
196
196
|
onChange: _this.formatChanged,
|
|
197
197
|
value: _this.state.selectedFormat
|
|
@@ -211,7 +211,7 @@ var MapExport3D = /*#__PURE__*/function (_React$Component) {
|
|
|
211
211
|
key: item.name,
|
|
212
212
|
value: item.name
|
|
213
213
|
}, item.name.split('/').pop());
|
|
214
|
-
})))) : null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, LocaleUtils.tr("
|
|
214
|
+
})))) : null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, LocaleUtils.tr("common.resolution")), /*#__PURE__*/React.createElement("td", null, resolutionChooser)), _this.state.selectedFormat === 'application/pdf' ? (((_this$state$layout2 = _this.state.layout) === null || _this$state$layout2 === void 0 ? void 0 : _this$state$layout2.labels) || []).map(function (label) {
|
|
215
215
|
var _this$props$theme$pri4;
|
|
216
216
|
// Omit labels which start with __
|
|
217
217
|
if (label.startsWith("__")) {
|
|
@@ -278,7 +278,7 @@ var MapExport3D = /*#__PURE__*/function (_React$Component) {
|
|
|
278
278
|
type: "submit"
|
|
279
279
|
}, _this.state.exporting ? /*#__PURE__*/React.createElement("span", {
|
|
280
280
|
className: "mapexport-wait"
|
|
281
|
-
}, /*#__PURE__*/React.createElement(Spinner, null), " ", LocaleUtils.tr("
|
|
281
|
+
}, /*#__PURE__*/React.createElement(Spinner, null), " ", LocaleUtils.tr("common.wait")) : LocaleUtils.tr("common.export")))));
|
|
282
282
|
});
|
|
283
283
|
_defineProperty(_this, "onFrameChanged", function (frame) {
|
|
284
284
|
var x = frame.x,
|
|
@@ -450,7 +450,7 @@ var MapExport3D = /*#__PURE__*/function (_React$Component) {
|
|
|
450
450
|
key: "render",
|
|
451
451
|
value: function render() {
|
|
452
452
|
var _this2 = this;
|
|
453
|
-
var minMaxTooltip = this.state.minimized ? LocaleUtils.tr("
|
|
453
|
+
var minMaxTooltip = this.state.minimized ? LocaleUtils.tr("window.maximize") : LocaleUtils.tr("window.minimize");
|
|
454
454
|
var minMaxIcon = this.state.minimized ? 'chevron-down' : 'chevron-up';
|
|
455
455
|
var extraTitlebarContent = /*#__PURE__*/React.createElement(Icon, {
|
|
456
456
|
className: "mapexport-minimize-maximize",
|
package/reducers/editing.js
CHANGED
|
@@ -52,7 +52,12 @@ export default function editing() {
|
|
|
52
52
|
feature: null,
|
|
53
53
|
changed: false,
|
|
54
54
|
mapPrefix: null,
|
|
55
|
-
editConfig: null
|
|
55
|
+
editConfig: null,
|
|
56
|
+
measurements: {
|
|
57
|
+
showmeasurements: false,
|
|
58
|
+
lenUnit: 'metric',
|
|
59
|
+
areaUnit: 'metric'
|
|
60
|
+
}
|
|
56
61
|
}, state.contexts[action.contextId]), action.editContext), {}, {
|
|
57
62
|
geomNonZeroZ: checkNonZeroZ(state.contexts[action.contextId], action.editContext),
|
|
58
63
|
geomReadOnly: checkGeomReadOnly(editConfig),
|