qwc2 2026.5.7 → 2026.5.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qwc2",
3
- "version": "2026.05.07",
3
+ "version": "2026.05.10",
4
4
  "description": "QGIS Web Client",
5
5
  "author": "Sourcepole AG",
6
6
  "license": "BSD-2-Clause",
@@ -223,11 +223,14 @@ var RedliningSupport = /*#__PURE__*/function (_React$Component) {
223
223
  var styleName = feature.get("styleName");
224
224
  var shape = feature.get('shape');
225
225
  var styles = [];
226
+ styles.push.apply(styles, _toConsumableArray(FeatureStyles[styleName](feature, styleOptions)));
226
227
  if (shape === "Text") {
227
228
  styles.push(_this.selectedTextStyle(feature, styleOptions));
228
229
  }
229
- styles.push.apply(styles, _toConsumableArray(FeatureStyles[styleName](feature, styleOptions)));
230
230
  var geomTypeConfig = GeomTypeConfig[shape];
231
+ if (shape === "Text" && styleName === "textlabel") {
232
+ styles.push(_this.selectedTextStyle(feature, styleOptions));
233
+ }
231
234
  if ((geomTypeConfig || {}).drawNodes !== false) {
232
235
  styles.push(_this.selectedStyle);
233
236
  }
@@ -31,7 +31,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
31
31
  import React from 'react';
32
32
  import { connect } from 'react-redux';
33
33
  import PropTypes from 'prop-types';
34
- import { addLayer, addLayerFeatures, LayerRole } from '../../actions/layers';
34
+ import { addLayer, addLayerFeatures, removeLayerFeatures, removeLayer, LayerRole } from '../../actions/layers';
35
35
  import Icon from '../../components/Icon';
36
36
  import PickFeature from '../../components/PickFeature';
37
37
  import ComboBox from '../../components/widgets/ComboBox';
@@ -53,6 +53,11 @@ var RedliningFeatureLabelSupport = /*#__PURE__*/function (_React$Component) {
53
53
  });
54
54
  _defineProperty(_this, "featurePicked", function (layer, feature, map) {
55
55
  var _this$props$layers$fi, _this$props$layers$fi2;
56
+ var sellayer = {
57
+ id: "__redliningfeaturelabelhighlight",
58
+ role: LayerRole.SELECTION
59
+ };
60
+ _this.props.addLayerFeatures(sellayer, [feature], true);
56
61
  var profiles = _toConsumableArray((_this$props$layers$fi = (_this$props$layers$fi2 = _this.props.layers.find(function (l) {
57
62
  return l.wms_name === map;
58
63
  })) === null || _this$props$layers$fi2 === void 0 || (_this$props$layers$fi2 = _this$props$layers$fi2.labelProfiles) === null || _this$props$layers$fi2 === void 0 ? void 0 : _this$props$layers$fi2[layer]) !== null && _this$props$layers$fi !== void 0 ? _this$props$layers$fi : []);
@@ -92,23 +97,29 @@ var RedliningFeatureLabelSupport = /*#__PURE__*/function (_React$Component) {
92
97
  _defineProperty(_this, "updateLabelFeature", function () {
93
98
  var _this$props$layers$fi3;
94
99
  var cur = _this.state.cur;
100
+ var layer = {
101
+ id: _this.props.redlining.layer,
102
+ title: _this.props.redlining.layerTitle,
103
+ role: LayerRole.USERLAYER
104
+ };
105
+ var featureId = "label::".concat(cur.map, "::").concat(cur.layer, "::").concat(cur.feature.id);
95
106
  var expression = cur.profiles.find(function (profile) {
96
107
  return profile.name === _this.state.currentProfile;
97
108
  }).expression;
109
+ if (!expression) {
110
+ _this.props.removeLayerFeatures(layer, [featureId]);
111
+ return;
112
+ }
98
113
  var fakeEditConfig = {
99
114
  layerName: _this.state.cur.layer
100
115
  };
101
- var text = parseExpression(expression, _this.state.cur.feature, fakeEditConfig);
116
+ var text = parseExpression(expression, _this.state.cur.feature, fakeEditConfig, null, _this.state.cur.map, _this.props.projection, _this.updateLabelFeature);
102
117
  if (text === null) {
103
118
  text = expression;
119
+ } else {
120
+ text = String(text);
104
121
  }
105
- var layer = {
106
- id: _this.props.redlining.layer,
107
- title: _this.props.redlining.layerTitle,
108
- role: LayerRole.USERLAYER
109
- };
110
122
  var center = VectorLayerUtils.getFeatureCenter(_this.state.cur.feature);
111
- var featureId = "label::".concat(cur.map, "::").concat(cur.layer, "::").concat(cur.feature.id);
112
123
  var feature = (((_this$props$layers$fi3 = _this.props.layers.find(function (l) {
113
124
  return l.id === _this.props.redlining.layer;
114
125
  })) === null || _this$props$layers$fi3 === void 0 ? void 0 : _this$props$layers$fi3.features) || []).find(function (f) {
@@ -136,6 +147,7 @@ var RedliningFeatureLabelSupport = /*#__PURE__*/function (_React$Component) {
136
147
  styleOptions: {
137
148
  strokeWidth: 2,
138
149
  fillColor: [255, 255, 255, 1],
150
+ textFillColor: [0, 0, 0, 1],
139
151
  strokeColor: [0, 0, 0, 1],
140
152
  strokeDash: [],
141
153
  anchor: center
@@ -155,8 +167,14 @@ var RedliningFeatureLabelSupport = /*#__PURE__*/function (_React$Component) {
155
167
  cur: null,
156
168
  currentProfile: null
157
169
  });
170
+ this.props.removeLayer("__redliningfeaturelabelhighlight");
158
171
  }
159
172
  }
173
+ }, {
174
+ key: "componentWillUnmount",
175
+ value: function componentWillUnmount() {
176
+ this.props.removeLayer("__redliningfeaturelabelhighlight");
177
+ }
160
178
  }, {
161
179
  key: "render",
162
180
  value: function render() {
@@ -213,7 +231,9 @@ _defineProperty(RedliningFeatureLabelSupport, "propTypes", {
213
231
  addLayerFeatures: PropTypes.func,
214
232
  layers: PropTypes.array,
215
233
  projection: PropTypes.string,
216
- redlining: PropTypes.object
234
+ redlining: PropTypes.object,
235
+ removeLayer: PropTypes.func,
236
+ removeLayerFeatures: PropTypes.func
217
237
  });
218
238
  export default {
219
239
  cfg: {
@@ -234,6 +254,8 @@ export default {
234
254
  };
235
255
  }, {
236
256
  addLayerFeatures: addLayerFeatures,
257
+ removeLayer: removeLayer,
258
+ removeLayerFeatures: removeLayerFeatures,
237
259
  addLayer: addLayer
238
260
  })(RedliningFeatureLabelSupport)
239
261
  };
@@ -419,7 +419,7 @@ var EditingInterface = {
419
419
  },
420
420
  /**
421
421
  * Query key-value-pairs of a key-value-relation
422
- * @param keyvalues The keyval string `<keyvaldataset>:<keyfield>:<valuefield>`
422
+ * @param keyvalues Comma separated list of keyvalue tables of the form `<keyvaldataset>:<keyfield>:<valuefield>`
423
423
  * @param callback Callback invoked with the key-value pairs, taking `{keyvalues: {<keyvaldataset>: [{key: <key>, value: <value>}]}}` on success and `{}` on failure
424
424
  * @param filter An optional filter expression, as `[[["<name>", "<op>", <value>],"and|or",["<name>","<op>",<value>],...]]` (one filter expr per keyvalue entry)
425
425
  */
@@ -32,8 +32,10 @@ import { v5 as uuidv5 } from 'uuid';
32
32
  import StandardApp from '../components/StandardApp';
33
33
  import ConfigUtils from './ConfigUtils';
34
34
  import grammar from './expr_grammar/grammar';
35
+ import IdentifyUtils from './IdentifyUtils';
35
36
  import LocaleUtils from './LocaleUtils';
36
37
  import MiscUtils from './MiscUtils';
38
+ import VectorLayerUtils from './VectorLayerUtils';
37
39
  var UUID_NS = '5ae5531d-8e21-4456-b45d-77e9840a5bb7';
38
40
  export var FeatureCache = /*#__PURE__*/_createClass(function FeatureCache() {
39
41
  _classCallCheck(this, FeatureCache);
@@ -169,6 +171,48 @@ function _representValue(attr, editConfig, editIface, promises) {
169
171
  return (_keyvals$value = keyvals[value]) !== null && _keyvals$value !== void 0 ? _keyvals$value : value;
170
172
  }
171
173
  }
174
+ function _overlayIntersects(feature, mapPrefix, mapCrs, args, promises) {
175
+ var _overlayIntersects$__;
176
+ _overlayIntersects.__cache__ = (_overlayIntersects$__ = _overlayIntersects.__cache__) !== null && _overlayIntersects$__ !== void 0 ? _overlayIntersects$__ : {};
177
+ var state = StandardApp.store.getState();
178
+ var layer = state.layers.flat.find(function (l) {
179
+ return l.wms_name === mapPrefix;
180
+ });
181
+ var layerName = args[0];
182
+ var filter = args[1] ? "".concat(layerName, ":").concat(args[1]) : undefined;
183
+ var geometry = feature.geometry;
184
+ if (feature.geometry.type.endsWith("Point")) {
185
+ var p = feature.geometry.coordinates;
186
+ if (feature.geometry.type === "MultiPoint") {
187
+ p = p[0];
188
+ }
189
+ geometry = {
190
+ type: "Polygon",
191
+ coordinates: [[[p[0] - 0.1, p[1] - 0.1], [p[0] + 0.1, p[1] - 0.1], [p[0] + 0.1, p[1] + 0.1], [p[0] - 0.1, p[1] + 0.1], [p[0] - 0.1, p[1] - 0.1]]]
192
+ };
193
+ }
194
+ var extraParams = {
195
+ with_geometry: false,
196
+ feature_count: 1,
197
+ FILTER: filter
198
+ };
199
+ var request = IdentifyUtils.buildFilterRequest(layer, layerName, VectorLayerUtils.geoJSONGeomToWkt(geometry), {
200
+ projection: mapCrs
201
+ }, extraParams);
202
+ var key = uuidv5(JSON.stringify(request.params), UUID_NS);
203
+ if (key in _overlayIntersects.__cache__) {
204
+ return _overlayIntersects.__cache__[key];
205
+ }
206
+ promises.push(new Promise(function (resolve) {
207
+ IdentifyUtils.sendRequest(request, function (response) {
208
+ var _features$layerName;
209
+ var features = IdentifyUtils.parseResponse(response, layerName, request.params.info_format, null, mapCrs);
210
+ _overlayIntersects.__cache__[key] = ((_features$layerName = features[layerName]) !== null && _features$layerName !== void 0 ? _features$layerName : []).length > 0;
211
+ resolve();
212
+ });
213
+ }));
214
+ return null;
215
+ }
172
216
  export function parseExpression(expr, feature, editConfig, editIface, mapPrefix, mapCrs, reevaluateCallback) {
173
217
  var asFilter = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
174
218
  var reevaluate = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : false;
@@ -184,6 +228,9 @@ export function parseExpression(expr, feature, editConfig, editIface, mapPrefix,
184
228
  representValue: function representValue(attr) {
185
229
  return _representValue(attr, editConfig, editIface, promises);
186
230
  },
231
+ overlayIntersects: function overlayIntersects(layer) {
232
+ return _overlayIntersects(feature, mapPrefix, mapCrs, layer, promises);
233
+ },
187
234
  formatDate: MiscUtils.formatDate,
188
235
  asFilter: asFilter,
189
236
  username: ConfigUtils.getConfigProp("username"),
@@ -233,6 +280,9 @@ export function parseExpressionsAsync(fieldExpressions, feature, editConfig, edi
233
280
  representValue: function representValue(attr) {
234
281
  return _representValue(attr, editConfig, editIface, promises);
235
282
  },
283
+ overlayIntersects: function overlayIntersects(layer) {
284
+ return _overlayIntersects(feature, mapPrefix, mapCrs, layer, promises);
285
+ },
236
286
  asFilter: asFilter,
237
287
  username: ConfigUtils.getConfigProp("username"),
238
288
  layer: editConfig.layerName,
@@ -3476,6 +3476,58 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
3476
3476
  }
3477
3477
  }, {
3478
3478
  "name": "N$string$85",
3479
+ "symbols": [{
3480
+ "literal": "o"
3481
+ }, {
3482
+ "literal": "v"
3483
+ }, {
3484
+ "literal": "e"
3485
+ }, {
3486
+ "literal": "r"
3487
+ }, {
3488
+ "literal": "l"
3489
+ }, {
3490
+ "literal": "a"
3491
+ }, {
3492
+ "literal": "y"
3493
+ }, {
3494
+ "literal": "_"
3495
+ }, {
3496
+ "literal": "i"
3497
+ }, {
3498
+ "literal": "n"
3499
+ }, {
3500
+ "literal": "t"
3501
+ }, {
3502
+ "literal": "e"
3503
+ }, {
3504
+ "literal": "r"
3505
+ }, {
3506
+ "literal": "s"
3507
+ }, {
3508
+ "literal": "e"
3509
+ }, {
3510
+ "literal": "c"
3511
+ }, {
3512
+ "literal": "t"
3513
+ }, {
3514
+ "literal": "s"
3515
+ }],
3516
+ "postprocess": function joiner(d) {
3517
+ return d.join('');
3518
+ }
3519
+ }, {
3520
+ "name": "N",
3521
+ "symbols": ["N$string$85", "_", {
3522
+ "literal": "("
3523
+ }, "_", "var_args", "_", {
3524
+ "literal": ")"
3525
+ }],
3526
+ "postprocess": function postprocess(d) {
3527
+ return window.qwc2ExpressionParserContext.overlayIntersects(d[4]);
3528
+ }
3529
+ }, {
3530
+ "name": "N$string$86",
3479
3531
  "symbols": [{
3480
3532
  "literal": "m"
3481
3533
  }, {
@@ -3488,7 +3540,7 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
3488
3540
  }
3489
3541
  }, {
3490
3542
  "name": "N",
3491
- "symbols": ["N$string$85", "_", {
3543
+ "symbols": ["N$string$86", "_", {
3492
3544
  "literal": "("
3493
3545
  }, "_", "var_args", "_", {
3494
3546
  "literal": ")"
@@ -3561,7 +3613,7 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
3561
3613
  return true;
3562
3614
  }
3563
3615
  }, {
3564
- "name": "N$string$86",
3616
+ "name": "N$string$87",
3565
3617
  "symbols": [{
3566
3618
  "literal": "@"
3567
3619
  }, {
@@ -3584,12 +3636,12 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
3584
3636
  }
3585
3637
  }, {
3586
3638
  "name": "N",
3587
- "symbols": ["N$string$86"],
3639
+ "symbols": ["N$string$87"],
3588
3640
  "postprocess": function postprocess(d) {
3589
3641
  return window.qwc2ExpressionParserContext.feature;
3590
3642
  }
3591
3643
  }, {
3592
- "name": "N$string$87",
3644
+ "name": "N$string$88",
3593
3645
  "symbols": [{
3594
3646
  "literal": "@"
3595
3647
  }, {
@@ -3614,13 +3666,13 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
3614
3666
  }
3615
3667
  }, {
3616
3668
  "name": "N",
3617
- "symbols": ["N$string$87"],
3669
+ "symbols": ["N$string$88"],
3618
3670
  "postprocess": function postprocess(d) {
3619
3671
  var _window$qwc2Expressio5;
3620
3672
  return (_window$qwc2Expressio5 = window.qwc2ExpressionParserContext.feature) === null || _window$qwc2Expressio5 === void 0 ? void 0 : _window$qwc2Expressio5.geometry;
3621
3673
  }
3622
3674
  }, {
3623
- "name": "N$string$88",
3675
+ "name": "N$string$89",
3624
3676
  "symbols": [{
3625
3677
  "literal": "@"
3626
3678
  }, {
@@ -3633,13 +3685,13 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
3633
3685
  }
3634
3686
  }, {
3635
3687
  "name": "N",
3636
- "symbols": ["N$string$88"],
3688
+ "symbols": ["N$string$89"],
3637
3689
  "postprocess": function postprocess(d) {
3638
3690
  var _window$qwc2Expressio6;
3639
3691
  return (_window$qwc2Expressio6 = window.qwc2ExpressionParserContext.feature) === null || _window$qwc2Expressio6 === void 0 ? void 0 : _window$qwc2Expressio6.id;
3640
3692
  }
3641
3693
  }, {
3642
- "name": "N$string$89",
3694
+ "name": "N$string$90",
3643
3695
  "symbols": [{
3644
3696
  "literal": "@"
3645
3697
  }, {
@@ -3658,12 +3710,12 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
3658
3710
  }
3659
3711
  }, {
3660
3712
  "name": "N",
3661
- "symbols": ["N$string$89"],
3713
+ "symbols": ["N$string$90"],
3662
3714
  "postprocess": function postprocess(d) {
3663
3715
  return window.qwc2ExpressionParserContext.layer;
3664
3716
  }
3665
3717
  }, {
3666
- "name": "N$string$90",
3718
+ "name": "N$string$91",
3667
3719
  "symbols": [{
3668
3720
  "literal": "@"
3669
3721
  }, {
@@ -3692,12 +3744,12 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
3692
3744
  }
3693
3745
  }, {
3694
3746
  "name": "N",
3695
- "symbols": ["N$string$90"],
3747
+ "symbols": ["N$string$91"],
3696
3748
  "postprocess": function postprocess(d) {
3697
3749
  return window.qwc2ExpressionParserContext.layer;
3698
3750
  }
3699
3751
  }, {
3700
- "name": "N$string$91",
3752
+ "name": "N$string$92",
3701
3753
  "symbols": [{
3702
3754
  "literal": "@"
3703
3755
  }, {
@@ -3724,12 +3776,12 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
3724
3776
  }
3725
3777
  }, {
3726
3778
  "name": "N",
3727
- "symbols": ["N$string$91"],
3779
+ "symbols": ["N$string$92"],
3728
3780
  "postprocess": function postprocess(d) {
3729
3781
  return window.qwc2ExpressionParserContext.projection;
3730
3782
  }
3731
3783
  }, {
3732
- "name": "N$string$92",
3784
+ "name": "N$string$93",
3733
3785
  "symbols": [{
3734
3786
  "literal": "@"
3735
3787
  }, {
@@ -3770,12 +3822,12 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
3770
3822
  }
3771
3823
  }, {
3772
3824
  "name": "N",
3773
- "symbols": ["N$string$92"],
3825
+ "symbols": ["N$string$93"],
3774
3826
  "postprocess": function postprocess(d) {
3775
3827
  return window.qwc2ExpressionParserContext.mapPrefix;
3776
3828
  }
3777
3829
  }, {
3778
- "name": "N$string$93",
3830
+ "name": "N$string$94",
3779
3831
  "symbols": [{
3780
3832
  "literal": "@"
3781
3833
  }, {
@@ -3806,12 +3858,12 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
3806
3858
  }
3807
3859
  }, {
3808
3860
  "name": "N",
3809
- "symbols": ["N$string$93"],
3861
+ "symbols": ["N$string$94"],
3810
3862
  "postprocess": function postprocess(d) {
3811
3863
  return window.qwc2ExpressionParserContext.projection;
3812
3864
  }
3813
3865
  }, {
3814
- "name": "N$string$94",
3866
+ "name": "N$string$95",
3815
3867
  "symbols": [{
3816
3868
  "literal": "@"
3817
3869
  }, {
@@ -3842,12 +3894,12 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
3842
3894
  }
3843
3895
  }, {
3844
3896
  "name": "N",
3845
- "symbols": ["N$string$94"],
3897
+ "symbols": ["N$string$95"],
3846
3898
  "postprocess": function postprocess(d) {
3847
3899
  return window.qwc2ExpressionParserContext.lang;
3848
3900
  }
3849
3901
  }, {
3850
- "name": "N$string$95",
3902
+ "name": "N$string$96",
3851
3903
  "symbols": [{
3852
3904
  "literal": "@"
3853
3905
  }, {
@@ -3890,12 +3942,12 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
3890
3942
  }
3891
3943
  }, {
3892
3944
  "name": "N",
3893
- "symbols": ["N$string$95"],
3945
+ "symbols": ["N$string$96"],
3894
3946
  "postprocess": function postprocess(d) {
3895
3947
  return window.qwc2ExpressionParserContext.username;
3896
3948
  }
3897
3949
  }, {
3898
- "name": "N$string$96",
3950
+ "name": "N$string$97",
3899
3951
  "symbols": [{
3900
3952
  "literal": "@"
3901
3953
  }, {
@@ -3932,7 +3984,7 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
3932
3984
  }
3933
3985
  }, {
3934
3986
  "name": "N",
3935
- "symbols": ["N$string$96"],
3987
+ "symbols": ["N$string$97"],
3936
3988
  "postprocess": function postprocess(d) {
3937
3989
  return window.qwc2ExpressionParserContext.username;
3938
3990
  }
@@ -183,6 +183,7 @@ N -> float {% id %}
183
183
  | "string_to_array" _ "(" _ P0 _ ")" {% function(d) { return d[4].split(","); } %}
184
184
  | "string_to_array" _ "(" _ P0 _ "," _ P1 _ ")" {% function(d) { return d[4].split(d[8]); } %}
185
185
  | "string_to_array" _ "(" _ P0 _ "," _ P1 _ "," _ P2 _ ")" {% function(d) { return d[4].split(d[8]).map(x => String(x).length === 0 ? d[12] : x); } %}
186
+ | "overlay_intersects" _ "(" _ var_args _ ")" {% function(d) { return window.qwc2ExpressionParserContext.overlayIntersects(d[4]); } %}
186
187
  | "map" _ "(" _ var_args _ ")" {% function(d) { return Object.fromValues(Array.from({length: d[4].length / 2 }, (_, i) => [d[4][2 * i], d[4][2 * i + 1]])); } %}
187
188
  | "PI"i {% function(d) { return Math.PI; } %}
188
189
  | "E"i {% function(d) { return Math.E; } %}