qwc2 2025.12.2 → 2025.12.4

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.
@@ -22,6 +22,7 @@ import ReducerIndex from '../reducers/index';
22
22
  import windowsReducer from '../reducers/windows';
23
23
  import ConfigUtils from '../utils/ConfigUtils';
24
24
  import CoordinatesUtils from '../utils/CoordinatesUtils';
25
+ import LocaleUtils from '../utils/LocaleUtils';
25
26
  import MapUtils from '../utils/MapUtils';
26
27
  import { UrlParams } from '../utils/PermaLinkUtils';
27
28
  ReducerIndex.register("windows", windowsReducer);
@@ -153,6 +154,7 @@ export function openExternalUrl(url) {
153
154
  url = url.replace('$y$', y);
154
155
  url = url.replace('$crs$', proj);
155
156
  url = url.replace('$user$', ConfigUtils.getConfigProp("username") || "");
157
+ url = url.replace('$lang$', LocaleUtils.lang());
156
158
  if (target.startsWith(":iframedialog")) {
157
159
  var targetParts = target.split(":");
158
160
  var options = targetParts.slice(2).reduce(function (res, cur) {
@@ -40,8 +40,15 @@ var Icon = /*#__PURE__*/function (_React$Component) {
40
40
  icon_disabled: this.props.disabled,
41
41
  icon_clickable: !!this.props.onClick || !!this.props.onMouseDown || !!this.props.onPointerDown
42
42
  }, "icon-" + this.props.icon, true), "icon_" + this.props.size, !!this.props.size), this.props.className, !!this.props.className));
43
- var tabIndex = this.props.onClick ? 0 : undefined;
44
- var onKeyDown = tabIndex !== undefined ? MiscUtils.checkKeyActivate : null;
43
+ var tabIndex = undefined;
44
+ var onKeyDown = null;
45
+ if (this.props.onClick) {
46
+ tabIndex = 0;
47
+ onKeyDown = MiscUtils.checkKeyActivate;
48
+ } else if (this.props.onPointerDown) {
49
+ tabIndex = 0;
50
+ onKeyDown = MiscUtils.checkKeyActivatePointerDown;
51
+ }
45
52
  if (this.props.icon.startsWith(":/")) {
46
53
  var assetsPath = ConfigUtils.getAssetsPath();
47
54
  var src = assetsPath + this.props.icon.substr(1);
@@ -1100,7 +1100,7 @@ var IdentifyViewer = /*#__PURE__*/function (_React$Component) {
1100
1100
  return htmlReactParser(text, options);
1101
1101
  });
1102
1102
  _defineProperty(_this, "attributeLinkClicked", function (ev) {
1103
- _this.props.openExternalUrl(ev.currentTarget.href, ev.target.target, {
1103
+ _this.props.openExternalUrl(ev.currentTarget.href, ev.currentTarget.target, {
1104
1104
  docked: _this.props.iframeDialogsInitiallyDocked
1105
1105
  });
1106
1106
  ev.preventDefault();
@@ -348,28 +348,26 @@ var MapControls3D = /*#__PURE__*/function (_React$Component) {
348
348
  style: {
349
349
  order: 998
350
350
  }
351
- }, /*#__PURE__*/React.createElement("div", {
351
+ }, /*#__PURE__*/React.createElement(Icon, {
352
+ icon: "plus",
352
353
  onPointerDown: function onPointerDown(ev) {
353
354
  return _this2.zoom(ev, +1);
354
355
  }
355
- }, /*#__PURE__*/React.createElement(Icon, {
356
- icon: "plus"
357
- })), /*#__PURE__*/React.createElement("div", {
356
+ }), /*#__PURE__*/React.createElement(Icon, {
357
+ icon: "minus",
358
358
  onPointerDown: function onPointerDown(ev) {
359
359
  return _this2.zoom(ev, -1);
360
360
  }
361
- }, /*#__PURE__*/React.createElement(Icon, {
362
- icon: "minus"
363
- }))) : null, this.context), /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/React.createElement("div", {
361
+ })) : null, this.context), /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/React.createElement("div", {
364
362
  className: firstPersonButtonClasses,
365
363
  "data-slot": 0,
366
364
  key: "MapControlsFirstPerson",
367
- onClick: this.toggleFirstPersonControls,
368
365
  style: {
369
366
  order: 997
370
367
  }
371
368
  }, /*#__PURE__*/React.createElement(Icon, {
372
- icon: "person"
369
+ icon: "person",
370
+ onClick: this.toggleFirstPersonControls
373
371
  })), this.context), this.props.controlsPosition !== 'bottom' ? /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/React.createElement("div", {
374
372
  className: "map3d-nav-spacer",
375
373
  key: "MapControlsSpacer",
@@ -39,7 +39,7 @@ div.map3d-nav-zoom {
39
39
  margin: 0 1em 0.5em 1em;
40
40
  }
41
41
 
42
- div.map3d-nav-zoom > div {
42
+ div.map3d-nav-zoom > span {
43
43
  height: 2em;
44
44
  width: 1.5em;
45
45
  display: flex;
@@ -47,7 +47,7 @@ div.map3d-nav-zoom > div {
47
47
  justify-content: center;
48
48
  }
49
49
 
50
- div.map3d-nav-zoom > div:first-child {
50
+ div.map3d-nav-zoom > span:first-child {
51
51
  border-bottom: 1px solid var(--map-button-text-color);
52
52
  }
53
53
 
@@ -74,6 +74,11 @@ div.map3d-firstperson-button-active {
74
74
  color: var(--map-button-bg-color);
75
75
  }
76
76
 
77
+ div.map3d-firstperson-button > span {
78
+ width: 2em;
79
+ height: 2em;
80
+ }
81
+
77
82
  div.map3d-nav-spacer {
78
83
  display: inline-block;
79
84
  width: 1em;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qwc2",
3
- "version": "2025.12.02",
3
+ "version": "2025.12.04",
4
4
  "description": "QGIS Web Client",
5
5
  "author": "Sourcepole AG",
6
6
  "license": "BSD-2-Clause",
package/plugins/MapTip.js CHANGED
@@ -177,7 +177,7 @@ var MapTip = /*#__PURE__*/function (_React$Component) {
177
177
  return htmlReactParser(text, options);
178
178
  });
179
179
  _defineProperty(_this, "attributeLinkClicked", function (ev) {
180
- _this.props.openExternalUrl(ev.currentTarget.href, ev.target.target, {
180
+ _this.props.openExternalUrl(ev.currentTarget.href, ev.currentTarget.target, {
181
181
  docked: _this.props.iframeDialogsInitiallyDocked
182
182
  });
183
183
  ev.preventDefault();
@@ -640,6 +640,7 @@ function getGroupThemes(config, configGroup, result, resultGroup, proxy, groupCo
640
640
  var groupEntry = {
641
641
  id: 'g' + ++groupCounter,
642
642
  title: group.title,
643
+ titleMsgId: group.titleMsgId,
643
644
  items: [],
644
645
  subdirs: []
645
646
  };
@@ -588,6 +588,7 @@ def getGroupThemes(config, configGroup, result, resultGroup, groupCounter):
588
588
  groupEntry = {
589
589
  "id": "g%d" % groupCounter,
590
590
  "title": group["title"],
591
+ "titleMsgId": group["titleMsgId"],
591
592
  "items": [],
592
593
  "subdirs": []
593
594
  }
@@ -167,6 +167,8 @@ var CoordinatesUtils = {
167
167
  if (commonEsriWktLookup[epsgCode]) {
168
168
  return commonEsriWktLookup[epsgCode];
169
169
  }
170
+
171
+ /* eslint-disable-next-line */
170
172
  console.warn("No ESRI WKT definition found for ".concat(epsgCode, ". Shapefile export may not include projection information. Consider adding an 'esriWkt' property to the projection in config.json."));
171
173
  return null;
172
174
  },
@@ -25,6 +25,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
25
25
  import axios from 'axios';
26
26
  import isEmpty from 'lodash.isempty';
27
27
  import ConfigUtils from './ConfigUtils';
28
+ import CoordinatesUtils from './CoordinatesUtils';
28
29
  import { computeExpressionFields } from './EditingUtils';
29
30
  import LocaleUtils from './LocaleUtils';
30
31
  var EditingInterface = {
@@ -86,8 +87,16 @@ var EditingInterface = {
86
87
  var requestUrl = editServiceUrl + '/' + editConfig.editDataset + '/';
87
88
 
88
89
  // 10px tolerance
89
- var tol = 10.0 / dpi * 0.0254 * mapScale;
90
- var bbox = mapPos[0] - tol + "," + (mapPos[1] - tol) + "," + (mapPos[0] + tol) + "," + (mapPos[1] + tol);
90
+ var bbox = null;
91
+ var metersPerPixel = 1 / dpi * 0.0254 * mapScale;
92
+ if (CoordinatesUtils.getUnits(mapCrs) === 'degrees') {
93
+ var tolLat = 10 * metersPerPixel / 111320.0; // meters per degree latitude
94
+ var tolLon = 10 * metersPerPixel / (111320.0 * Math.cos(mapPos[1] * Math.PI / 180));
95
+ bbox = [mapPos[0] - tolLon, mapPos[1] - tolLat, mapPos[0] + tolLon, mapPos[1] + tolLat].join(",");
96
+ } else {
97
+ var tol = 10 * metersPerPixel;
98
+ bbox = mapPos[0] - tol + "," + (mapPos[1] - tol) + "," + (mapPos[0] + tol) + "," + (mapPos[1] + tol);
99
+ }
91
100
  var params = {
92
101
  bbox: bbox,
93
102
  crs: mapCrs,
@@ -101,6 +101,29 @@ var MiscUtils = {
101
101
  onEsc();
102
102
  }
103
103
  },
104
+ checkKeyActivatePointerDown: function checkKeyActivatePointerDown(ev) {
105
+ if (ev.code === "Space" || ev.code === "Enter") {
106
+ MiscUtils.killEvent(ev);
107
+ ev.currentTarget.dispatchEvent(new PointerEvent("pointerdown", {
108
+ bubbles: true,
109
+ cancelable: true,
110
+ pointerId: 1,
111
+ pointerType: "mouse",
112
+ view: ev.view
113
+ }));
114
+ ev.currentTarget.addEventListener("keyup", function (ev2) {
115
+ ev2.currentTarget.dispatchEvent(new PointerEvent("pointerup", {
116
+ bubbles: true,
117
+ cancelable: true,
118
+ pointerId: 1,
119
+ pointerType: "mouse",
120
+ view: ev2.view
121
+ }));
122
+ }, {
123
+ once: true
124
+ });
125
+ }
126
+ },
104
127
  blendColors: function blendColors(color1, color2, ratio) {
105
128
  color1 = [parseInt(color1[1] + color1[2], 16), parseInt(color1[3] + color1[4], 16), parseInt(color1[5] + color1[6], 16)];
106
129
  color2 = [parseInt(color2[1] + color2[2], 16), parseInt(color2[3] + color2[4], 16), parseInt(color2[5] + color2[6], 16)];