qwc2 2025.11.5 → 2025.11.13
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/actions/layers.js +6 -29
- package/components/AttributeForm.js +104 -77
- package/components/AttributeTableWidget.js +89 -88
- package/components/IdentifyViewer.js +4 -2
- package/components/LinkFeatureForm.js +17 -9
- package/components/LocationRecorder.js +1 -1
- package/components/PickFeature.js +45 -33
- package/components/QtDesignerForm.js +20 -18
- package/components/StandardApp.js +4 -0
- package/components/ThemeList.js +9 -10
- package/package.json +2 -1
- package/plugins/Cyclomedia.js +1 -1
- package/plugins/Editing.js +306 -72
- package/plugins/FeatureForm.js +103 -111
- package/plugins/LayerTree.js +4 -1
- package/plugins/NewsPopup.js +2 -2
- package/plugins/Portal.js +3 -1
- package/plugins/Print.js +4 -4
- package/plugins/ThemeSwitcher.js +3 -0
- package/plugins/map/EditingSupport.js +2 -2
- package/plugins/map/RedliningSupport.js +1 -1
- package/plugins/style/Editing.css +34 -0
- package/reducers/editing.js +12 -7
- package/reducers/layers.js +27 -5
- package/reducers/locale.js +3 -0
- package/static/translations/bg-BG.json +9 -0
- package/static/translations/ca-ES.json +9 -0
- package/static/translations/cs-CZ.json +9 -0
- package/static/translations/de-CH.json +9 -0
- package/static/translations/de-DE.json +9 -0
- package/static/translations/en-US.json +9 -0
- package/static/translations/es-ES.json +9 -0
- package/static/translations/fi-FI.json +9 -0
- package/static/translations/fr-FR.json +9 -0
- package/static/translations/hu-HU.json +9 -0
- package/static/translations/it-IT.json +9 -0
- package/static/translations/ja-JP.json +9 -0
- package/static/translations/nl-NL.json +9 -0
- package/static/translations/no-NO.json +9 -0
- package/static/translations/pl-PL.json +9 -0
- package/static/translations/pt-BR.json +9 -0
- package/static/translations/pt-PT.json +9 -0
- package/static/translations/ro-RO.json +9 -0
- package/static/translations/ru-RU.json +9 -0
- package/static/translations/sv-SE.json +9 -0
- package/static/translations/tr-TR.json +9 -0
- package/static/translations/tsconfig.json +9 -0
- package/static/translations/uk-UA.json +9 -0
- package/utils/EditingUtils.js +11 -9
- package/utils/ElevationInterface.js +1 -2
- package/utils/LayerUtils.js +11 -7
- package/utils/LocaleUtils.js +0 -15
- package/utils/ServiceLayerUtils.js +55 -2
- package/utils/ThemeUtils.js +7 -2
package/utils/LayerUtils.js
CHANGED
|
@@ -864,14 +864,16 @@ var LayerUtils = {
|
|
|
864
864
|
}
|
|
865
865
|
return null;
|
|
866
866
|
},
|
|
867
|
-
searchLayer: function searchLayer(layers,
|
|
867
|
+
searchLayer: function searchLayer(layers, attr, value, subattr, subval) {
|
|
868
868
|
var match = null;
|
|
869
869
|
layers.find(function (layer) {
|
|
870
870
|
var sublayer = null;
|
|
871
|
-
|
|
871
|
+
var path = [];
|
|
872
|
+
if (layer[attr] === value && (sublayer = LayerUtils.searchSubLayer(layer, subattr, subval, path))) {
|
|
872
873
|
match = {
|
|
873
874
|
layer: layer,
|
|
874
|
-
sublayer: sublayer
|
|
875
|
+
sublayer: sublayer,
|
|
876
|
+
path: path
|
|
875
877
|
};
|
|
876
878
|
return true;
|
|
877
879
|
}
|
|
@@ -1464,16 +1466,18 @@ var LayerUtils = {
|
|
|
1464
1466
|
return reports;
|
|
1465
1467
|
},
|
|
1466
1468
|
computeVisbilityPreset: function computeVisbilityPreset(layer) {
|
|
1469
|
+
var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
1467
1470
|
var result = {};
|
|
1468
1471
|
if (layer.sublayers) {
|
|
1472
|
+
var istoplevel = !!layer.url;
|
|
1469
1473
|
layer.sublayers.forEach(function (sublayer) {
|
|
1470
|
-
return Object.assign(result, LayerUtils.computeVisbilityPreset(sublayer));
|
|
1474
|
+
return Object.assign(result, LayerUtils.computeVisbilityPreset(sublayer, !istoplevel ? path + layer.name + "/" : ""));
|
|
1471
1475
|
});
|
|
1472
|
-
if (layer.visibility && !
|
|
1473
|
-
result[layer.name] = "";
|
|
1476
|
+
if (layer.visibility && !istoplevel) {
|
|
1477
|
+
result[path + layer.name] = "";
|
|
1474
1478
|
}
|
|
1475
1479
|
} else if (layer.visibility) {
|
|
1476
|
-
result[layer.name] = layer.style;
|
|
1480
|
+
result[path + layer.name] = layer.style;
|
|
1477
1481
|
}
|
|
1478
1482
|
return result;
|
|
1479
1483
|
},
|
package/utils/LocaleUtils.js
CHANGED
|
@@ -11,7 +11,6 @@ import axios from 'axios';
|
|
|
11
11
|
import deepmerge from 'deepmerge';
|
|
12
12
|
import StandardApp from '../components/StandardApp';
|
|
13
13
|
import ConfigUtils from './ConfigUtils';
|
|
14
|
-
var themeTranslationCache = {};
|
|
15
14
|
var LocaleUtils = {
|
|
16
15
|
loadLocale: function loadLocale(lang, fallbackLangData) {
|
|
17
16
|
return new Promise(function (resolve) {
|
|
@@ -105,20 +104,6 @@ var LocaleUtils = {
|
|
|
105
104
|
} else {
|
|
106
105
|
return number.toFixed(decimals);
|
|
107
106
|
}
|
|
108
|
-
},
|
|
109
|
-
loadThemeTranslations: function loadThemeTranslations(serviceUrl) {
|
|
110
|
-
return new Promise(function (resolve) {
|
|
111
|
-
if (serviceUrl in themeTranslationCache) {
|
|
112
|
-
resolve(themeTranslationCache[serviceUrl]);
|
|
113
|
-
} else {
|
|
114
|
-
axios.get(serviceUrl + "?SERVICE=GetTranslations&LANG=" + LocaleUtils.lang()).then(function (response) {
|
|
115
|
-
themeTranslationCache[serviceUrl] = response.data;
|
|
116
|
-
resolve(response.data);
|
|
117
|
-
})["catch"](function (e) {
|
|
118
|
-
resolve({});
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
107
|
}
|
|
123
108
|
};
|
|
124
109
|
export default LocaleUtils;
|
|
@@ -34,7 +34,9 @@ import { LayerRole } from '../actions/layers';
|
|
|
34
34
|
import ConfigUtils from './ConfigUtils';
|
|
35
35
|
import CoordinatesUtils from './CoordinatesUtils';
|
|
36
36
|
import LayerUtils from './LayerUtils';
|
|
37
|
+
import LocaleUtils from './LocaleUtils';
|
|
37
38
|
import MiscUtils from './MiscUtils';
|
|
39
|
+
import StandardApp from '../components/StandardApp';
|
|
38
40
|
function strcmp(a, b) {
|
|
39
41
|
var al = a.toLowerCase();
|
|
40
42
|
var bl = b.toLowerCase();
|
|
@@ -298,6 +300,20 @@ var ServiceLayerUtils = {
|
|
|
298
300
|
} catch (e) {
|
|
299
301
|
/* pass */
|
|
300
302
|
}
|
|
303
|
+
var editConfigUrl = null;
|
|
304
|
+
var wmsName = null;
|
|
305
|
+
try {
|
|
306
|
+
editConfigUrl = layer.EditConfig.OnlineResource.href;
|
|
307
|
+
wmsName = layer.EditConfig.wms_name;
|
|
308
|
+
} catch (e) {
|
|
309
|
+
/* pass */
|
|
310
|
+
}
|
|
311
|
+
var translationsUrl = null;
|
|
312
|
+
try {
|
|
313
|
+
translationsUrl = layer.Traslations.OnlineResource.href;
|
|
314
|
+
} catch (e) {
|
|
315
|
+
/* pass */
|
|
316
|
+
}
|
|
301
317
|
var dimensions = [];
|
|
302
318
|
MiscUtils.ensureArray(layer.Dimension).forEach(function (dim) {
|
|
303
319
|
var _dim$fieldName, _dim$endFieldName;
|
|
@@ -327,6 +343,9 @@ var ServiceLayerUtils = {
|
|
|
327
343
|
url: getMapUrl,
|
|
328
344
|
featureInfoUrl: featureInfoUrl,
|
|
329
345
|
legendUrl: legendUrl,
|
|
346
|
+
editConfigUrl: editConfigUrl,
|
|
347
|
+
translationsUrl: translationsUrl,
|
|
348
|
+
wms_name: wmsName,
|
|
330
349
|
version: version,
|
|
331
350
|
infoFormats: infoFormats,
|
|
332
351
|
mapFormats: mapFormats,
|
|
@@ -341,7 +360,8 @@ var ServiceLayerUtils = {
|
|
|
341
360
|
maxScale: layer.MinScaleDenominator !== undefined ? Number(layer.MaxScaleDenominator) : undefined,
|
|
342
361
|
dimensions: dimensions,
|
|
343
362
|
styles: styles,
|
|
344
|
-
style: style
|
|
363
|
+
style: style,
|
|
364
|
+
serverType: translationsUrl ? 'qgis' : null // If there is a translationsUrl, assume it is the qwc-ogc-service
|
|
345
365
|
};
|
|
346
366
|
},
|
|
347
367
|
getWFSLayers: function getWFSLayers(capabilities, calledServiceUrl, mapCrs) {
|
|
@@ -606,7 +626,40 @@ var ServiceLayerUtils = {
|
|
|
606
626
|
LAYERS: layerConfig.name
|
|
607
627
|
};
|
|
608
628
|
}
|
|
609
|
-
|
|
629
|
+
var metadataRequests = [new Promise(function (resolve, reject) {
|
|
630
|
+
if (layer.editConfigUrl) {
|
|
631
|
+
axios.get(layer.editConfigUrl).then(function (response) {
|
|
632
|
+
layer.editConfig = response.data;
|
|
633
|
+
delete layer.editConfigUrl;
|
|
634
|
+
resolve();
|
|
635
|
+
})["catch"](function (e) {
|
|
636
|
+
delete layer.editConfigUrl;
|
|
637
|
+
resolve();
|
|
638
|
+
});
|
|
639
|
+
} else {
|
|
640
|
+
resolve();
|
|
641
|
+
}
|
|
642
|
+
}), new Promise(function (resolve, reject) {
|
|
643
|
+
if (layer.translationsUrl) {
|
|
644
|
+
axios.get(layer.translationsUrl.replace('{lang}', LocaleUtils.lang())).then(function (response) {
|
|
645
|
+
layer.translations = response.data;
|
|
646
|
+
delete layer.translationsUrl;
|
|
647
|
+
resolve();
|
|
648
|
+
})["catch"](function (e) {
|
|
649
|
+
delete layer.translationsUrl;
|
|
650
|
+
resolve();
|
|
651
|
+
});
|
|
652
|
+
} else {
|
|
653
|
+
resolve();
|
|
654
|
+
}
|
|
655
|
+
})];
|
|
656
|
+
Promise.all(metadataRequests).then(function () {
|
|
657
|
+
if (layer.translations) {
|
|
658
|
+
var commonTranslations = StandardApp.store.getState().locale.messagesTree.maptranslations || {};
|
|
659
|
+
layer = LayerUtils.applyTranslations(layer, deepmerge(commonTranslations, layer.translations));
|
|
660
|
+
}
|
|
661
|
+
callback(layerConfig.id, layer);
|
|
662
|
+
});
|
|
610
663
|
} else {
|
|
611
664
|
// eslint-disable-next-line
|
|
612
665
|
console.warn("Could not find layer " + layerConfig.name);
|
package/utils/ThemeUtils.js
CHANGED
|
@@ -19,11 +19,13 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
19
19
|
* LICENSE file in the root directory of this source tree.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
+
import deepmerge from 'deepmerge';
|
|
22
23
|
import { remove as removeDiacritics } from 'diacritics';
|
|
23
24
|
import isEmpty from 'lodash.isempty';
|
|
24
25
|
import url from 'url';
|
|
25
26
|
import { v4 as uuidv4 } from 'uuid';
|
|
26
27
|
import { LayerRole } from '../actions/layers';
|
|
28
|
+
import StandardApp from '../components/StandardApp';
|
|
27
29
|
import { SearchResultType } from '../utils/SearchProviders';
|
|
28
30
|
import ConfigUtils from './ConfigUtils';
|
|
29
31
|
import LayerUtils from './LayerUtils';
|
|
@@ -173,7 +175,9 @@ var ThemeUtils = {
|
|
|
173
175
|
LayerUtils.completeExternalLayer(res[cur.internalLayer], LayerUtils.searchSubLayer(theme, 'name', cur.internalLayer));
|
|
174
176
|
return res;
|
|
175
177
|
}, {})),
|
|
176
|
-
translations: theme.translations
|
|
178
|
+
translations: theme.translations,
|
|
179
|
+
editConfig: theme.editConfig,
|
|
180
|
+
wms_name: theme.wms_name
|
|
177
181
|
};
|
|
178
182
|
layer = LayerUtils.recomputeLayerBBox(layer);
|
|
179
183
|
// Drawing order only makes sense if layer reordering is disabled
|
|
@@ -332,11 +336,12 @@ var ThemeUtils = {
|
|
|
332
336
|
}).filter(Boolean);
|
|
333
337
|
},
|
|
334
338
|
applyTranslations: function applyTranslations(group) {
|
|
339
|
+
var commonTranslations = StandardApp.store.getState().locale.messagesTree.maptranslations || {};
|
|
335
340
|
return _objectSpread(_objectSpread({}, group), {}, {
|
|
336
341
|
subdirs: group.subdirs ? group.subdirs.map(ThemeUtils.applyTranslations) : null,
|
|
337
342
|
items: group.items ? group.items.map(function (item) {
|
|
338
343
|
var _item$translations$th, _item$translations;
|
|
339
|
-
return _objectSpread(_objectSpread({}, LayerUtils.applyTranslations(item, item.translations)), {}, {
|
|
344
|
+
return _objectSpread(_objectSpread({}, LayerUtils.applyTranslations(item, deepmerge(commonTranslations, item.translations))), {}, {
|
|
340
345
|
title: (_item$translations$th = (_item$translations = item.translations) === null || _item$translations === void 0 || (_item$translations = _item$translations.theme) === null || _item$translations === void 0 ? void 0 : _item$translations.title) !== null && _item$translations$th !== void 0 ? _item$translations$th : item.title
|
|
341
346
|
});
|
|
342
347
|
}) : null
|