qwc2 2025.10.30 → 2025.11.12
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 +106 -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/components/map3d/Map3D.js +6 -3
- package/package.json +2 -1
- package/plugins/Cyclomedia.js +5 -4
- package/plugins/Editing.js +307 -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/Redlining.js +9 -0
- package/plugins/ThemeSwitcher.js +3 -0
- package/plugins/map/EditingSupport.js +2 -2
- package/plugins/map/RedliningSupport.js +63 -13
- package/plugins/style/Editing.css +34 -0
- package/reducers/editing.js +12 -7
- package/reducers/layers.js +27 -5
- package/static/translations/bg-BG.json +10 -0
- package/static/translations/ca-ES.json +10 -0
- package/static/translations/cs-CZ.json +10 -0
- package/static/translations/de-CH.json +10 -0
- package/static/translations/de-DE.json +10 -0
- package/static/translations/en-US.json +11 -1
- package/static/translations/es-ES.json +10 -0
- package/static/translations/fi-FI.json +10 -0
- package/static/translations/fr-FR.json +10 -0
- package/static/translations/hu-HU.json +10 -0
- package/static/translations/it-IT.json +10 -0
- package/static/translations/ja-JP.json +10 -0
- package/static/translations/nl-NL.json +10 -0
- package/static/translations/no-NO.json +10 -0
- package/static/translations/pl-PL.json +10 -0
- package/static/translations/pt-BR.json +10 -0
- package/static/translations/pt-PT.json +10 -0
- package/static/translations/ro-RO.json +10 -0
- package/static/translations/ru-RU.json +10 -0
- package/static/translations/sv-SE.json +10 -0
- package/static/translations/tr-TR.json +10 -0
- package/static/translations/tsconfig.json +10 -0
- package/static/translations/uk-UA.json +10 -0
- package/utils/EditingUtils.js +15 -13
- package/utils/ElevationInterface.js +1 -2
- package/utils/LayerUtils.js +5 -3
- package/utils/MapUtils.js +2 -11
- package/utils/ServiceLayerUtils.js +53 -2
- package/utils/ThemeUtils.js +3 -1
|
@@ -169,6 +169,14 @@
|
|
|
169
169
|
"attrtable": "Tabela de Atributos",
|
|
170
170
|
"canceldelete": "Cancelar Eliminação",
|
|
171
171
|
"clearpicture": "Limpar Imagem",
|
|
172
|
+
"clone_all": "",
|
|
173
|
+
"clone_copy": "",
|
|
174
|
+
"clone_defaulted": "",
|
|
175
|
+
"clone_dontcopy": "",
|
|
176
|
+
"clone_hidden": "",
|
|
177
|
+
"clone_none": "",
|
|
178
|
+
"clone_select_attrs": "",
|
|
179
|
+
"clone_visible": "",
|
|
172
180
|
"commit": "Confirmar",
|
|
173
181
|
"commitfailed": "Falha ao Confirmar",
|
|
174
182
|
"contraintviolation": "",
|
|
@@ -189,6 +197,7 @@
|
|
|
189
197
|
"reallydelete": "Eliminar",
|
|
190
198
|
"relationcommitfailed": "Falha ao Confirmar Relação",
|
|
191
199
|
"select": "Selecionar",
|
|
200
|
+
"selectlayer": "",
|
|
192
201
|
"takepicture": "Tirar Fotografia",
|
|
193
202
|
"unsavedchanged": "Alterações Não Guardadas"
|
|
194
203
|
},
|
|
@@ -500,6 +509,7 @@
|
|
|
500
509
|
"bufferlayername": "Nome da Camada de Tampão",
|
|
501
510
|
"bufferselectfeature": "Selecione uma característica para o tampão...",
|
|
502
511
|
"circle": "Círculo",
|
|
512
|
+
"clone": "",
|
|
503
513
|
"ctrlhint": "",
|
|
504
514
|
"delete": "Excluir",
|
|
505
515
|
"draw": "Desenhar",
|
|
@@ -169,6 +169,14 @@
|
|
|
169
169
|
"attrtable": "Tabel",
|
|
170
170
|
"canceldelete": "Nu șterge",
|
|
171
171
|
"clearpicture": "Elimină imaginea",
|
|
172
|
+
"clone_all": "",
|
|
173
|
+
"clone_copy": "",
|
|
174
|
+
"clone_defaulted": "",
|
|
175
|
+
"clone_dontcopy": "",
|
|
176
|
+
"clone_hidden": "",
|
|
177
|
+
"clone_none": "",
|
|
178
|
+
"clone_select_attrs": "",
|
|
179
|
+
"clone_visible": "",
|
|
172
180
|
"commit": "Salvează",
|
|
173
181
|
"commitfailed": "Salvarea a eșuat",
|
|
174
182
|
"contraintviolation": "",
|
|
@@ -189,6 +197,7 @@
|
|
|
189
197
|
"reallydelete": "Șterge",
|
|
190
198
|
"relationcommitfailed": "Salvarea relației a eșuat, vă rugăm să verificați informațiile asociate iconițelor",
|
|
191
199
|
"select": "Selectează",
|
|
200
|
+
"selectlayer": "",
|
|
192
201
|
"takepicture": "Fotografiază",
|
|
193
202
|
"unsavedchanged": "Modificările nu sunt salvate. Doriți să părăsiți pagina oricum?"
|
|
194
203
|
},
|
|
@@ -500,6 +509,7 @@
|
|
|
500
509
|
"bufferlayername": "Zonă tampon",
|
|
501
510
|
"bufferselectfeature": "Selectați o entitate...",
|
|
502
511
|
"circle": "Cerc",
|
|
512
|
+
"clone": "",
|
|
503
513
|
"ctrlhint": "",
|
|
504
514
|
"delete": "Elimină",
|
|
505
515
|
"draw": "Desenare",
|
|
@@ -169,6 +169,14 @@
|
|
|
169
169
|
"attrtable": "",
|
|
170
170
|
"canceldelete": "Не удалять",
|
|
171
171
|
"clearpicture": "",
|
|
172
|
+
"clone_all": "",
|
|
173
|
+
"clone_copy": "",
|
|
174
|
+
"clone_defaulted": "",
|
|
175
|
+
"clone_dontcopy": "",
|
|
176
|
+
"clone_hidden": "",
|
|
177
|
+
"clone_none": "",
|
|
178
|
+
"clone_select_attrs": "",
|
|
179
|
+
"clone_visible": "",
|
|
172
180
|
"commit": "Подтвердить изменения",
|
|
173
181
|
"commitfailed": "",
|
|
174
182
|
"contraintviolation": "",
|
|
@@ -189,6 +197,7 @@
|
|
|
189
197
|
"reallydelete": "Удалить",
|
|
190
198
|
"relationcommitfailed": "",
|
|
191
199
|
"select": "Выберите...",
|
|
200
|
+
"selectlayer": "",
|
|
192
201
|
"takepicture": "",
|
|
193
202
|
"unsavedchanged": ""
|
|
194
203
|
},
|
|
@@ -500,6 +509,7 @@
|
|
|
500
509
|
"bufferlayername": "",
|
|
501
510
|
"bufferselectfeature": "",
|
|
502
511
|
"circle": "",
|
|
512
|
+
"clone": "",
|
|
503
513
|
"ctrlhint": "",
|
|
504
514
|
"delete": "",
|
|
505
515
|
"draw": "",
|
|
@@ -169,6 +169,14 @@
|
|
|
169
169
|
"attrtable": "",
|
|
170
170
|
"canceldelete": "Radera inte",
|
|
171
171
|
"clearpicture": "",
|
|
172
|
+
"clone_all": "",
|
|
173
|
+
"clone_copy": "",
|
|
174
|
+
"clone_defaulted": "",
|
|
175
|
+
"clone_dontcopy": "",
|
|
176
|
+
"clone_hidden": "",
|
|
177
|
+
"clone_none": "",
|
|
178
|
+
"clone_select_attrs": "",
|
|
179
|
+
"clone_visible": "",
|
|
172
180
|
"commit": "Skicka",
|
|
173
181
|
"commitfailed": "",
|
|
174
182
|
"contraintviolation": "",
|
|
@@ -189,6 +197,7 @@
|
|
|
189
197
|
"reallydelete": "Verkligen radera",
|
|
190
198
|
"relationcommitfailed": "",
|
|
191
199
|
"select": "Välj",
|
|
200
|
+
"selectlayer": "",
|
|
192
201
|
"takepicture": "",
|
|
193
202
|
"unsavedchanged": ""
|
|
194
203
|
},
|
|
@@ -500,6 +509,7 @@
|
|
|
500
509
|
"bufferlayername": "Buffert",
|
|
501
510
|
"bufferselectfeature": "Välj ett objekt att buffra",
|
|
502
511
|
"circle": "",
|
|
512
|
+
"clone": "",
|
|
503
513
|
"ctrlhint": "",
|
|
504
514
|
"delete": "Radera",
|
|
505
515
|
"draw": "Rita",
|
|
@@ -169,6 +169,14 @@
|
|
|
169
169
|
"attrtable": "Tablo",
|
|
170
170
|
"canceldelete": "Silme",
|
|
171
171
|
"clearpicture": "Temizle",
|
|
172
|
+
"clone_all": "",
|
|
173
|
+
"clone_copy": "",
|
|
174
|
+
"clone_defaulted": "",
|
|
175
|
+
"clone_dontcopy": "",
|
|
176
|
+
"clone_hidden": "",
|
|
177
|
+
"clone_none": "",
|
|
178
|
+
"clone_select_attrs": "",
|
|
179
|
+
"clone_visible": "",
|
|
172
180
|
"commit": "Onayla",
|
|
173
181
|
"commitfailed": "Kayıt başarısız",
|
|
174
182
|
"contraintviolation": "Kısıtlama ihlali",
|
|
@@ -189,6 +197,7 @@
|
|
|
189
197
|
"reallydelete": "Sil",
|
|
190
198
|
"relationcommitfailed": "Bazı ilişkili kayıtlar güncellenemedi, detay için ipucu ikonunu kontrol ediniz",
|
|
191
199
|
"select": "Seçim",
|
|
200
|
+
"selectlayer": "",
|
|
192
201
|
"takepicture": "Fotoğraf çek",
|
|
193
202
|
"unsavedchanged": "Kaydedilmemiş değişiklikler mevcut. Yine de sayfadan ayrılmak istiyor musunuz?"
|
|
194
203
|
},
|
|
@@ -500,6 +509,7 @@
|
|
|
500
509
|
"bufferlayername": "Tampon",
|
|
501
510
|
"bufferselectfeature": "Tampon atılacak bir obje seçiniz...",
|
|
502
511
|
"circle": "Daire",
|
|
512
|
+
"clone": "",
|
|
503
513
|
"ctrlhint": "",
|
|
504
514
|
"delete": "Sil",
|
|
505
515
|
"draw": "Çiz",
|
|
@@ -174,6 +174,14 @@
|
|
|
174
174
|
"editing.attrtable",
|
|
175
175
|
"editing.canceldelete",
|
|
176
176
|
"editing.clearpicture",
|
|
177
|
+
"editing.clone_all",
|
|
178
|
+
"editing.clone_copy",
|
|
179
|
+
"editing.clone_defaulted",
|
|
180
|
+
"editing.clone_dontcopy",
|
|
181
|
+
"editing.clone_hidden",
|
|
182
|
+
"editing.clone_none",
|
|
183
|
+
"editing.clone_select_attrs",
|
|
184
|
+
"editing.clone_visible",
|
|
177
185
|
"editing.commit",
|
|
178
186
|
"editing.commitfailed",
|
|
179
187
|
"editing.contraintviolation",
|
|
@@ -194,6 +202,7 @@
|
|
|
194
202
|
"editing.reallydelete",
|
|
195
203
|
"editing.relationcommitfailed",
|
|
196
204
|
"editing.select",
|
|
205
|
+
"editing.selectlayer",
|
|
197
206
|
"editing.takepicture",
|
|
198
207
|
"editing.unsavedchanged",
|
|
199
208
|
"featureattributes.name",
|
|
@@ -429,6 +438,7 @@
|
|
|
429
438
|
"redlining.bufferlayername",
|
|
430
439
|
"redlining.bufferselectfeature",
|
|
431
440
|
"redlining.circle",
|
|
441
|
+
"redlining.clone",
|
|
432
442
|
"redlining.ctrlhint",
|
|
433
443
|
"redlining.delete",
|
|
434
444
|
"redlining.draw",
|
|
@@ -169,6 +169,14 @@
|
|
|
169
169
|
"attrtable": "",
|
|
170
170
|
"canceldelete": "Не видаляти",
|
|
171
171
|
"clearpicture": "",
|
|
172
|
+
"clone_all": "",
|
|
173
|
+
"clone_copy": "",
|
|
174
|
+
"clone_defaulted": "",
|
|
175
|
+
"clone_dontcopy": "",
|
|
176
|
+
"clone_hidden": "",
|
|
177
|
+
"clone_none": "",
|
|
178
|
+
"clone_select_attrs": "",
|
|
179
|
+
"clone_visible": "",
|
|
172
180
|
"commit": "Підтвердити зміни",
|
|
173
181
|
"commitfailed": "",
|
|
174
182
|
"contraintviolation": "",
|
|
@@ -189,6 +197,7 @@
|
|
|
189
197
|
"reallydelete": "Видалити",
|
|
190
198
|
"relationcommitfailed": "",
|
|
191
199
|
"select": "Виберіть...",
|
|
200
|
+
"selectlayer": "",
|
|
192
201
|
"takepicture": "",
|
|
193
202
|
"unsavedchanged": ""
|
|
194
203
|
},
|
|
@@ -500,6 +509,7 @@
|
|
|
500
509
|
"bufferlayername": "",
|
|
501
510
|
"bufferselectfeature": "",
|
|
502
511
|
"circle": "",
|
|
512
|
+
"clone": "",
|
|
503
513
|
"ctrlhint": "",
|
|
504
514
|
"delete": "",
|
|
505
515
|
"draw": "",
|
package/utils/EditingUtils.js
CHANGED
|
@@ -41,7 +41,7 @@ export var FeatureCache = /*#__PURE__*/_createClass(function FeatureCache() {
|
|
|
41
41
|
_FeatureCache = FeatureCache;
|
|
42
42
|
_defineProperty(FeatureCache, "store", {});
|
|
43
43
|
_defineProperty(FeatureCache, "requestPromises", {});
|
|
44
|
-
_defineProperty(FeatureCache, "get", function (editIface, layerName, mapCrs, filterExpr) {
|
|
44
|
+
_defineProperty(FeatureCache, "get", function (editIface, layerName, editConfig, mapCrs, filterExpr) {
|
|
45
45
|
var key = layerName + uuidv5(JSON.stringify(filterExpr !== null && filterExpr !== void 0 ? filterExpr : null), UUID_NS);
|
|
46
46
|
if (key in _FeatureCache.store) {
|
|
47
47
|
return new Promise(function (resolve) {
|
|
@@ -51,8 +51,6 @@ _defineProperty(FeatureCache, "get", function (editIface, layerName, mapCrs, fil
|
|
|
51
51
|
return _FeatureCache.requestPromises[key];
|
|
52
52
|
} else {
|
|
53
53
|
_FeatureCache.requestPromises[key] = new Promise(function (resolve) {
|
|
54
|
-
var _StandardApp$store$ge, _StandardApp$store$ge2;
|
|
55
|
-
var editConfig = (_StandardApp$store$ge = (_StandardApp$store$ge2 = StandardApp.store.getState().theme.current.editConfig) === null || _StandardApp$store$ge2 === void 0 ? void 0 : _StandardApp$store$ge2[layerName]) !== null && _StandardApp$store$ge !== void 0 ? _StandardApp$store$ge : {};
|
|
56
54
|
editIface.getFeatures(editConfig, mapCrs, function (result) {
|
|
57
55
|
if (key in _FeatureCache.requestPromises) {
|
|
58
56
|
if (((result === null || result === void 0 ? void 0 : result.features) || []).length === 1) {
|
|
@@ -72,13 +70,13 @@ _defineProperty(FeatureCache, "get", function (editIface, layerName, mapCrs, fil
|
|
|
72
70
|
return _FeatureCache.requestPromises[key];
|
|
73
71
|
}
|
|
74
72
|
});
|
|
75
|
-
_defineProperty(FeatureCache, "getSync", function (editIface, layerName, mapCrs, filterExpr) {
|
|
76
|
-
var promises = arguments.length >
|
|
73
|
+
_defineProperty(FeatureCache, "getSync", function (editIface, layerName, editConfig, mapCrs, filterExpr) {
|
|
74
|
+
var promises = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : [];
|
|
77
75
|
var key = layerName + uuidv5(JSON.stringify(filterExpr !== null && filterExpr !== void 0 ? filterExpr : null), UUID_NS);
|
|
78
76
|
if (key in _FeatureCache.store) {
|
|
79
77
|
return _FeatureCache.store[key];
|
|
80
78
|
} else {
|
|
81
|
-
promises.push(_FeatureCache.get(editIface, layerName, mapCrs, filterExpr));
|
|
79
|
+
promises.push(_FeatureCache.get(editIface, layerName, editConfig, mapCrs, filterExpr));
|
|
82
80
|
return null;
|
|
83
81
|
}
|
|
84
82
|
});
|
|
@@ -169,10 +167,12 @@ export function parseExpression(expr, feature, editConfig, editIface, mapPrefix,
|
|
|
169
167
|
var reevaluate = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : false;
|
|
170
168
|
var parser = new nearley.Parser(nearley.Grammar.fromCompiled(grammar));
|
|
171
169
|
var promises = [];
|
|
170
|
+
var mapEditConfigs = StandardApp.store.getState().layers.editConfigs[mapPrefix];
|
|
172
171
|
window.qwc2ExpressionParserContext = {
|
|
173
172
|
feature: feature,
|
|
174
173
|
getFeature: function getFeature(layerName, attr, value) {
|
|
175
|
-
|
|
174
|
+
var _mapEditConfigs$layer;
|
|
175
|
+
return FeatureCache.getSync(editIface, layerName, (_mapEditConfigs$layer = mapEditConfigs[layerName]) !== null && _mapEditConfigs$layer !== void 0 ? _mapEditConfigs$layer : {}, mapCrs, [[attr, '=', value]], promises);
|
|
176
176
|
},
|
|
177
177
|
representValue: function representValue(attr) {
|
|
178
178
|
return _representValue(attr, editConfig, editIface, promises);
|
|
@@ -212,6 +212,7 @@ export function parseExpression(expr, feature, editConfig, editIface, mapPrefix,
|
|
|
212
212
|
}
|
|
213
213
|
export function parseExpressionsAsync(fieldExpressions, feature, editConfig, editIface, mapPrefix, mapCrs, asFilter) {
|
|
214
214
|
var promises = [];
|
|
215
|
+
var mapEditConfigs = StandardApp.store.getState().layers.editConfigs[mapPrefix];
|
|
215
216
|
return new Promise(function (resolve) {
|
|
216
217
|
var newfeature = _objectSpread(_objectSpread({}, feature), {}, {
|
|
217
218
|
properties: _objectSpread({}, feature.properties)
|
|
@@ -219,7 +220,8 @@ export function parseExpressionsAsync(fieldExpressions, feature, editConfig, edi
|
|
|
219
220
|
window.qwc2ExpressionParserContext = {
|
|
220
221
|
feature: newfeature,
|
|
221
222
|
getFeature: function getFeature(layerName, attr, value) {
|
|
222
|
-
|
|
223
|
+
var _mapEditConfigs$layer2;
|
|
224
|
+
return FeatureCache.getSync(editIface, layerName, (_mapEditConfigs$layer2 = mapEditConfigs[layerName]) !== null && _mapEditConfigs$layer2 !== void 0 ? _mapEditConfigs$layer2 : {}, mapCrs, [[attr, '=', value]], promises);
|
|
223
225
|
},
|
|
224
226
|
representValue: function representValue(attr) {
|
|
225
227
|
return _representValue(attr, editConfig, editIface, promises);
|
|
@@ -333,24 +335,24 @@ export function computeExpressionFields(editConfig, feature, editIface, mapCrs,
|
|
|
333
335
|
} catch (e) {
|
|
334
336
|
/* eslint-disable-next-line */
|
|
335
337
|
console.warn("Failed to sort expressions, they probably contain cyclic dependencies");
|
|
336
|
-
fieldExpressions = Object.entries(fieldExpressions).map(function (
|
|
338
|
+
fieldExpressions = Object.entries(fieldExpressions).map(function (_ref4) {
|
|
337
339
|
var _ref5 = _slicedToArray(_ref4, 2),
|
|
338
340
|
field = _ref5[0],
|
|
339
341
|
expression = _ref5[1];
|
|
340
|
-
return
|
|
342
|
+
return {
|
|
341
343
|
field: field,
|
|
342
344
|
expression: expression
|
|
343
|
-
}
|
|
345
|
+
};
|
|
344
346
|
}, {});
|
|
345
347
|
}
|
|
346
348
|
// Evaluate expressions
|
|
347
349
|
FeatureCache.clear();
|
|
348
|
-
var mapPrefix =
|
|
350
|
+
var mapPrefix = editConfig.editDataset.split(".")[0];
|
|
349
351
|
parseExpressionsAsync(fieldExpressions, feature, editConfig, editIface, mapPrefix, mapCrs).then(function (result) {
|
|
350
352
|
// Adjust values based on field type
|
|
351
353
|
editConfig.fields.forEach(function (field) {
|
|
352
354
|
var _field$constraints2;
|
|
353
|
-
if (
|
|
355
|
+
if ((_field$constraints2 = field.constraints) !== null && _field$constraints2 !== void 0 && _field$constraints2.hidden) {
|
|
354
356
|
// Remove hidden fields from result
|
|
355
357
|
delete result[field.id];
|
|
356
358
|
} else if (field.id in result && field.type === "date") {
|
|
@@ -86,5 +86,4 @@ var ElevationInterface = {
|
|
|
86
86
|
export function getElevationInterface() {
|
|
87
87
|
var _window$QWC2Elevation;
|
|
88
88
|
return (_window$QWC2Elevation = window.QWC2ElevationInterface) !== null && _window$QWC2Elevation !== void 0 ? _window$QWC2Elevation : ElevationInterface;
|
|
89
|
-
}
|
|
90
|
-
;
|
|
89
|
+
}
|
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
|
}
|
package/utils/MapUtils.js
CHANGED
|
@@ -40,15 +40,6 @@ var MapUtils = {
|
|
|
40
40
|
dpi2dpm: function dpi2dpm(dpi) {
|
|
41
41
|
return (dpi || DEFAULT_SCREEN_DPI) * (100 / 2.54);
|
|
42
42
|
},
|
|
43
|
-
/**
|
|
44
|
-
* @param dpi {number} screen resolution in dots per inch.
|
|
45
|
-
* @param projection {string} map projection.
|
|
46
|
-
* @return {number} dots per map unit.
|
|
47
|
-
*/
|
|
48
|
-
dpi2dpu: function dpi2dpu(dpi, projection) {
|
|
49
|
-
var units = CoordinatesUtils.getUnits(projection);
|
|
50
|
-
return METERS_PER_UNIT[units] * MapUtils.dpi2dpm(dpi);
|
|
51
|
-
},
|
|
52
43
|
/**
|
|
53
44
|
* Get a list of scales for each zoom level of the Google Mercator.
|
|
54
45
|
* @param minZoom {number} min zoom level.
|
|
@@ -75,9 +66,9 @@ var MapUtils = {
|
|
|
75
66
|
*/
|
|
76
67
|
getResolutionsForScales: function getResolutionsForScales(scales, projection) {
|
|
77
68
|
var dpi = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_SCREEN_DPI;
|
|
78
|
-
var
|
|
69
|
+
var units = CoordinatesUtils.getUnits(projection);
|
|
79
70
|
var resolutions = scales.map(function (scale) {
|
|
80
|
-
return scale /
|
|
71
|
+
return scale * 0.0254 / (dpi * METERS_PER_UNIT[units]);
|
|
81
72
|
});
|
|
82
73
|
return resolutions;
|
|
83
74
|
},
|
|
@@ -34,6 +34,7 @@ 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';
|
|
38
39
|
function strcmp(a, b) {
|
|
39
40
|
var al = a.toLowerCase();
|
|
@@ -298,6 +299,20 @@ var ServiceLayerUtils = {
|
|
|
298
299
|
} catch (e) {
|
|
299
300
|
/* pass */
|
|
300
301
|
}
|
|
302
|
+
var editConfigUrl = null;
|
|
303
|
+
var wmsName = null;
|
|
304
|
+
try {
|
|
305
|
+
editConfigUrl = layer.EditConfig.OnlineResource.href;
|
|
306
|
+
wmsName = layer.EditConfig.wms_name;
|
|
307
|
+
} catch (e) {
|
|
308
|
+
/* pass */
|
|
309
|
+
}
|
|
310
|
+
var translationsUrl = null;
|
|
311
|
+
try {
|
|
312
|
+
translationsUrl = layer.Traslations.OnlineResource.href;
|
|
313
|
+
} catch (e) {
|
|
314
|
+
/* pass */
|
|
315
|
+
}
|
|
301
316
|
var dimensions = [];
|
|
302
317
|
MiscUtils.ensureArray(layer.Dimension).forEach(function (dim) {
|
|
303
318
|
var _dim$fieldName, _dim$endFieldName;
|
|
@@ -327,6 +342,9 @@ var ServiceLayerUtils = {
|
|
|
327
342
|
url: getMapUrl,
|
|
328
343
|
featureInfoUrl: featureInfoUrl,
|
|
329
344
|
legendUrl: legendUrl,
|
|
345
|
+
editConfigUrl: editConfigUrl,
|
|
346
|
+
translationsUrl: translationsUrl,
|
|
347
|
+
wms_name: wmsName,
|
|
330
348
|
version: version,
|
|
331
349
|
infoFormats: infoFormats,
|
|
332
350
|
mapFormats: mapFormats,
|
|
@@ -341,7 +359,8 @@ var ServiceLayerUtils = {
|
|
|
341
359
|
maxScale: layer.MinScaleDenominator !== undefined ? Number(layer.MaxScaleDenominator) : undefined,
|
|
342
360
|
dimensions: dimensions,
|
|
343
361
|
styles: styles,
|
|
344
|
-
style: style
|
|
362
|
+
style: style,
|
|
363
|
+
serverType: translationsUrl ? 'qgis' : null // If there is a translationsUrl, assume it is the qwc-ogc-service
|
|
345
364
|
};
|
|
346
365
|
},
|
|
347
366
|
getWFSLayers: function getWFSLayers(capabilities, calledServiceUrl, mapCrs) {
|
|
@@ -606,7 +625,39 @@ var ServiceLayerUtils = {
|
|
|
606
625
|
LAYERS: layerConfig.name
|
|
607
626
|
};
|
|
608
627
|
}
|
|
609
|
-
|
|
628
|
+
var metadataRequests = [new Promise(function (resolve, reject) {
|
|
629
|
+
if (layer.editConfigUrl) {
|
|
630
|
+
axios.get(layer.editConfigUrl).then(function (response) {
|
|
631
|
+
layer.editConfig = response.data;
|
|
632
|
+
delete layer.editConfigUrl;
|
|
633
|
+
resolve();
|
|
634
|
+
})["catch"](function (e) {
|
|
635
|
+
delete layer.editConfigUrl;
|
|
636
|
+
resolve();
|
|
637
|
+
});
|
|
638
|
+
} else {
|
|
639
|
+
resolve();
|
|
640
|
+
}
|
|
641
|
+
}), new Promise(function (resolve, reject) {
|
|
642
|
+
if (layer.translationsUrl) {
|
|
643
|
+
axios.get(layer.translationsUrl.replace('{lang}', LocaleUtils.lang())).then(function (response) {
|
|
644
|
+
layer.translations = response.data;
|
|
645
|
+
delete layer.translationsUrl;
|
|
646
|
+
resolve();
|
|
647
|
+
})["catch"](function (e) {
|
|
648
|
+
delete layer.translationsUrl;
|
|
649
|
+
resolve();
|
|
650
|
+
});
|
|
651
|
+
} else {
|
|
652
|
+
resolve();
|
|
653
|
+
}
|
|
654
|
+
})];
|
|
655
|
+
Promise.all(metadataRequests).then(function () {
|
|
656
|
+
if (layer.translations) {
|
|
657
|
+
layer = LayerUtils.applyTranslations(layer, layer.translations);
|
|
658
|
+
}
|
|
659
|
+
callback(layerConfig.id, layer);
|
|
660
|
+
});
|
|
610
661
|
} else {
|
|
611
662
|
// eslint-disable-next-line
|
|
612
663
|
console.warn("Could not find layer " + layerConfig.name);
|
package/utils/ThemeUtils.js
CHANGED
|
@@ -173,7 +173,9 @@ var ThemeUtils = {
|
|
|
173
173
|
LayerUtils.completeExternalLayer(res[cur.internalLayer], LayerUtils.searchSubLayer(theme, 'name', cur.internalLayer));
|
|
174
174
|
return res;
|
|
175
175
|
}, {})),
|
|
176
|
-
translations: theme.translations
|
|
176
|
+
translations: theme.translations,
|
|
177
|
+
editConfig: theme.editConfig,
|
|
178
|
+
wms_name: theme.wms_name
|
|
177
179
|
};
|
|
178
180
|
layer = LayerUtils.recomputeLayerBBox(layer);
|
|
179
181
|
// Drawing order only makes sense if layer reordering is disabled
|