qwc2 2025.12.17 → 2025.12.19

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.
Files changed (75) hide show
  1. package/components/AttributeForm.js +8 -8
  2. package/components/AttributeTableWidget.js +3 -3
  3. package/components/EditComboField.js +1 -1
  4. package/components/EditUploadField.js +1 -1
  5. package/components/IdentifyViewer.js +3 -4
  6. package/components/LinkFeatureForm.js +21 -4
  7. package/components/MeasureSwitcher.js +115 -0
  8. package/components/OverviewMapButton.js +147 -0
  9. package/components/PluginsContainer.js +3 -2
  10. package/components/QtDesignerForm.js +2 -2
  11. package/components/ResizeableWindow.js +1 -1
  12. package/components/SearchBox.js +7 -7
  13. package/components/map3d/drawtool/EditTool3D.js +1 -1
  14. package/components/style/IdentifyViewer.css +1 -1
  15. package/components/style/LocationRecorder.css +1 -6
  16. package/{plugins/map3d/style/OverviewMap3D.css → components/style/OverviewMapButton.css} +4 -4
  17. package/components/style/PluginsContainer.css +11 -6
  18. package/components/timeline/FixedTimeline.js +2 -2
  19. package/components/timeline/InfiniteTimeline.js +2 -2
  20. package/components/timeline/TimelineFeaturesSlider.js +1 -1
  21. package/components/widgets/LayerCatalogWidget.js +1 -1
  22. package/package.json +1 -1
  23. package/plugins/Editing.js +20 -5
  24. package/plugins/FeatureForm.js +1 -1
  25. package/plugins/FeatureSearch.js +3 -3
  26. package/plugins/GeometryDigitizer.js +40 -26
  27. package/plugins/Identify.js +1 -4
  28. package/plugins/MapExport.js +4 -4
  29. package/plugins/MapFilter.js +10 -10
  30. package/plugins/NewsPopup.js +1 -1
  31. package/plugins/ObliqueView.js +177 -61
  32. package/plugins/Print.js +7 -7
  33. package/plugins/Redlining.js +25 -73
  34. package/plugins/Reports.js +3 -3
  35. package/plugins/Routing.js +4 -4
  36. package/plugins/ValueTool.js +1 -1
  37. package/plugins/View3D.js +2 -2
  38. package/plugins/ZoomButtons.js +1 -1
  39. package/plugins/map/EditingSupport.js +50 -20
  40. package/plugins/map/RedliningSupport.js +4 -4
  41. package/plugins/map/SnapSupport.js +12 -10
  42. package/plugins/map/style/SnappingSupport.css +1 -8
  43. package/plugins/map3d/Draw3D.js +2 -2
  44. package/plugins/map3d/ExportObjects3D.js +2 -2
  45. package/plugins/map3d/MapExport3D.js +4 -4
  46. package/plugins/map3d/OverviewMap3D.js +27 -102
  47. package/plugins/style/ObliqueView.css +6 -2
  48. package/reducers/editing.js +6 -1
  49. package/static/translations/bg-BG.json +39 -74
  50. package/static/translations/ca-ES.json +39 -74
  51. package/static/translations/cs-CZ.json +39 -74
  52. package/static/translations/de-CH.json +39 -74
  53. package/static/translations/de-DE.json +39 -74
  54. package/static/translations/en-US.json +39 -74
  55. package/static/translations/es-ES.json +39 -74
  56. package/static/translations/fi-FI.json +39 -74
  57. package/static/translations/fr-FR.json +39 -74
  58. package/static/translations/hu-HU.json +39 -74
  59. package/static/translations/it-IT.json +39 -74
  60. package/static/translations/ja-JP.json +39 -74
  61. package/static/translations/nl-NL.json +39 -74
  62. package/static/translations/no-NO.json +39 -74
  63. package/static/translations/pl-PL.json +39 -74
  64. package/static/translations/pt-BR.json +39 -74
  65. package/static/translations/pt-PT.json +39 -74
  66. package/static/translations/ro-RO.json +39 -74
  67. package/static/translations/ru-RU.json +39 -74
  68. package/static/translations/sv-SE.json +39 -74
  69. package/static/translations/tr-TR.json +39 -74
  70. package/static/translations/tsconfig.json +30 -67
  71. package/static/translations/uk-UA.json +39 -74
  72. package/utils/EditingUtils.js +2 -2
  73. package/utils/FeatureStyles.js +13 -18
  74. package/utils/IdentifyUtils.js +14 -11
  75. package/utils/SearchProviders.js +1 -1
@@ -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("reports.pick")
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("reports.all"),
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("reports.download")))));
116
+ }), /*#__PURE__*/React.createElement("span", null, LocaleUtils.tr("common.download")))));
117
117
  });
118
118
  _defineProperty(_this, "setLayerVisible", function (layerUrl, layerName) {
119
119
  var path = [];
@@ -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("routing.clear"))), _this.state.mode === 'transit' ? /*#__PURE__*/React.createElement("div", {
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("routing.export"))), /*#__PURE__*/React.createElement("span", {
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("routing.clear")))), isoConfig.busy ? /*#__PURE__*/React.createElement("div", {
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("routing.export"))), /*#__PURE__*/React.createElement("span", {
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"
@@ -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("valuetool.all"),
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("map3d.syncview")
71
+ title: LocaleUtils.tr("common.sync2dview")
72
72
  }, {
73
73
  icon: "lock",
74
74
  callback: _this.setLockViews,
75
- title: LocaleUtils.tr("map3d.lockview"),
75
+ title: LocaleUtils.tr("common.lock2dview"),
76
76
  active: _this.state.viewsLocked
77
77
  }];
78
78
  if (!_this.state.windowDetached) {
@@ -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("tooltip.zoomin") : LocaleUtils.tr("tooltip.zoomout");
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(feature) {
52
- if (feature.getGeometry().getType() === "Point") {
53
- return new ol.geom.MultiPoint([feature.getGeometry().getCoordinates()]);
54
- } else if (feature.getGeometry().getType() === "LineString") {
55
- return new ol.geom.MultiPoint(feature.getGeometry().getCoordinates());
56
- } else if (feature.getGeometry().getType() === "Polygon") {
57
- return new ol.geom.MultiPoint(feature.getGeometry().getCoordinates()[0]);
58
- } else if (feature.getGeometry().getType() === "MultiPoint") {
59
- return feature.getGeometry();
60
- } else if (feature.getGeometry().getType() === "MultiLineString") {
61
- return new ol.geom.MultiPoint(feature.getGeometry().getCoordinates()[0]);
62
- } else if (feature.getGeometry().getType() === "MultiPolygon") {
63
- return new ol.geom.MultiPoint(feature.getGeometry().getCoordinates()[0][0]);
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 feature.getGeometry();
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.measurements) {
192
+ if (_this.props.redlining.showmeasurements) {
193
193
  var settings = {
194
194
  displayCrs: _this.props.displayCrs,
195
195
  lenUnit: _this.props.redlining.lenUnit,
@@ -293,7 +293,7 @@ var RedliningSupport = /*#__PURE__*/function (_React$Component) {
293
293
  ev.feature.set('shape', _this.props.redlining.geomType);
294
294
  _this.updateFeatureStyle(ev.feature);
295
295
  _this.toggleFeatureMeasurements(ev.feature);
296
- _this.selectFeatures([ev.feature]);
296
+ _this.selectFeatures([ev.feature], false);
297
297
  }, _this);
298
298
  drawInteraction.on('drawend', function (ev) {
299
299
  _this.commitFeatures([ev.feature], _this.props.redlining, true);
@@ -428,7 +428,7 @@ var RedliningSupport = /*#__PURE__*/function (_React$Component) {
428
428
  evt.feature.set('shape', _this.props.redlining.geomType);
429
429
  _this.updateFeatureStyle(evt.feature);
430
430
  _this.toggleFeatureMeasurements(evt.feature);
431
- _this.selectFeatures([evt.feature]);
431
+ _this.selectFeatures([evt.feature], false);
432
432
  }, _this);
433
433
  drawInteraction.on('drawend', function () {
434
434
  // Draw end
@@ -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.measurements !== prevProps.redlining.measurements) {
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 layers = _this.props.layers.find(function (layer) {
78
- return layer.role === LayerRole.THEME;
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, layer) {
81
- return layer.role === LayerRole.THEME ? accum.concat(layer.queryLayers) : accum;
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 (!layers || !queryLayers) {
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(layers, queryLayers, _this.state.mousePos.coordinate, _this.props.mapObj, options);
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, layers);
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: [FeatureStyles.interaction({}, true), FeatureStyles.interactionVertex({
163
- geometryFunction: geometryFunction
164
- }, true)]
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: inline-flex;
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 {
@@ -174,7 +174,7 @@ var Draw3D = /*#__PURE__*/function (_React$Component) {
174
174
  }]];
175
175
  var editButtons = [{
176
176
  key: "Pick",
177
- tooltip: LocaleUtils.tr("draw3d.pick"),
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("draw3d.delete"),
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("mapexport.format")), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("select", {
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("mapexport.wait")) : LocaleUtils.tr("mapexport.submit")))));
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("mapexport.format")), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("select", {
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("mapexport.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) {
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("mapexport.wait")) : LocaleUtils.tr("mapexport.submit")))));
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("print.maximize") : LocaleUtils.tr("print.minimize");
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",
@@ -1,6 +1,4 @@
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; }
4
2
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
5
3
  function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
6
4
  function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
@@ -23,84 +21,38 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
23
21
  */
24
22
 
25
23
  import React from 'react';
26
- import ol from 'openlayers';
27
24
  import PropTypes from 'prop-types';
28
- import OlLayer from '../../components/map/OlLayer';
29
- import viewconeIcon from '../../resources/viewcone.svg';
30
- import './style/OverviewMap3D.css';
25
+ import OverviewMapButton from '../../components/OverviewMapButton';
31
26
 
32
27
  /**
33
28
  * Overview map for the 3D map.
34
29
  */
35
30
  var OverviewMap3D = /*#__PURE__*/function (_React$Component) {
36
- function OverviewMap3D(props) {
31
+ function OverviewMap3D() {
37
32
  var _this;
38
33
  _classCallCheck(this, OverviewMap3D);
39
- _this = _callSuper(this, OverviewMap3D, [props]);
34
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
35
+ args[_key] = arguments[_key];
36
+ }
37
+ _this = _callSuper(this, OverviewMap3D, [].concat(args));
40
38
  _defineProperty(_this, "state", {
41
- collapsed: true
42
- });
43
- _defineProperty(_this, "initOverviewMap", function (el) {
44
- if (el) {
45
- _this.map = new ol.Map({
46
- layers: [_this.viewConeLayer],
47
- controls: [],
48
- target: el
49
- });
50
- _this.setupView();
51
- }
52
- });
53
- _defineProperty(_this, "setupView", function () {
54
- var overviewView = new ol.View({
55
- enableRotation: false,
56
- projection: _this.props.sceneContext.mapCrs
57
- });
58
- _this.map.setView(overviewView);
59
- _this.updateViewCone();
39
+ center: null,
40
+ resolution: null,
41
+ coneAngle: null
60
42
  });
61
43
  _defineProperty(_this, "updateViewCone", function () {
62
44
  var _scene$view$controls$, _scene$view$controls, _scene$view$controls$2;
63
- if (!_this.map) {
64
- return;
65
- }
66
45
  var scene = _this.props.sceneContext.scene;
67
46
  var x = scene.view.camera.position.x;
68
47
  var y = scene.view.camera.position.y;
69
48
  var azimuth = (_scene$view$controls$ = (_scene$view$controls = scene.view.controls) === null || _scene$view$controls === void 0 || (_scene$view$controls$2 = _scene$view$controls.getAzimuthalAngle) === null || _scene$view$controls$2 === void 0 ? void 0 : _scene$view$controls$2.call(_scene$view$controls)) !== null && _scene$view$controls$ !== void 0 ? _scene$view$controls$ : 0;
70
49
  var cameraHeight = scene.view.camera.position.z;
71
50
  var resolution = cameraHeight / 100;
72
- _this.map.getView().setCenter([x, y]);
73
- _this.map.getView().setResolution(resolution);
74
- _this.viewConeFeature.getGeometry().setCoordinates([x, y]);
75
- _this.viewConeFeature.set('rotation', -azimuth, true);
76
- _this.viewConeLayer.getSource().changed();
77
- });
78
- _this.map = null;
79
- _this.viewConeFeature = new ol.Feature(new ol.geom.Point([0, 0]));
80
- _this.viewConeLayer = new ol.layer.Vector({
81
- source: new ol.source.Vector({
82
- features: [_this.viewConeFeature]
83
- }),
84
- style: function style(feature) {
85
- return new ol.style.Style({
86
- fill: new ol.style.Fill({
87
- color: 'white'
88
- }),
89
- stroke: new ol.style.Stroke({
90
- color: 'red',
91
- width: 2
92
- }),
93
- image: new ol.style.Icon({
94
- anchor: [0.5, 1],
95
- anchorXUnits: 'fraction',
96
- anchorYUnits: 'fraction',
97
- src: viewconeIcon,
98
- rotation: feature.get('rotation'),
99
- scale: 2
100
- })
101
- });
102
- },
103
- zIndex: 10000
51
+ _this.setState({
52
+ center: [x, y],
53
+ resolution: resolution,
54
+ coneAngle: -azimuth
55
+ });
104
56
  });
105
57
  return _this;
106
58
  }
@@ -110,62 +62,35 @@ var OverviewMap3D = /*#__PURE__*/function (_React$Component) {
110
62
  value: function componentDidMount() {
111
63
  this.props.sceneContext.scene.view.controls.addEventListener('change', this.updateViewCone);
112
64
  }
65
+ }, {
66
+ key: "componentWillUnmount",
67
+ value: function componentWillUnmount() {
68
+ this.props.sceneContext.scene.view.controls.removeEventListener('change', this.updateViewCone);
69
+ }
113
70
  }, {
114
71
  key: "componentDidUpdate",
115
72
  value: function componentDidUpdate(prevProps, prevState) {
116
73
  if (this.props.sceneContext.mapCrs !== prevProps.sceneContext.mapCrs) {
117
74
  this.setupView();
118
75
  }
119
- if (this.map) {
120
- if (this.state.center !== prevState.center || this.state.azimuth !== prevState.azimuth) {
121
- this.map.getView().setCenter(this.state.center);
122
- this.viewConeFeature.getGeometry().setCoordinates(this.state.center);
123
- this.viewConeFeature.set('rotation', -this.state.azimuth, true);
124
- this.viewConeLayer.getSource().changed();
125
- }
126
- if (this.state.resolution !== prevState.resolution) {
127
- this.map.getView().setResolution(this.state.resolution);
128
- }
129
- }
130
76
  }
131
77
  }, {
132
78
  key: "render",
133
79
  value: function render() {
134
- var _this$props$sceneCont,
135
- _this2 = this;
136
- var style = {
137
- display: this.state.collapsed ? 'none' : 'initial'
138
- };
80
+ var _this$props$sceneCont;
139
81
  var baseLayer = this.props.sceneContext.baseLayers.find(function (l) {
140
82
  return l.visibility === true;
141
83
  });
142
84
  var overviewLayer = (_this$props$sceneCont = this.props.sceneContext.baseLayers.find(function (l) {
143
85
  return l.overview === true;
144
86
  })) !== null && _this$props$sceneCont !== void 0 ? _this$props$sceneCont : baseLayer;
145
- return [/*#__PURE__*/React.createElement("div", {
146
- className: "overview-map-3d",
147
- key: "map3d-overview-map"
148
- }, /*#__PURE__*/React.createElement("div", {
149
- className: "ol-overviewmap-map-3d",
150
- ref: this.initOverviewMap,
151
- style: style
152
- }), /*#__PURE__*/React.createElement("button", {
153
- onClick: function onClick() {
154
- return _this2.setState(function (state) {
155
- return {
156
- collapsed: !state.collapsed
157
- };
158
- });
159
- },
160
- type: "button"
161
- }, this.state.collapsed ? '«' : '»')), this.map && overviewLayer ? /*#__PURE__*/React.createElement(OlLayer, {
162
- key: overviewLayer.name,
163
- map: this.map,
164
- options: _objectSpread(_objectSpread({}, overviewLayer), {}, {
165
- visibility: true
166
- }),
167
- projection: this.props.sceneContext.mapCrs
168
- }) : null];
87
+ return overviewLayer ? /*#__PURE__*/React.createElement(OverviewMapButton, {
88
+ center: this.state.center,
89
+ coneRotation: this.state.coneAngle,
90
+ layer: overviewLayer,
91
+ projection: this.props.sceneContext.mapCrs,
92
+ resolution: this.state.resolution
93
+ }) : null;
169
94
  }
170
95
  }]);
171
96
  }(React.Component);
@@ -90,7 +90,8 @@ div.obliqueview-bottombar {
90
90
  right: 0;
91
91
  bottom: 0;
92
92
  height: 3em;
93
- z-index: 100;
93
+ padding: 0 0.5em;
94
+ z-index: 3;
94
95
  color: var(--panel-text-color);
95
96
  background-color: var(--panel-bg-color);
96
97
  box-shadow: 0 -2px 4px rgba(136, 136, 136, 0.5);
@@ -98,7 +99,10 @@ div.obliqueview-bottombar {
98
99
  font-size: 75%;
99
100
  display: flex;
100
101
  align-items: center;
101
- justify-content: center;
102
+ }
103
+
104
+ span.obliqueview-bottombar-spacer {
105
+ flex: 1 1 auto;
102
106
  }
103
107
 
104
108
  div.obliqueview-scalechooser {
@@ -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),