qwc2 2025.4.9 → 2025.4.14
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/components/AppMenu.js +1 -1
- package/components/AttributeTableWidget.js +16 -0
- package/components/style/AppMenu.css +19 -5
- package/components/style/AttributeTableWidget.css +214 -0
- package/components/widgets/style/ButtonBar.css +1 -0
- package/package.json +1 -1
- package/plugins/API.js +4 -2
- package/plugins/AttributeTable.js +3 -12
- package/plugins/BackgroundSwitcher.js +1 -1
- package/plugins/Print.js +4 -3
- package/plugins/style/AttributeTable.css +1 -215
- package/plugins/style/Portal.css +2 -6
- package/static/translations/bg-BG.json +6 -0
- package/static/translations/ca-ES.json +6 -0
- package/static/translations/cs-CZ.json +6 -0
- package/static/translations/de-CH.json +6 -0
- package/static/translations/de-DE.json +6 -0
- package/static/translations/en-US.json +6 -0
- package/static/translations/es-ES.json +6 -0
- package/static/translations/fi-FI.json +6 -0
- package/static/translations/fr-FR.json +6 -0
- package/static/translations/hu-HU.json +6 -0
- package/static/translations/it-IT.json +6 -0
- package/static/translations/ja-JP.json +6 -0
- package/static/translations/nl-NL.json +6 -0
- package/static/translations/no-NO.json +6 -0
- package/static/translations/pl-PL.json +6 -0
- package/static/translations/pt-BR.json +6 -0
- package/static/translations/pt-PT.json +6 -0
- package/static/translations/ro-RO.json +6 -0
- package/static/translations/ru-RU.json +6 -0
- package/static/translations/sv-SE.json +6 -0
- package/static/translations/tr-TR.json +6 -0
- package/static/translations/tsconfig.json +5 -1
- package/utils/SearchProviders.js +1 -1
|
@@ -539,6 +539,7 @@
|
|
|
539
539
|
"all": "Alle",
|
|
540
540
|
"circleradius": "Kreis radius",
|
|
541
541
|
"clearfilter": "Zurücksetzen",
|
|
542
|
+
"coordinates": "Koordinaten",
|
|
542
543
|
"existinglayer": "Die Ebene existiert bereits in der Karte",
|
|
543
544
|
"filter": "Suche verfeinern",
|
|
544
545
|
"layers": "Ebenen",
|
|
@@ -706,6 +707,11 @@
|
|
|
706
707
|
"undock": "Abdocken",
|
|
707
708
|
"unmaximize": "Wiederherstellen",
|
|
708
709
|
"unminimize": "Vergrössern"
|
|
710
|
+
},
|
|
711
|
+
"colorschemes": {
|
|
712
|
+
"default": "Standard",
|
|
713
|
+
"dark": "Dunkel",
|
|
714
|
+
"highcontrast": "Hochkontrast"
|
|
709
715
|
}
|
|
710
716
|
}
|
|
711
717
|
}
|
|
@@ -539,6 +539,7 @@
|
|
|
539
539
|
"all": "Alle",
|
|
540
540
|
"circleradius": "Kreisradius",
|
|
541
541
|
"clearfilter": "Zurücksetzen",
|
|
542
|
+
"coordinates": "Koordinaten",
|
|
542
543
|
"existinglayer": "Die Ebene existiert bereits in der Karte",
|
|
543
544
|
"filter": "Suche verfeinern",
|
|
544
545
|
"layers": "Ebenen",
|
|
@@ -706,6 +707,11 @@
|
|
|
706
707
|
"undock": "Abdocken",
|
|
707
708
|
"unmaximize": "Wiederherstellen",
|
|
708
709
|
"unminimize": "Vergrößern"
|
|
710
|
+
},
|
|
711
|
+
"colorschemes": {
|
|
712
|
+
"default": "Standard",
|
|
713
|
+
"dark": "Dunkel",
|
|
714
|
+
"highcontrast": "Hochkontrast"
|
|
709
715
|
}
|
|
710
716
|
}
|
|
711
717
|
}
|
|
@@ -539,6 +539,7 @@
|
|
|
539
539
|
"all": "All",
|
|
540
540
|
"circleradius": "Circle radius",
|
|
541
541
|
"clearfilter": "Clear",
|
|
542
|
+
"coordinates": "Coordinates",
|
|
542
543
|
"existinglayer": "The layer already exists in the map",
|
|
543
544
|
"filter": "Refine search",
|
|
544
545
|
"layers": "Layers",
|
|
@@ -706,6 +707,11 @@
|
|
|
706
707
|
"undock": "Undock",
|
|
707
708
|
"unmaximize": "Restore",
|
|
708
709
|
"unminimize": "Unminimize"
|
|
710
|
+
},
|
|
711
|
+
"colorschemes": {
|
|
712
|
+
"default": "Default",
|
|
713
|
+
"dark": "Dark",
|
|
714
|
+
"highcontrast": "High contrast"
|
|
709
715
|
}
|
|
710
716
|
}
|
|
711
717
|
}
|
|
@@ -539,6 +539,7 @@
|
|
|
539
539
|
"all": "Todo",
|
|
540
540
|
"circleradius": "",
|
|
541
541
|
"clearfilter": "",
|
|
542
|
+
"coordinates": "",
|
|
542
543
|
"existinglayer": "La capa ya existe en el mapa",
|
|
543
544
|
"filter": "Refinar búsqueda",
|
|
544
545
|
"layers": "",
|
|
@@ -706,6 +707,11 @@
|
|
|
706
707
|
"undock": "Desacoplar",
|
|
707
708
|
"unmaximize": "Restaurar",
|
|
708
709
|
"unminimize": "Desminimizar"
|
|
710
|
+
},
|
|
711
|
+
"colorschemes": {
|
|
712
|
+
"default": "",
|
|
713
|
+
"dark": "",
|
|
714
|
+
"highcontrast": ""
|
|
709
715
|
}
|
|
710
716
|
}
|
|
711
717
|
}
|
|
@@ -539,6 +539,7 @@
|
|
|
539
539
|
"all": "Kaikki",
|
|
540
540
|
"circleradius": "",
|
|
541
541
|
"clearfilter": "",
|
|
542
|
+
"coordinates": "",
|
|
542
543
|
"existinglayer": "Taso on jo lisätty karttaan",
|
|
543
544
|
"filter": "Tarkenna hakua",
|
|
544
545
|
"layers": "",
|
|
@@ -706,6 +707,11 @@
|
|
|
706
707
|
"undock": "Irrota",
|
|
707
708
|
"unmaximize": "",
|
|
708
709
|
"unminimize": ""
|
|
710
|
+
},
|
|
711
|
+
"colorschemes": {
|
|
712
|
+
"default": "",
|
|
713
|
+
"dark": "",
|
|
714
|
+
"highcontrast": ""
|
|
709
715
|
}
|
|
710
716
|
}
|
|
711
717
|
}
|
|
@@ -539,6 +539,7 @@
|
|
|
539
539
|
"all": "Tous",
|
|
540
540
|
"circleradius": "Rayon du cercle",
|
|
541
541
|
"clearfilter": "Effacer",
|
|
542
|
+
"coordinates": "",
|
|
542
543
|
"existinglayer": "La couche existe déjà dans la carte",
|
|
543
544
|
"filter": "Affiner la recherche",
|
|
544
545
|
"layers": "Couches",
|
|
@@ -706,6 +707,11 @@
|
|
|
706
707
|
"undock": "Détacher",
|
|
707
708
|
"unmaximize": "Réduire",
|
|
708
709
|
"unminimize": "Agrandir"
|
|
710
|
+
},
|
|
711
|
+
"colorschemes": {
|
|
712
|
+
"default": "Défaut",
|
|
713
|
+
"dark": "Sombre",
|
|
714
|
+
"highcontrast": "Contraste élevé"
|
|
709
715
|
}
|
|
710
716
|
}
|
|
711
717
|
}
|
|
@@ -539,6 +539,7 @@
|
|
|
539
539
|
"all": "Minden",
|
|
540
540
|
"circleradius": "",
|
|
541
541
|
"clearfilter": "",
|
|
542
|
+
"coordinates": "",
|
|
542
543
|
"existinglayer": "",
|
|
543
544
|
"filter": "",
|
|
544
545
|
"layers": "",
|
|
@@ -706,6 +707,11 @@
|
|
|
706
707
|
"undock": "",
|
|
707
708
|
"unmaximize": "",
|
|
708
709
|
"unminimize": ""
|
|
710
|
+
},
|
|
711
|
+
"colorschemes": {
|
|
712
|
+
"default": "",
|
|
713
|
+
"dark": "",
|
|
714
|
+
"highcontrast": ""
|
|
709
715
|
}
|
|
710
716
|
}
|
|
711
717
|
}
|
|
@@ -539,6 +539,7 @@
|
|
|
539
539
|
"all": "Tutti",
|
|
540
540
|
"circleradius": "Raggio del cerchio",
|
|
541
541
|
"clearfilter": "Azzera",
|
|
542
|
+
"coordinates": "Coordinate",
|
|
542
543
|
"existinglayer": "Il layer esiste già nella mappa",
|
|
543
544
|
"filter": "Filtro",
|
|
544
545
|
"layers": "Cartine",
|
|
@@ -706,6 +707,11 @@
|
|
|
706
707
|
"undock": "Sgancia",
|
|
707
708
|
"unmaximize": "Ripristina",
|
|
708
709
|
"unminimize": "Ingrandisci"
|
|
710
|
+
},
|
|
711
|
+
"colorschemes": {
|
|
712
|
+
"default": "Predefinito",
|
|
713
|
+
"dark": "Scuro",
|
|
714
|
+
"highcontrast": "Contrasto elevato"
|
|
709
715
|
}
|
|
710
716
|
}
|
|
711
717
|
}
|
|
@@ -539,6 +539,7 @@
|
|
|
539
539
|
"all": "全て",
|
|
540
540
|
"circleradius": "円の半径",
|
|
541
541
|
"clearfilter": "クリア",
|
|
542
|
+
"coordinates": "",
|
|
542
543
|
"existinglayer": "レイヤは既に地図の中に存在します",
|
|
543
544
|
"filter": "検索を詳細化",
|
|
544
545
|
"layers": "レイヤ",
|
|
@@ -706,6 +707,11 @@
|
|
|
706
707
|
"undock": "アンドック",
|
|
707
708
|
"unmaximize": "元のサイズに戻す",
|
|
708
709
|
"unminimize": "元のサイズに戻す"
|
|
710
|
+
},
|
|
711
|
+
"colorschemes": {
|
|
712
|
+
"default": "",
|
|
713
|
+
"dark": "",
|
|
714
|
+
"highcontrast": ""
|
|
709
715
|
}
|
|
710
716
|
}
|
|
711
717
|
}
|
|
@@ -539,6 +539,7 @@
|
|
|
539
539
|
"all": "Alle",
|
|
540
540
|
"circleradius": "Straal van de cirkel",
|
|
541
541
|
"clearfilter": "Wissen",
|
|
542
|
+
"coordinates": "",
|
|
542
543
|
"existinglayer": "Kaartlaag bestaat al",
|
|
543
544
|
"filter": "Filteren",
|
|
544
545
|
"layers": "",
|
|
@@ -706,6 +707,11 @@
|
|
|
706
707
|
"undock": "Losmaken",
|
|
707
708
|
"unmaximize": "Herstellen",
|
|
708
709
|
"unminimize": "Minimaliseer niet"
|
|
710
|
+
},
|
|
711
|
+
"colorschemes": {
|
|
712
|
+
"default": "",
|
|
713
|
+
"dark": "",
|
|
714
|
+
"highcontrast": ""
|
|
709
715
|
}
|
|
710
716
|
}
|
|
711
717
|
}
|
|
@@ -539,6 +539,7 @@
|
|
|
539
539
|
"all": "Alle",
|
|
540
540
|
"circleradius": "",
|
|
541
541
|
"clearfilter": "",
|
|
542
|
+
"coordinates": "",
|
|
542
543
|
"existinglayer": "Laget finnes allerede på kartet",
|
|
543
544
|
"filter": "Filtrer",
|
|
544
545
|
"layers": "",
|
|
@@ -706,6 +707,11 @@
|
|
|
706
707
|
"undock": "Utløs",
|
|
707
708
|
"unmaximize": "",
|
|
708
709
|
"unminimize": ""
|
|
710
|
+
},
|
|
711
|
+
"colorschemes": {
|
|
712
|
+
"default": "",
|
|
713
|
+
"dark": "",
|
|
714
|
+
"highcontrast": ""
|
|
709
715
|
}
|
|
710
716
|
}
|
|
711
717
|
}
|
|
@@ -539,6 +539,7 @@
|
|
|
539
539
|
"all": "Wszystko",
|
|
540
540
|
"circleradius": "",
|
|
541
541
|
"clearfilter": "",
|
|
542
|
+
"coordinates": "",
|
|
542
543
|
"existinglayer": "",
|
|
543
544
|
"filter": "",
|
|
544
545
|
"layers": "",
|
|
@@ -706,6 +707,11 @@
|
|
|
706
707
|
"undock": "",
|
|
707
708
|
"unmaximize": "",
|
|
708
709
|
"unminimize": ""
|
|
710
|
+
},
|
|
711
|
+
"colorschemes": {
|
|
712
|
+
"default": "",
|
|
713
|
+
"dark": "",
|
|
714
|
+
"highcontrast": ""
|
|
709
715
|
}
|
|
710
716
|
}
|
|
711
717
|
}
|
|
@@ -539,6 +539,7 @@
|
|
|
539
539
|
"all": "Todos",
|
|
540
540
|
"circleradius": "",
|
|
541
541
|
"clearfilter": "",
|
|
542
|
+
"coordinates": "",
|
|
542
543
|
"existinglayer": "A camada já existe no mapa",
|
|
543
544
|
"filter": "Refinar a procura",
|
|
544
545
|
"layers": "",
|
|
@@ -706,6 +707,11 @@
|
|
|
706
707
|
"undock": "Desencaixar",
|
|
707
708
|
"unmaximize": "Desmaximizar",
|
|
708
709
|
"unminimize": "Desminimizar"
|
|
710
|
+
},
|
|
711
|
+
"colorschemes": {
|
|
712
|
+
"default": "",
|
|
713
|
+
"dark": "",
|
|
714
|
+
"highcontrast": ""
|
|
709
715
|
}
|
|
710
716
|
}
|
|
711
717
|
}
|
|
@@ -539,6 +539,7 @@
|
|
|
539
539
|
"all": "Todos",
|
|
540
540
|
"circleradius": "",
|
|
541
541
|
"clearfilter": "Limpar Filtro",
|
|
542
|
+
"coordinates": "",
|
|
542
543
|
"existinglayer": "A camada já existe no mapa",
|
|
543
544
|
"filter": "Refinar Pesquisa",
|
|
544
545
|
"layers": "",
|
|
@@ -706,6 +707,11 @@
|
|
|
706
707
|
"undock": "Desacoplar",
|
|
707
708
|
"unmaximize": "Restaurar Tamanho",
|
|
708
709
|
"unminimize": "Restaurar Tamanho"
|
|
710
|
+
},
|
|
711
|
+
"colorschemes": {
|
|
712
|
+
"default": "",
|
|
713
|
+
"dark": "",
|
|
714
|
+
"highcontrast": ""
|
|
709
715
|
}
|
|
710
716
|
}
|
|
711
717
|
}
|
|
@@ -539,6 +539,7 @@
|
|
|
539
539
|
"all": "Toate",
|
|
540
540
|
"circleradius": "",
|
|
541
541
|
"clearfilter": "",
|
|
542
|
+
"coordinates": "",
|
|
542
543
|
"existinglayer": "Stratul există deja în hartă",
|
|
543
544
|
"filter": "Filtrare căutare",
|
|
544
545
|
"layers": "",
|
|
@@ -706,6 +707,11 @@
|
|
|
706
707
|
"undock": "Anulează andocarea",
|
|
707
708
|
"unmaximize": "Restaurează",
|
|
708
709
|
"unminimize": "Restaurează"
|
|
710
|
+
},
|
|
711
|
+
"colorschemes": {
|
|
712
|
+
"default": "",
|
|
713
|
+
"dark": "",
|
|
714
|
+
"highcontrast": ""
|
|
709
715
|
}
|
|
710
716
|
}
|
|
711
717
|
}
|
|
@@ -539,6 +539,7 @@
|
|
|
539
539
|
"all": "Всё",
|
|
540
540
|
"circleradius": "",
|
|
541
541
|
"clearfilter": "",
|
|
542
|
+
"coordinates": "",
|
|
542
543
|
"existinglayer": "",
|
|
543
544
|
"filter": "",
|
|
544
545
|
"layers": "",
|
|
@@ -706,6 +707,11 @@
|
|
|
706
707
|
"undock": "",
|
|
707
708
|
"unmaximize": "",
|
|
708
709
|
"unminimize": ""
|
|
710
|
+
},
|
|
711
|
+
"colorschemes": {
|
|
712
|
+
"default": "",
|
|
713
|
+
"dark": "",
|
|
714
|
+
"highcontrast": ""
|
|
709
715
|
}
|
|
710
716
|
}
|
|
711
717
|
}
|
|
@@ -539,6 +539,7 @@
|
|
|
539
539
|
"all": "",
|
|
540
540
|
"circleradius": "",
|
|
541
541
|
"clearfilter": "",
|
|
542
|
+
"coordinates": "",
|
|
542
543
|
"existinglayer": "",
|
|
543
544
|
"filter": "",
|
|
544
545
|
"layers": "",
|
|
@@ -706,6 +707,11 @@
|
|
|
706
707
|
"undock": "",
|
|
707
708
|
"unmaximize": "",
|
|
708
709
|
"unminimize": ""
|
|
710
|
+
},
|
|
711
|
+
"colorschemes": {
|
|
712
|
+
"default": "",
|
|
713
|
+
"dark": "",
|
|
714
|
+
"highcontrast": ""
|
|
709
715
|
}
|
|
710
716
|
}
|
|
711
717
|
}
|
|
@@ -539,6 +539,7 @@
|
|
|
539
539
|
"all": "Tümü",
|
|
540
540
|
"circleradius": "Daire yarıçapı",
|
|
541
541
|
"clearfilter": "Temizle",
|
|
542
|
+
"coordinates": "",
|
|
542
543
|
"existinglayer": "Katman zaten haritada mevcut",
|
|
543
544
|
"filter": "Gelişmiş arama",
|
|
544
545
|
"layers": "Katmanlar",
|
|
@@ -706,6 +707,11 @@
|
|
|
706
707
|
"undock": "Çöz",
|
|
707
708
|
"unmaximize": "Eski haline getir",
|
|
708
709
|
"unminimize": "Küçültmeyi kaldır"
|
|
710
|
+
},
|
|
711
|
+
"colorschemes": {
|
|
712
|
+
"default": "",
|
|
713
|
+
"dark": "",
|
|
714
|
+
"highcontrast": ""
|
|
709
715
|
}
|
|
710
716
|
}
|
|
711
717
|
}
|
|
@@ -52,7 +52,10 @@
|
|
|
52
52
|
"appmenu.items.Tools",
|
|
53
53
|
"appmenu.items.Bookmark",
|
|
54
54
|
"appmenu.items.TimeManager",
|
|
55
|
-
"appmenu.items.View3D"
|
|
55
|
+
"appmenu.items.View3D",
|
|
56
|
+
"colorschemes.default",
|
|
57
|
+
"colorschemes.dark",
|
|
58
|
+
"colorschemes.highcontrast"
|
|
56
59
|
],
|
|
57
60
|
"strings": [
|
|
58
61
|
"app.missingbg",
|
|
@@ -463,6 +466,7 @@
|
|
|
463
466
|
"search.all",
|
|
464
467
|
"search.circleradius",
|
|
465
468
|
"search.clearfilter",
|
|
469
|
+
"search.coordinates",
|
|
466
470
|
"search.existinglayer",
|
|
467
471
|
"search.filter",
|
|
468
472
|
"search.layers",
|
package/utils/SearchProviders.js
CHANGED
|
@@ -4,7 +4,7 @@ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof
|
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/import axios from"axios";import yaml from"js-yaml";import polygonIntersectTest from"polygon-intersect-test";import ConfigUtils from"./ConfigUtils";import CoordinatesUtils from"./CoordinatesUtils";import IdentifyUtils from"./IdentifyUtils";import LocaleUtils from"./LocaleUtils";export var SearchResultType={PLACE:0,THEMELAYER:1,THEME:2,EXTERNALLAYER:3};function coordinatesSearch(text,searchParams,callback){var displaycrs=searchParams.displaycrs||"EPSG:4326";var matches=text.match(/^\s*([+-]?\d+\.?\d*)[,\s]\s*([+-]?\d+\.?\d*)\s*$/);var items=[];if(matches&&matches.length>=3){var x=parseFloat(matches[1]);var y=parseFloat(matches[2]);if(displaycrs!=="EPSG:4326"){items.push({id:"coord0",text:x+", "+y+" ("+displaycrs+")",x:x,y:y,crs:displaycrs,bbox:[x,y,x,y]})}if(x>=-180&&x<=180&&y>=-90&&y<=90){var title=Math.abs(x)+(x>=0?"\xB0E":"\xB0W")+", "+Math.abs(y)+(y>=0?"\xB0N":"\xB0S");items.push({id:"coord"+items.length,text:title,x:x,y:y,crs:"EPSG:4326",bbox:[x,y,x,y]})}if(x>=-90&&x<=90&&y>=-180&&y<=180&&x!==y){var _title=Math.abs(y)+(y>=0?"\xB0E":"\xB0W")+", "+Math.abs(x)+(x>=0?"\xB0N":"\xB0S");items.push({id:"coord"+items.length,text:_title,x:y,y:x,crs:"EPSG:4326",bbox:[y,x,y,x]})}}var results=[];if(items.length>0){results.push({id:"coords",titlemsgid:"search.coordinates",type:SearchResultType.PLACE,items:items})}callback({results:results})}/** ************************************************************************ **/var NominatimSearch=/*#__PURE__*/function(){function NominatimSearch(){_classCallCheck(this,NominatimSearch)}return _createClass(NominatimSearch,null,[{key:"search",value:function search(text,searchParams,callback){var viewboxParams={};if(searchParams.filterBBox){viewboxParams.viewbox=CoordinatesUtils.reprojectBbox(searchParams.filterBBox,searchParams.mapcrs,"EPSG:4326").join(",");viewboxParams.bounded=1}axios.get("https://nominatim.openstreetmap.org/search",{params:_objectSpread(_objectSpread({"q":text,"addressdetails":1,"polygon_geojson":1,"limit":20,"format":"json","accept-language":searchParams.lang},viewboxParams),searchParams.cfgParams||{})}).then(function(response){var locale=searchParams.lang;if(NominatimSearch.TRANSLATIONS[locale]===undefined){NominatimSearch.TRANSLATIONS[locale]={promise:NominatimSearch.loadLocale(locale)};NominatimSearch.TRANSLATIONS[locale].promise.then(function(){NominatimSearch.parseResults(response.data,NominatimSearch.TRANSLATIONS[locale].strings,callback)})}else if(NominatimSearch.TRANSLATIONS[locale].promise){NominatimSearch.TRANSLATIONS[locale].promise.then(function(){NominatimSearch.parseResults(response.data,NominatimSearch.TRANSLATIONS[locale].strings,callback)})}else if(NominatimSearch.TRANSLATIONS[locale].strings){NominatimSearch.parseResults(response.data,NominatimSearch.TRANSLATIONS[locale].strings,callback)}})}},{key:"parseResults",value:function parseResults(obj,translations,callback){var results=[];var groups={};var groupcounter=0;(obj||[]).map(function(entry){if(!(entry["class"]in groups)){var title=entry.type;try{title=translations[entry["class"]][entry.type]||entry.type}catch(e){/* pass */}groups[entry["class"]]={id:"nominatimgroup"+groupcounter++,// capitalize class
|
|
7
|
+
*/import axios from"axios";import yaml from"js-yaml";import polygonIntersectTest from"polygon-intersect-test";import ConfigUtils from"./ConfigUtils";import CoordinatesUtils from"./CoordinatesUtils";import IdentifyUtils from"./IdentifyUtils";import LocaleUtils from"./LocaleUtils";export var SearchResultType={PLACE:0,THEMELAYER:1,THEME:2,EXTERNALLAYER:3};function coordinatesSearch(text,searchParams,callback){var displaycrs=searchParams.displaycrs||"EPSG:4326";var matches=text.match(/^\s*([+-]?\d+\.?\d*)[,\s]\s*([+-]?\d+\.?\d*)\s*$/);var items=[];if(matches&&matches.length>=3){var x=parseFloat(matches[1]);var y=parseFloat(matches[2]);if(displaycrs!=="EPSG:4326"){items.push({id:"coord0",text:x+", "+y+" ("+displaycrs+")",x:x,y:y,crs:displaycrs,bbox:[x,y,x,y]})}if(x>=-180&&x<=180&&y>=-90&&y<=90){var title=Math.abs(x)+(x>=0?"\xB0E":"\xB0W")+", "+Math.abs(y)+(y>=0?"\xB0N":"\xB0S");items.push({id:"coord"+items.length,text:title,x:x,y:y,crs:"EPSG:4326",bbox:[x,y,x,y]})}if(x>=-90&&x<=90&&y>=-180&&y<=180&&x!==y){var _title=Math.abs(y)+(y>=0?"\xB0E":"\xB0W")+", "+Math.abs(x)+(x>=0?"\xB0N":"\xB0S");items.push({id:"coord"+items.length,text:_title,x:y,y:x,crs:"EPSG:4326",bbox:[y,x,y,x]})}}var results=[];if(items.length>0){results.push({id:"coords",titlemsgid:LocaleUtils.trmsg("search.coordinates"),type:SearchResultType.PLACE,items:items})}callback({results:results})}/** ************************************************************************ **/var NominatimSearch=/*#__PURE__*/function(){function NominatimSearch(){_classCallCheck(this,NominatimSearch)}return _createClass(NominatimSearch,null,[{key:"search",value:function search(text,searchParams,callback){var viewboxParams={};if(searchParams.filterBBox){viewboxParams.viewbox=CoordinatesUtils.reprojectBbox(searchParams.filterBBox,searchParams.mapcrs,"EPSG:4326").join(",");viewboxParams.bounded=1}axios.get("https://nominatim.openstreetmap.org/search",{params:_objectSpread(_objectSpread({"q":text,"addressdetails":1,"polygon_geojson":1,"limit":20,"format":"json","accept-language":searchParams.lang},viewboxParams),searchParams.cfgParams||{})}).then(function(response){var locale=searchParams.lang;if(NominatimSearch.TRANSLATIONS[locale]===undefined){NominatimSearch.TRANSLATIONS[locale]={promise:NominatimSearch.loadLocale(locale)};NominatimSearch.TRANSLATIONS[locale].promise.then(function(){NominatimSearch.parseResults(response.data,NominatimSearch.TRANSLATIONS[locale].strings,callback)})}else if(NominatimSearch.TRANSLATIONS[locale].promise){NominatimSearch.TRANSLATIONS[locale].promise.then(function(){NominatimSearch.parseResults(response.data,NominatimSearch.TRANSLATIONS[locale].strings,callback)})}else if(NominatimSearch.TRANSLATIONS[locale].strings){NominatimSearch.parseResults(response.data,NominatimSearch.TRANSLATIONS[locale].strings,callback)}})}},{key:"parseResults",value:function parseResults(obj,translations,callback){var results=[];var groups={};var groupcounter=0;(obj||[]).map(function(entry){if(!(entry["class"]in groups)){var title=entry.type;try{title=translations[entry["class"]][entry.type]||entry.type}catch(e){/* pass */}groups[entry["class"]]={id:"nominatimgroup"+groupcounter++,// capitalize class
|
|
8
8
|
title:title,type:SearchResultType.PLACE,items:[]};results.push(groups[entry["class"]])}// shorten display_name
|
|
9
9
|
var text=entry.display_name.split(", ").slice(0,3).join(", ");// map label
|
|
10
10
|
var label=text;// collect address fields
|