diff --git a/.gitignore b/.gitignore index 715afe780e..eeb8ce127b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,9 +4,10 @@ node_modules .cache/* .idea/* scratch +src/assets/editor-layer-index.json +src/assets/generated/ assets/editor-layer-index.json assets/generated/* -src/assets/generated/ assets/layers/favourite/favourite.json public/*.webmanifest /*.html @@ -20,8 +21,6 @@ missing_translations.txt .DS_Store Svg.ts data/ -src/assets/generated/nsi_stats/brand.json -src/assets/generated/nsi_stats/brand.summarized.json Folder.DotSettings.user index_*.ts @@ -29,7 +28,6 @@ index_*.ts *.doctest.ts service-worker.js .env -src/assets/editor-layer-index.json error_changeset_* diff --git a/404.html b/404.html index 58def56851..abeeabcc59 100644 --- a/404.html +++ b/404.html @@ -1,57 +1,49 @@ - - - - - - - + + + + + + + - MapComplete - page not found - - - - + MapComplete - page not found + + + + - - - - - - - - - - + + + + + + + + + + - + - -
- - - - -
- -
- Not found... -
- +
- + diff --git a/Docs/ServerConfig/hetzner/Caddyfile b/Docs/ServerConfig/hetzner/Caddyfile index 71f0fd1620..5cc5c95d83 100644 --- a/Docs/ServerConfig/hetzner/Caddyfile +++ b/Docs/ServerConfig/hetzner/Caddyfile @@ -8,10 +8,18 @@ builds.mapcomplete.org { dev.mapcomplete.org { root * public/develop/ + try_files {path}.html file_server header { +Permissions-Policy "interest-cohort=()" } + handle_errors { + @404 { + expression {http.error.status_code} == 404 + } + rewrite @404 /404.html + file_server + } } single.mapcomplete.org { diff --git a/Docs/URL_Parameters.md b/Docs/URL_Parameters.md index 968e14b090..bbd609d7c6 100644 --- a/Docs/URL_Parameters.md +++ b/Docs/URL_Parameters.md @@ -346,7 +346,7 @@ No default value set The initial/current zoom level -This documentation is defined in the source code at [InitialMapPositioning.ts](/src/Logic/Actors/InitialMapPositioning.ts#L42) +This documentation is defined in the source code at [InitialMapPositioning.ts](/src/Logic/Actors/InitialMapPositioning.ts#L43) The default value is _1_ @@ -354,7 +354,7 @@ The default value is _1_ The initial/current latitude -This documentation is defined in the source code at [InitialMapPositioning.ts](/src/Logic/Actors/InitialMapPositioning.ts#L42) +This documentation is defined in the source code at [InitialMapPositioning.ts](/src/Logic/Actors/InitialMapPositioning.ts#L43) The default value is _0_ @@ -362,7 +362,7 @@ The default value is _0_ The initial/current longitude of the app -This documentation is defined in the source code at [InitialMapPositioning.ts](/src/Logic/Actors/InitialMapPositioning.ts#L42) +This documentation is defined in the source code at [InitialMapPositioning.ts](/src/Logic/Actors/InitialMapPositioning.ts#L43) The default value is _0_ @@ -410,7 +410,7 @@ The default value is _0_ The mode the application starts in, e.g. 'map', 'dashboard' or 'statistics' -This documentation is defined in the source code at [generateDocs.ts](ervdvn/git2/MapComplete/scripts/generateDocs.ts#L436) +This documentation is defined in the source code at [generateDocs.ts](ervdvn/git/MapComplete/scripts/generateDocs.ts#L436) The default value is _map_ diff --git a/assets/layers/cycleways_and_roads/cycleways_and_roads.json b/assets/layers/cycleways_and_roads/cycleways_and_roads.json index 60a743c603..56f74cdec3 100644 --- a/assets/layers/cycleways_and_roads/cycleways_and_roads.json +++ b/assets/layers/cycleways_and_roads/cycleways_and_roads.json @@ -273,6 +273,9 @@ "width": "8" } ], + "calculatedTags": [ + "width:= ! ! (feat.properties['width:carriageway']) ? feat.properties['width:carriageway'] : feat.properties['width'] " + ], "tagRenderings": [ "images", { @@ -1289,16 +1292,16 @@ ] }, "render": { - "en": "The carriage width of this road is {width:carriageway}m", - "nl": "De breedte van deze rijbaan in deze straat is {width:carriageway}m", - "de": "Die Fahrbahnbreite dieser Straße beträgt {width:carriageway}m", - "fr": "La largeur de cette chaussée est de {width:carriageway}m", - "ca": "L'amplada dels carrils d'aquesta carretera és {width:carriageway}m", - "cs": "Šířka vozovky této silnice je {width:carriageway}m", - "es": "El ancho de la calzada de esta carretera es de {width:carriageway}m" + "en": "The carriage width of this road is {width}m", + "nl": "De breedte van deze rijbaan in deze straat is {width}m", + "de": "Die Fahrbahnbreite dieser Straße beträgt {width}m", + "fr": "La largeur de cette chaussée est de {width}m", + "ca": "L'amplada dels carrils d'aquesta carretera és {width}m", + "cs": "Šířka vozovky této silnice je {width}m", + "es": "El ancho de la calzada de esta carretera es de {width}m" }, "freeform": { - "key": "width:carriageway", + "key": "width", "type": "distance", "helperArgs": [ "20", @@ -1314,7 +1317,7 @@ "cs": "Jaká je šířka vozovky této silnice (v metrech)?", "es": "¿Cuál es el ancho de la calzada de esta carretera (en metros)?" }, - "id": "width:carriageway", + "id": "width", "questionHint": { "en": "This is measured curb to curb and thus includes the width of parallell parking lanes", "nl": "Dit is gemeten van stoepsteen tot stoepsteen, dus inclusief een parallelle parkeerstrook", diff --git a/assets/layers/shops/shops.json b/assets/layers/shops/shops.json index 2995dda96c..f6b2b7786d 100644 --- a/assets/layers/shops/shops.json +++ b/assets/layers/shops/shops.json @@ -523,6 +523,43 @@ } ] }, + { + "id": "optometrist_service", + "#": "Quite often, opticians also sell hearing aids and vice versa. They often also have a certified optometrist or audiologist", + "condition": { + "or": [ + "shop=optician", + "shop=hearing_aid", + "shop=medical_supply" + ] + }, + "question": { + "en": "Are medical services available here?", + "nl": "Zijn hier medische services beschikbaar?" + }, + "multiAnswer": true, + "mappings": [ + { + "if": "healthcare=optometrist", + "ifnot": "not:healtcare=optometrist", + "addExtraTags": [ + "not:healthcare=optometrist" + ], + "then": { + "en": "This shop offers eye exams by certified optometrists", + "nl": "Hier kan men een oogtest door een erkende optometrist laten uitvoeren" + } + }, + { + "if": "healthcare=audiologist", + "ifnot": "not:healthcare=audiologist", + "then": { + "en": "This shop offers hearing tests by a certified audiologist", + "nl": "HIer kan men een hoortest laten uitvoeren door een erkende audioloog" + } + } + ] + }, { "id": "key_cutter", "question": { diff --git a/assets/layers/waste_basket/waste_basket.json b/assets/layers/waste_basket/waste_basket.json index 1d35dbb3c0..ced6f1579d 100644 --- a/assets/layers/waste_basket/waste_basket.json +++ b/assets/layers/waste_basket/waste_basket.json @@ -27,11 +27,7 @@ "cs": "Jedná se o veřejný odpadkový koš, odpadkový koš, kam můžete vyhodit odpadky." }, "source": { - "osmTags": { - "and": [ - "amenity=waste_basket" - ] - } + "osmTags": "amenity=waste_basket" }, "minzoom": 17, "title": { @@ -489,4 +485,4 @@ "enableRelocation": false, "enableImproveAccuracy": true } -} +} \ No newline at end of file diff --git a/assets/layers/waste_disposal/waste_disposal.json b/assets/layers/waste_disposal/waste_disposal.json index da2a0c29ca..7710aa5c1c 100644 --- a/assets/layers/waste_disposal/waste_disposal.json +++ b/assets/layers/waste_disposal/waste_disposal.json @@ -27,7 +27,6 @@ "osmTags": "amenity=waste_disposal" }, "minzoom": 12, - "minzoomVisible": 12, "title": { "render": { "en": "Waste Disposal", @@ -324,4 +323,4 @@ "enableImproveAccuracy": true, "enableRelocation": true } -} +} \ No newline at end of file diff --git a/assets/svg/brick_wall_round.svg b/assets/svg/brick_wall_round.svg index f4be352bb2..515407bc7c 100644 --- a/assets/svg/brick_wall_round.svg +++ b/assets/svg/brick_wall_round.svg @@ -7,920 +7,100 @@ viewBox="0 0 40 40" version="1.1" id="svg5" - inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)" - sodipodi:docname="bick_wal_round.svg" + sodipodi:docname="brick_wall_round.svg" + inkscape:version="1.3.2 (1:1.3.2+202311252150+091e20ef0f)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"> - - - - - - - - - - + id="defs1"> + + + + - + id="mask47"> + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + diff --git a/assets/svg/brick_wall_square.svg b/assets/svg/brick_wall_square.svg index 9e9fc293fb..6d99feb96b 100644 --- a/assets/svg/brick_wall_square.svg +++ b/assets/svg/brick_wall_square.svg @@ -7,90 +7,36 @@ viewBox="0 0 40 40" version="1.1" id="svg5" - inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)" - sodipodi:docname="bick_wal_square.svg" + sodipodi:docname="brick_wall_square.svg" + inkscape:version="1.3.2 (1:1.3.2+202311252150+091e20ef0f)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"> + - - - - - - - - - - - - - - + inkscape:current-layer="svg5" /> + style="display:inline"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + diff --git a/assets/svg/license_info.json b/assets/svg/license_info.json index b5712434e2..5ed16d9cd0 100644 --- a/assets/svg/license_info.json +++ b/assets/svg/license_info.json @@ -1318,5 +1318,15 @@ "sources": [ "https://www.wikipedia.org/" ] + }, + { + "path": "world.svg", + "license": "GPL 2.0", + "authors": [ + "https://github.com/hiddewie" + ], + "sources": [ + "https://github.com/openstreetmap/openstreetmap-website/blob/d38f6484e1aa201284b7eac19dbcc7fad856b88a/assets/sign-up-illustration.svg" + ] } ] \ No newline at end of file diff --git a/assets/svg/world.svg b/assets/svg/world.svg new file mode 100644 index 0000000000..ffa41b9f7d --- /dev/null +++ b/assets/svg/world.svg @@ -0,0 +1 @@ + diff --git a/assets/svg/world.svg.license b/assets/svg/world.svg.license new file mode 100644 index 0000000000..e3ef47e6c8 --- /dev/null +++ b/assets/svg/world.svg.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: https://github.com/hiddewie +SPDX-License-Identifier: GPL 2.0 \ No newline at end of file diff --git a/assets/themes/postboxes/postboxes.json b/assets/themes/postboxes/postboxes.json index 296b7ca2c4..1bd9e2a742 100644 --- a/assets/themes/postboxes/postboxes.json +++ b/assets/themes/postboxes/postboxes.json @@ -61,7 +61,6 @@ "builtin": "shops", "override": { "minzoom": 18, - "minzoomVisible": 18, "description": { "en": "Add a new post partner to the map in an existing shop", "de": "Hinzufügen eines neuen Post-Partners auf der Karte in einem bestehenden Geschäft", diff --git a/assets/themes/waste/waste.json b/assets/themes/waste/waste.json index e93cf7f512..0994e3fabb 100644 --- a/assets/themes/waste/waste.json +++ b/assets/themes/waste/waste.json @@ -40,8 +40,7 @@ { "builtin": "waste_basket", "override": { - "minzoom": 16, - "minzoomVisible": 16 + "minzoom": 16 } }, "recycling", diff --git a/langs/layers/ca.json b/langs/layers/ca.json index 596c7d032b..626ef568fc 100644 --- a/langs/layers/ca.json +++ b/langs/layers/ca.json @@ -2889,10 +2889,10 @@ }, "question": "Aquesta carretera està il·luminada?" }, - "width:carriageway": { + "width": { "question": "Quina és l'amplada dels carrils d'aquesta carretera (en metres)?", "questionHint": "Això es mesura de vorera a vorera i, per tant, inclou l'amplada dels aparcaments en línia", - "render": "L'amplada dels carrils d'aquesta carretera és {width:carriageway}m" + "render": "L'amplada dels carrils d'aquesta carretera és {width}m" } }, "title": { diff --git a/langs/layers/cs.json b/langs/layers/cs.json index 60df365469..a71471a09f 100644 --- a/langs/layers/cs.json +++ b/langs/layers/cs.json @@ -3694,10 +3694,10 @@ }, "question": "Je tato ulice osvětlená?" }, - "width:carriageway": { + "width": { "question": "Jaká je šířka vozovky této silnice (v metrech)?", "questionHint": "Jedná se o měření od krajnice ke krajnici a to včetně šířky paralelních parkovacích pruhů", - "render": "Šířka vozovky této silnice je {width:carriageway}m" + "render": "Šířka vozovky této silnice je {width}m" } }, "title": { diff --git a/langs/layers/de.json b/langs/layers/de.json index f406d00e40..d3c5a3a1a0 100644 --- a/langs/layers/de.json +++ b/langs/layers/de.json @@ -3958,10 +3958,10 @@ }, "question": "Ist diese Straße beleuchtet?" }, - "width:carriageway": { + "width": { "question": "Wie groß ist die Fahrbahnbreite dieser Straße (in Metern)?", "questionHint": "Diese wird von Bordstein zu Bordstein gemessen und schließt daher die Breite von parallelen Parkspuren ein", - "render": "Die Fahrbahnbreite dieser Straße beträgt {width:carriageway}m" + "render": "Die Fahrbahnbreite dieser Straße beträgt {width}m" } }, "title": { diff --git a/langs/layers/en.json b/langs/layers/en.json index 28255d6116..77d1c74741 100644 --- a/langs/layers/en.json +++ b/langs/layers/en.json @@ -4021,10 +4021,10 @@ }, "question": "Is this street lit?" }, - "width:carriageway": { + "width": { "question": "What is the carriage width of this road (in meters)?", "questionHint": "This is measured curb to curb and thus includes the width of parallell parking lanes", - "render": "The carriage width of this road is {width:carriageway}m" + "render": "The carriage width of this road is {width}m" } }, "title": { @@ -9755,6 +9755,17 @@ }, "question": "Does this shop offer key cutting?" }, + "optometrist_service": { + "mappings": { + "0": { + "then": "This shop offers eye exams by certified optometrists" + }, + "1": { + "then": "This shop offers hearing tests by a certified audiologist" + } + }, + "question": "Are medical services available here?" + }, "organic": { "mappings": { "0": { diff --git a/langs/layers/es.json b/langs/layers/es.json index a32f9ed829..5ab43f9763 100644 --- a/langs/layers/es.json +++ b/langs/layers/es.json @@ -3950,10 +3950,10 @@ }, "question": "¿Está iluminada esta calle?" }, - "width:carriageway": { + "width": { "question": "¿Cuál es el ancho de la calzada de esta carretera (en metros)?", "questionHint": "Esto se mide de bordillo a bordillo e incluye el ancho de los carriles de aparcamiento paralelos", - "render": "El ancho de la calzada de esta carretera es de {width:carriageway}m" + "render": "El ancho de la calzada de esta carretera es de {width}m" } }, "title": { diff --git a/langs/layers/fr.json b/langs/layers/fr.json index 2ca42b2339..27cf0bfa9d 100644 --- a/langs/layers/fr.json +++ b/langs/layers/fr.json @@ -2795,10 +2795,10 @@ }, "question": "Cette rue est-elle éclairée ?" }, - "width:carriageway": { + "width": { "question": "Quelle est la largeur de cette chaussée (en mètres) ?", "questionHint": "Elle est mesurée d'une bordure à l'autre et inclut donc la largeur des voies de stationnement parallèles", - "render": "La largeur de cette chaussée est de {width:carriageway}m" + "render": "La largeur de cette chaussée est de {width}m" } }, "title": { diff --git a/langs/layers/nl.json b/langs/layers/nl.json index 51f098b7cf..6cf397a2cb 100644 --- a/langs/layers/nl.json +++ b/langs/layers/nl.json @@ -2049,6 +2049,9 @@ }, "title": { "mappings": { + "0": { + "then": "{name}" + }, "1": { "then": "Vogelkijkhut {name}" }, @@ -3973,10 +3976,10 @@ }, "question": "Is deze weg verlicht?" }, - "width:carriageway": { + "width": { "question": "Hoe breed is de rijbaan in deze straat (in meters)?", "questionHint": "Dit is gemeten van stoepsteen tot stoepsteen, dus inclusief een parallelle parkeerstrook", - "render": "De breedte van deze rijbaan in deze straat is {width:carriageway}m" + "render": "De breedte van deze rijbaan in deze straat is {width}m" } }, "title": { @@ -6353,6 +6356,11 @@ } }, "title": { + "mappings": { + "0": { + "then": "{name}" + } + }, "render": "Natuurgebied" } }, @@ -6884,6 +6892,21 @@ "render": "Picknicktafel" } }, + "play_forest": { + "description": "Een speelbos is een vrij toegankelijke zone in een bos", + "name": "Speelbossen", + "title": { + "mappings": { + "0": { + "then": "{name}" + }, + "1": { + "then": "Speelbos {name}" + } + }, + "render": "Speelbos" + } + }, "playground": { "deletion": { "nonDeleteMappings": { @@ -8315,6 +8338,17 @@ } } }, + "optometrist_service": { + "mappings": { + "0": { + "then": "Hier kan men een oogtest door een erkende optometrist laten uitvoeren" + }, + "1": { + "then": "HIer kan men een hoortest laten uitvoeren door een erkende audioloog" + } + }, + "question": "Zijn hier medische services beschikbaar?" + }, "organic": { "mappings": { "0": { @@ -8441,6 +8475,9 @@ }, "title": { "mappings": { + "0": { + "then": "{name}" + }, "1": { "then": "Voetpad" }, @@ -10593,13 +10630,25 @@ } }, "village_green": { - "description": "Een laag die dorpsgroen toont (gemeenschapsgroen, maar niet echt een park)" + "description": "Een laag die dorpsgroen toont (gemeenschapsgroen, maar niet echt een park)", + "name": "Speelweide", + "title": { + "mappings": { + "0": { + "then": "{name}" + } + }, + "render": "Speelweide" + } }, "visitor_information_centre": { "description": "Een bezoekerscentrum biedt informatie over een specifieke attractie of bezienswaardigheid waar het is gevestigd.", "name": "Bezoekerscentrum", "title": { "mappings": { + "0": { + "then": "{name:nl}" + }, "1": { "then": "{name}" } @@ -10829,4 +10878,4 @@ "render": "windturbine" } } -} +} \ No newline at end of file diff --git a/langs/themes/nl.json b/langs/themes/nl.json index 47a5f89688..3f55d0345c 100644 --- a/langs/themes/nl.json +++ b/langs/themes/nl.json @@ -653,8 +653,37 @@ "building type": { "question": "Wat voor soort gebouw is dit?" }, + "grb-fixme": { + "mappings": { + "0": { + "then": "Geen fixme" + } + }, + "question": "Wat zegt de fixme?", + "render": "De fixme is {fixme}" + }, + "grb-housenumber": { + "mappings": { + "0": { + "then": "Geen huisnummer" + } + }, + "question": "Wat is het huisnummer?", + "render": "Het huisnummer is {addr:housenumber}" + }, + "grb-min-level": { + "question": "Hoeveel verdiepingen ontbreken?", + "render": "Dit gebouw begint maar op de {building:min_level} verdieping" + }, "grb-reference": { "render": "Werd geïmporteerd vanuit GRB, het referentienummer is {source:geometry:ref}" + }, + "grb-street": { + "question": "Wat is de straat?", + "render": "De straat is {addr:street}" + }, + "grb-unit": { + "render": "De wooneenheid-aanduiding is {addr:unit} " } } }, @@ -671,8 +700,35 @@ } } } + }, + "5": { + "override": { + "tagRenderings+": { + "0": { + "mappings": { + "0": { + "then": "Geen omliggend OSM-gebouw gevonden" + } + } + }, + "3": { + "mappings": { + "0": { + "then": "Geen omliggend OSM-gebouw gevonden. Een omliggend gebouw is nodig om dit punt als adres punt toe te voegen.
Importeer eerst de gebouwen. Vernieuw dan de pagina om losse adressen toe te voegen
" + } + }, + "render": { + "special": { + "text": "Voeg dit adres als een nieuw adrespunt toe" + } + } + } + } + } } - } + }, + "shortDescription": "Grb import helper tool", + "title": "GRB import helper" }, "guideposts": { "description": "Wegwijzers (ook wel handwijzer genoemd) zijn vaak te vinden langs officiële wandel-, fiets-, ski- of paardrijroutes om de richtingen naar verschillende bestemmingen aan te geven. Vaak zijn ze vernoemd naar een regio of plaats en geven ze de hoogte aan.\n\nDe positie van een wegwijzer kan door een wandelaar/fietser/renner/skiër worden gebruikt als bevestiging van de huidige positie, vooral als ze een gedrukte kaart zonder GPS-ontvanger gebruiken. ", @@ -1108,6 +1164,11 @@ }, "title": "Dierenartsen, hondenloopzones en andere huisdiervriendelijke plaatsen" }, + "play_forests": { + "description": "Een speelbos is een zone in een bos die vrij toegankelijk is voor spelende kinderen. Deze wordt in bossen van het Agentschap Natuur en bos altijd aangeduid met het overeenkomstige bord.", + "shortDescription": "Deze kaart toont speelbossen", + "title": "Speelbossen" + }, "playgrounds": { "description": "Op deze kaart vind je speeltuinen en kan je zelf meer informatie en foto's toevoegen", "shortDescription": "Een kaart met speeltuinen", @@ -1181,6 +1242,47 @@ "description": "Alles om te skiën", "title": "Skipistes en kabelbanen" }, + "speelplekken": { + "description": "

Welkom bij de Groendoener!

De Zuidrand dat is spelen, ravotten, chillen, wandelen,… in het groen. Meer dan 200 grote en kleine speelplekken liggen er in parken, in bossen en op pleintjes te wachten om ontdekt te worden. De verschillende speelplekken werden getest én goedgekeurd door kinder- en jongerenreporters uit de Zuidrand. Met leuke challenges dagen de reporters jou uit om ook op ontdekking te gaan. Klik op een speelplek op de kaart, bekijk het filmpje en ga op verkenning!

Het project groendoener kadert binnen het strategisch project Beleefbare Open Ruimte in de Antwerpse Zuidrand en is een samenwerking tussen het departement Leefmilieu van provincie Antwerpen, Sportpret vzw, een OpenStreetMap-België Consultent en Createlli vzw. Het project kwam tot stand met steun van Departement Omgeving van de Vlaamse Overheid.
", + "layers": { + "6": { + "name": "Wandelroutes van provincie Antwerpen", + "tagRenderings": { + "walk-description": { + "render": "

Korte beschrijving:

{description}" + }, + "walk-length": { + "render": "Deze wandeling is {_length:km}km lang" + }, + "walk-operator": { + "question": "Wie beheert deze wandeling en plaatst dus de signalisatiebordjes?" + }, + "walk-operator-email": { + "question": "Naar wie kan men emailen bij problemen rond signalisatie?", + "render": "Bij problemen met signalisatie kan men emailen naar {operator:email}" + }, + "walk-type": { + "mappings": { + "0": { + "then": "Dit is een internationale wandelroute" + }, + "1": { + "then": "Dit is een nationale wandelroute" + }, + "2": { + "then": "Dit is een regionale wandelroute" + }, + "3": { + "then": "Dit is een lokale wandelroute" + } + } + } + } + } + }, + "shortDescription": "Speelplekken in de Antwerpse Zuidrand", + "title": "Welkom bij de groendoener!" + }, "sport_pitches": { "description": "Een sportveld is een ingerichte plaats met infrastructuur om een sport te beoefenen", "shortDescription": "Deze kaart toont sportvelden", @@ -1301,6 +1403,10 @@ }, "title": "Straatverlichting" }, + "street_lighting_assen": { + "description": "Op deze kaart vind je alles over straatlantaarns + een dataset van Assen", + "title": "Straatverlichting - Assen" + }, "surveillance": { "description": "Op deze open kaart kan je bewakingscamera's vinden.", "shortDescription": "Bewakingscameras en dergelijke", @@ -1414,9 +1520,13 @@ "description": "Kaart met afvalbakken en recyclingfaciliteiten.", "title": "Afval" }, + "waste_assen": { + "description": "Kaart met afvalbakken en recyclingfaciliteiten + een dataset voor Assen.", + "title": "Afval - Assen" + }, "waste_basket": { "description": "Op deze kaart vind je afvalbakken bij jou in de buurt. Als er een afvalbak ontbreekt op deze kaart, kun je deze zelf toevoegen", "shortDescription": "Een kaart met vuilnisbakken", "title": "Vuilnisbakken" } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 23153a9068..66eaba818c 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ } }, "scripts": { - "init": "npm ci && npm run prep:layeroverview && npm run generate && npm run download:editor-layer-index && npm run generate:layouts && npm run clean", + "init": "npm ci && npm run prep:layeroverview && npm run download:editor-layer-index && npm run generate && npm run generate:layouts && npm run clean", "start": "npm run generate:layeroverview && npm run strt", "strt": "vite --host | sed 's/localhost:/127.0.0.1:/g'", "build": "./scripts/build.sh", diff --git a/scripts/build.sh b/scripts/build.sh index 3d3186b73c..fa56387834 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -24,6 +24,8 @@ else exit 1 fi +cp node_modules/name-suggestion-index/dist/nsi.json public/assets/data/nsi +cp node_modules/name-suggestion-index/dist/wikidata.min.json public/assets/data/nsi export NODE_OPTIONS=--max-old-space-size=16000 which vite diff --git a/scripts/generateLayerOverview.ts b/scripts/generateLayerOverview.ts index b62a5e533e..64c35df4c8 100644 --- a/scripts/generateLayerOverview.ts +++ b/scripts/generateLayerOverview.ts @@ -119,7 +119,7 @@ class AddIconSummary extends DesugaringStep<{ raw: LayerConfigJson; parsed: Laye const pointRendering: PointRenderingConfig = layerConfig.mapRendering.find((pr) => pr.location.has("point") ) - const defaultTags = layerConfig.GetBaseTags() + const defaultTags = layerConfig.baseTags fixed["_layerIcon"] = Utils.NoNull( (pointRendering?.marker ?? []).map((i) => { const icon = i.icon?.GetRenderValue(defaultTags)?.txt diff --git a/src/Logic/ImageProviders/AllImageProviders.ts b/src/Logic/ImageProviders/AllImageProviders.ts index 96552b06df..8db2a8d014 100644 --- a/src/Logic/ImageProviders/AllImageProviders.ts +++ b/src/Logic/ImageProviders/AllImageProviders.ts @@ -91,7 +91,6 @@ export default class AllImageProviders { However, we override them if a custom image tag is set, e.g. 'image:menu' */ const prefixes = tagKey ?? imageProvider.defaultKeyPrefixes - console.log("Prefixes are", tagKey, prefixes) const singleSource = tags.bindD((tags) => imageProvider.getRelevantUrls(tags, prefixes)) allSources.push(singleSource) singleSource.addCallbackAndRunD((_) => { diff --git a/src/Logic/Osm/OsmConnection.ts b/src/Logic/Osm/OsmConnection.ts index 97cc7a6166..e59678b64e 100644 --- a/src/Logic/Osm/OsmConnection.ts +++ b/src/Logic/Osm/OsmConnection.ts @@ -503,7 +503,7 @@ export class OsmConnection { (options.filename ?? "gpx_track_mapcomplete_" + new Date().toISOString()) + '"\r\nContent-Type: application/gpx+xml', } - user + const boundary = "987654" let body = "" diff --git a/src/Logic/Osm/OsmObjectDownloader.ts b/src/Logic/Osm/OsmObjectDownloader.ts index b0e9f9cec6..9b1644dbb7 100644 --- a/src/Logic/Osm/OsmObjectDownloader.ts +++ b/src/Logic/Osm/OsmObjectDownloader.ts @@ -127,7 +127,9 @@ export default class OsmObjectDownloader { * Beware: their geometry will be incomplete! */ public async DownloadReferencingWays(id: string): Promise { - const data = await Utils.downloadJsonCached(`${this.backend}api/0.6/${id}/ways`, 60 * 1000) + const data = await Utils.downloadJsonCached<{ + elements: { id: number }[] + }>(`${this.backend}api/0.6/${id}/ways`, 60 * 1000) return data.elements.map((wayInfo) => new OsmWay(wayInfo.id, wayInfo)) } @@ -136,7 +138,7 @@ export default class OsmObjectDownloader { * Beware: their geometry will be incomplete! */ public async DownloadReferencingRelations(id: string): Promise { - const data = await Utils.downloadJsonCached( + const data = await Utils.downloadJsonCached<{ elements: { id: number }[] }>( `${this.backend}api/0.6/${id}/relations`, 60 * 1000 ) diff --git a/src/Logic/Osm/OsmPreferences.ts b/src/Logic/Osm/OsmPreferences.ts index 4b30c4212d..6c4a9d5543 100644 --- a/src/Logic/Osm/OsmPreferences.ts +++ b/src/Logic/Osm/OsmPreferences.ts @@ -38,14 +38,23 @@ export class OsmPreferences { }) } - private setPreferencesAll(key: string, value: string) { + /** + * Sets a new preferenceValue in 'allPreferences' + * @param key + * @param value + * @param deferping: the end user will ping '_allPreferences' + * @private + */ + private setPreferencesAll(key: string, value: string, deferping = false) { if (this._allPreferences.data[key] !== value) { this._allPreferences.data[key] = value - this._allPreferences.ping() + if(!deferping){ + this._allPreferences.ping() + } } } - private initPreference(key: string, value: string = undefined): UIEventSource { + private initPreference(key: string, value: string = undefined, deferPing = false): UIEventSource { if (this.preferences[key] !== undefined) { if (value !== undefined) { this.preferences[key].set(value) @@ -54,12 +63,12 @@ export class OsmPreferences { } const pref = (this.preferences[key] = new UIEventSource(value, "preference: " + key)) if (value) { - this.setPreferencesAll(key, value) + this.setPreferencesAll(key, value, deferPing) } pref.addCallback((v) => { console.log("Got an update:", key, "--->", v) this.uploadKvSplit(key, v) - this.setPreferencesAll(key, v) + this.setPreferencesAll(key, v, deferPing) }) return pref } @@ -73,11 +82,12 @@ export class OsmPreferences { await this.removeLegacy(legacy) } for (const key in merged) { - this.initPreference(key, prefs[key]) + this.initPreference(key, prefs[key], true) } for (const key in legacy) { - this.initPreference(key, legacy[key]) + this.initPreference(key, legacy[key], true) } + this._allPreferences.ping() } public getPreference(key: string, defaultValue: string = undefined, prefix?: string) { diff --git a/src/Logic/Web/NameSuggestionIndex.ts b/src/Logic/Web/NameSuggestionIndex.ts index 7133c12475..94d2455914 100644 --- a/src/Logic/Web/NameSuggestionIndex.ts +++ b/src/Logic/Web/NameSuggestionIndex.ts @@ -1,6 +1,3 @@ -import * as nsi from "../../../node_modules/name-suggestion-index/dist/nsi.json" -import * as nsiWD from "../../../node_modules/name-suggestion-index/dist/wikidata.min.json" - import * as nsiFeatures from "../../../node_modules/name-suggestion-index/dist/featureCollection.json" import { LocationConflation } from "@rapideditor/location-conflation" import type { Feature, MultiPolygon } from "geojson" @@ -56,27 +53,53 @@ export interface NSIItem { } export default class NameSuggestionIndex { - private static readonly nsiFile: Readonly = nsi - private static readonly nsiWdFile: Readonly< + public static readonly supportedTypes = ["brand", + "flag", + "operator", + "transit"] as const + private readonly nsiFile: Readonly + private readonly nsiWdFile: Readonly< Record< string, { logos: { wikidata?: string; facebook?: string } } > - > = nsiWD["wikidata"] + > private static loco = new LocationConflation(nsiFeatures) // Some additional boundaries - private static _supportedTypes: string[] + private _supportedTypes: string[] - public static supportedTypes(): string[] { + constructor(nsiFile: Readonly, nsiWdFile: Readonly< + Record< + string, + { + logos: { wikidata?: string; facebook?: string } + } + >>) { + this.nsiFile = nsiFile + this.nsiWdFile = nsiWdFile + } + + private static inited: NameSuggestionIndex = undefined + + public static async getNsiIndex(): Promise { + if (NameSuggestionIndex.inited) { + return NameSuggestionIndex.inited + } + const [nsi, nsiWd] = await Promise.all(["assets/data/nsi/nsi.json", "assets/data/nsi/wikidata.min.json"].map(url => Utils.downloadJsonCached(url, 1000 * 60 * 60 * 24 * 30))) + NameSuggestionIndex.inited = new NameSuggestionIndex(nsi, nsiWd["wikidata"]) + return NameSuggestionIndex.inited + } + + public supportedTypes(): string[] { if (this._supportedTypes) { return this._supportedTypes } - const keys = Object.keys(NameSuggestionIndex.nsiFile.nsi) + const keys = Object.keys(this.nsiFile.nsi) const all = keys.map( - (k) => NameSuggestionIndex.nsiFile.nsi[k].properties.path.split("/")[0] + (k) => this.nsiFile.nsi[k].properties.path.split("/")[0], ) this._supportedTypes = Utils.Dedup(all).map((s) => { if (s.endsWith("s")) { @@ -99,13 +122,13 @@ export default class NameSuggestionIndex { try { return Utils.downloadJsonCached>( `./assets/data/nsi/stats/${type}.${c.toUpperCase()}.json`, - 24 * 60 * 60 * 1000 + 24 * 60 * 60 * 1000, ) } catch (e) { console.error("Could not fetch " + type + " statistics due to", e) return undefined } - }) + }), ) stats = Utils.NoNull(stats) if (stats.length === 1) { @@ -123,7 +146,10 @@ export default class NameSuggestionIndex { return merged } - public static isSvg(nsiItem: NSIItem, type: string): boolean | undefined { + public isSvg(nsiItem: NSIItem, type: string): boolean | undefined { + if (this.nsiWdFile === undefined) { + throw "nsiWdi file is not loaded, cannot determine if " + nsiItem.id + " has an SVG image" + } const logos = this.nsiWdFile[nsiItem?.tags?.[type + ":wikidata"]]?.logos if (!logos) { return undefined @@ -138,7 +164,7 @@ export default class NameSuggestionIndex { return false } - public static async generateMappings( + public async generateMappings( type: string, tags: Record, country: string[], @@ -148,7 +174,7 @@ export default class NameSuggestionIndex { * If set, sort by frequency instead of alphabetically */ sortByFrequency: boolean - } + }, ): Promise { const mappings: (Mapping & { frequency: number })[] = [] const frequencies = await NameSuggestionIndex.fetchFrequenciesFor(type, country) @@ -157,12 +183,12 @@ export default class NameSuggestionIndex { continue } const value = tags[key] - const actualBrands = NameSuggestionIndex.getSuggestionsForKV( + const actualBrands = this.getSuggestionsForKV( type, key, value, country.join(";"), - location + location, ) if (!actualBrands) { continue @@ -177,7 +203,7 @@ export default class NameSuggestionIndex { if (hasIcon) { // Using works fine without an extension for JPG and PNG, but _not_ svg :( icon = "./assets/data/nsi/logos/" + nsiItem.id - if (NameSuggestionIndex.isSvg(nsiItem, type)) { + if (this.isSvg(nsiItem, type)) { icon = icon + ".svg" } } @@ -207,13 +233,13 @@ export default class NameSuggestionIndex { return mappings } - public static supportedTags( - type: "operator" | "brand" | "flag" | "transit" | string + public supportedTags( + type: "operator" | "brand" | "flag" | "transit" | string, ): Record { const tags: Record = {} - const keys = Object.keys(NameSuggestionIndex.nsiFile.nsi) + const keys = Object.keys(this.nsiFile.nsi) for (const key of keys) { - const nsiItem = NameSuggestionIndex.nsiFile.nsi[key] + const nsiItem = this.nsiFile.nsi[key] const path = nsiItem.properties.path const [osmType, osmkey, osmvalue] = path.split("/") if (type !== osmType && type + "s" !== osmType) { @@ -231,9 +257,9 @@ export default class NameSuggestionIndex { * Returns a list of all brands/operators * @param type */ - public static allPossible(type: "brand" | "operator"): NSIItem[] { + public allPossible(type: "brand" | "operator"): NSIItem[] { const options: NSIItem[] = [] - const tags = NameSuggestionIndex.supportedTags(type) + const tags = this.supportedTags(type) for (const osmKey in tags) { const values = tags[osmKey] for (const osmValue of values) { @@ -249,14 +275,14 @@ export default class NameSuggestionIndex { * @param country: a string containing one or more country codes, separated by ";" * @param location: center point of the feature, should be [lon, lat] */ - public static getSuggestionsFor( + public getSuggestionsFor( type: string, tags: { key: string; value: string }[], country: string = undefined, - location: [number, number] = undefined + location: [number, number] = undefined, ): NSIItem[] { return tags.flatMap((tag) => - this.getSuggestionsForKV(type, tag.key, tag.value, country, location) + this.getSuggestionsForKV(type, tag.key, tag.value, country, location), ) } @@ -274,15 +300,15 @@ export default class NameSuggestionIndex { * @param country: a string containing one or more country codes, separated by ";" * @param location: center point of the feature, should be [lon, lat] */ - public static getSuggestionsForKV( + public getSuggestionsForKV( type: string, key: string, value: string, country: string = undefined, - location: [number, number] = undefined + location: [number, number] = undefined, ): NSIItem[] { const path = `${type}s/${key}/${value}` - const entry = NameSuggestionIndex.nsiFile.nsi[path] + const entry = this.nsiFile.nsi[path] const countries = country?.split(";") ?? [] return entry?.items?.filter((i) => { if (i.locationSet.include.indexOf("001") >= 0) { @@ -312,8 +338,8 @@ export default class NameSuggestionIndex { } const hasSpecial = - i.locationSet.include?.some((i) => i.endsWith(".geojson") || Array.isArray(i)) || - i.locationSet.exclude?.some((i) => i.endsWith(".geojson") || Array.isArray(i)) + i.locationSet.include?.some((i) => Array.isArray(i) || i.endsWith(".geojson")) || + i.locationSet.exclude?.some((i) => Array.isArray(i) || i.endsWith(".geojson")) if (!hasSpecial) { return false } @@ -335,4 +361,11 @@ export default class NameSuggestionIndex { return false }) } + + public static async generateMappings(key: string, tags: Exclude, undefined | null>, country: string[], center: [number, number], options: { + sortByFrequency: boolean + }): Promise { + const nsi = await NameSuggestionIndex.getNsiIndex() + return nsi.generateMappings(key, tags, country, center, options) + } } diff --git a/src/Models/ThemeConfig/Conversion/MiscTagRenderingChecks.ts b/src/Models/ThemeConfig/Conversion/MiscTagRenderingChecks.ts index c37f2a4b77..eabb1e5a91 100644 --- a/src/Models/ThemeConfig/Conversion/MiscTagRenderingChecks.ts +++ b/src/Models/ThemeConfig/Conversion/MiscTagRenderingChecks.ts @@ -1,17 +1,13 @@ import { DesugaringStep } from "./Conversion" import { TagRenderingConfigJson } from "../Json/TagRenderingConfigJson" import { LayerConfigJson } from "../Json/LayerConfigJson" -import { - MappingConfigJson, - QuestionableTagRenderingConfigJson, -} from "../Json/QuestionableTagRenderingConfigJson" +import { MappingConfigJson, QuestionableTagRenderingConfigJson } from "../Json/QuestionableTagRenderingConfigJson" import { ConversionContext } from "./ConversionContext" import { Translation } from "../../../UI/i18n/Translation" -import NameSuggestionIndex from "../../../Logic/Web/NameSuggestionIndex" import { TagUtils } from "../../../Logic/Tags/TagUtils" -import { Tag } from "../../../Logic/Tags/Tag" import Validators from "../../../UI/InputElement/Validators" import { CheckTranslation } from "./Validation" +import NameSuggestionIndex from "../../../Logic/Web/NameSuggestionIndex" export class MiscTagRenderingChecks extends DesugaringStep { private readonly _layerConfig: LayerConfigJson @@ -197,11 +193,11 @@ export class MiscTagRenderingChecks extends DesugaringStep= 0 + this._layerConfig?.source?.["osmTags"] && + NameSuggestionIndex.supportedTypes.indexOf( json.freeform.key) >= 0 ) { - const tags = TagUtils.TagD(this._layerConfig?.source?.osmTags)?.usedTags() - const suggestions = NameSuggestionIndex.getSuggestionsFor(json.freeform.key, tags) + const tags = TagUtils.TagD(this._layerConfig?.source?.["osmTags"])?.usedTags() + /* const suggestions = nameSuggestionIndexBundled.getSuggestionsFor(json.freeform.key, tags) if (suggestions === undefined) { context .enters("freeform", "type") @@ -209,8 +205,8 @@ export class MiscTagRenderingChecks extends DesugaringStep new Tag(t.key, t.value).asHumanString()).join(" ; ") ) - } - } else if (json.freeform.type === "nsi") { + }*/ + } else if (json.freeform["type"] === "nsi") { context .enters("freeform", "type") .warn( diff --git a/src/Models/ThemeConfig/LayerConfig.ts b/src/Models/ThemeConfig/LayerConfig.ts index 60652478f2..c5fea45250 100644 --- a/src/Models/ThemeConfig/LayerConfig.ts +++ b/src/Models/ThemeConfig/LayerConfig.ts @@ -24,6 +24,9 @@ import { QuestionableTagRenderingConfigJson } from "./Json/QuestionableTagRender import MarkdownUtils from "../../Utils/MarkdownUtils" import { And } from "../../Logic/Tags/And" import Combine from "../../UI/Base/Combine" +import SvelteUIElement from "../../UI/Base/SvelteUIElement" +import DynamicMarker from "../../UI/Map/DynamicMarker.svelte" +import { ImmutableStore } from "../../Logic/UIEventSource" export default class LayerConfig extends WithContextLoader { public static readonly syncSelectionAllowed = ["no", "local", "theme-only", "global"] as const @@ -67,6 +70,8 @@ export default class LayerConfig extends WithContextLoader { public readonly popupInFloatover: boolean | string public readonly enableMorePrivacy: boolean + public readonly baseTags: Readonly> + /** * If this layer is based on another layer, this might be indicated here * @private @@ -104,7 +109,7 @@ export default class LayerConfig extends WithContextLoader { mercatorCrs: json.source["mercatorCrs"], idKey: json.source["idKey"], }, - json.id + json.id, ) } @@ -124,7 +129,7 @@ export default class LayerConfig extends WithContextLoader { if (json.calculatedTags !== undefined) { if (!official) { console.warn( - `Unofficial theme ${this.id} with custom javascript! This is a security risk` + `Unofficial theme ${this.id} with custom javascript! This is a security risk`, ) } this.calculatedTags = [] @@ -194,7 +199,7 @@ export default class LayerConfig extends WithContextLoader { tags: pr.tags.map((t) => TagUtils.SimpleTag(t)), description: Translations.T( pr.description, - `${translationContext}.presets.${i}.description` + `${translationContext}.presets.${i}.description`, ), preciseInput: preciseInput, exampleImages: pr.exampleImages, @@ -208,7 +213,7 @@ export default class LayerConfig extends WithContextLoader { if (json.lineRendering) { this.lineRendering = Utils.NoNull(json.lineRendering).map( - (r, i) => new LineRenderingConfig(r, `${context}[${i}]`) + (r, i) => new LineRenderingConfig(r, `${context}[${i}]`), ) } else { this.lineRendering = [] @@ -216,7 +221,7 @@ export default class LayerConfig extends WithContextLoader { if (json.pointRendering) { this.mapRendering = Utils.NoNull(json.pointRendering).map( - (r, i) => new PointRenderingConfig(r, `${context}[${i}](${this.id})`) + (r, i) => new PointRenderingConfig(r, `${context}[${i}](${this.id})`), ) } else { this.mapRendering = [] @@ -228,7 +233,7 @@ export default class LayerConfig extends WithContextLoader { r.location.has("centroid") || r.location.has("projected_centerpoint") || r.location.has("start") || - r.location.has("end") + r.location.has("end"), ) if ( @@ -250,7 +255,7 @@ export default class LayerConfig extends WithContextLoader { Constants.priviliged_layers.indexOf(this.id) < 0 && this.source !== null /*library layer*/ && !this.source?.geojsonSource?.startsWith( - "https://api.openstreetmap.org/api/0.6/notes.json" + "https://api.openstreetmap.org/api/0.6/notes.json", ) ) { throw ( @@ -269,7 +274,7 @@ export default class LayerConfig extends WithContextLoader { typeof tr !== "string" && tr["builtin"] === undefined && tr["id"] === undefined && - tr["rewrite"] === undefined + tr["rewrite"] === undefined, ) ?? [] if (missingIds?.length > 0 && official) { console.error("Some tagRenderings of", this.id, "are missing an id:", missingIds) @@ -280,8 +285,8 @@ export default class LayerConfig extends WithContextLoader { (tr, i) => new TagRenderingConfig( tr, - this.id + ".tagRenderings[" + i + "]" - ) + this.id + ".tagRenderings[" + i + "]", + ), ) if (json.units !== undefined && !Array.isArray(json.units)) { throw ( @@ -291,7 +296,7 @@ export default class LayerConfig extends WithContextLoader { ) } this.units = (json.units ?? []).flatMap((unitJson, i) => - Unit.fromJson(unitJson, this.tagRenderings, `${context}.unit[${i}]`) + Unit.fromJson(unitJson, this.tagRenderings, `${context}.unit[${i}]`), ) if ( @@ -352,31 +357,18 @@ export default class LayerConfig extends WithContextLoader { ) } this.popupInFloatover = json.popupInFloatover ?? false - } - - public defaultIcon(properties?: Record): BaseUIElement | undefined { - if (this.mapRendering === undefined || this.mapRendering === null) { - return undefined - } - const mapRenderings = this.mapRendering.filter((r) => r.location.has("point")) - if (mapRenderings.length === 0) { - return undefined - } - return new Combine( - mapRenderings.map((mr) => - mr - .GetBaseIcon(properties ?? this.GetBaseTags()) - .SetClass("absolute left-0 top-0 w-full h-full") - ) - ).SetClass("relative block w-full h-full") - } - - public GetBaseTags(): Record { - return TagUtils.changeAsProperties( - this.source?.osmTags?.asChange({ id: "node/-1" }) ?? [{ k: "id", v: "node/-1" }] + this.baseTags = TagUtils.changeAsProperties( + this.source?.osmTags?.asChange({ id: "node/-1" }) ?? [{ k: "id", v: "node/-1" }], ) } + + public hasDefaultIcon() { + if (this.mapRendering === undefined || this.mapRendering === null) { + return false + } + return this.mapRendering.some((r) => r.location.has("point")) + } public GenerateDocumentation( usedInThemes: string[], layerIsNeededBy?: Map, @@ -386,7 +378,7 @@ export default class LayerConfig extends WithContextLoader { neededLayer: string }[] = [], addedByDefault = false, - canBeIncluded = true + canBeIncluded = true, ): string { const extraProps: string[] = [] extraProps.push("This layer is shown at zoomlevel **" + this.minzoom + "** and higher") @@ -394,32 +386,32 @@ export default class LayerConfig extends WithContextLoader { if (canBeIncluded) { if (addedByDefault) { extraProps.push( - "**This layer is included automatically in every theme. This layer might contain no points**" + "**This layer is included automatically in every theme. This layer might contain no points**", ) } if (this.shownByDefault === false) { extraProps.push( - "This layer is not visible by default and must be enabled in the filter by the user. " + "This layer is not visible by default and must be enabled in the filter by the user. ", ) } if (this.title === undefined) { extraProps.push( - "Elements don't have a title set and cannot be toggled nor will they show up in the dashboard. If you import this layer in your theme, override `title` to make this toggleable." + "Elements don't have a title set and cannot be toggled nor will they show up in the dashboard. If you import this layer in your theme, override `title` to make this toggleable.", ) } if (this.name === undefined && this.shownByDefault === false) { extraProps.push( - "This layer is not visible by default and the visibility cannot be toggled, effectively resulting in a fully hidden layer. This can be useful, e.g. to calculate some metatags. If you want to render this layer (e.g. for debugging), enable it by setting the URL-parameter layer-=true" + "This layer is not visible by default and the visibility cannot be toggled, effectively resulting in a fully hidden layer. This can be useful, e.g. to calculate some metatags. If you want to render this layer (e.g. for debugging), enable it by setting the URL-parameter layer-=true", ) } if (this.name === undefined) { extraProps.push( - "Not visible in the layer selection by default. If you want to make this layer toggable, override `name`" + "Not visible in the layer selection by default. If you want to make this layer toggable, override `name`", ) } if (this.mapRendering.length === 0) { extraProps.push( - "Not rendered on the map by default. If you want to rendering this on the map, override `mapRenderings`" + "Not rendered on the map by default. If you want to rendering this on the map, override `mapRenderings`", ) } @@ -429,12 +421,12 @@ export default class LayerConfig extends WithContextLoader { "", "This layer is loaded from an external source, namely ", "`" + this.source.geojsonSource + "`", - ].join("\n\n") + ].join("\n\n"), ) } } else { extraProps.push( - "This layer can **not** be included in a theme. It is solely used by [special renderings](SpecialRenderings.md) showing a minimap with custom data." + "This layer can **not** be included in a theme. It is solely used by [special renderings](SpecialRenderings.md) showing a minimap with custom data.", ) } @@ -444,7 +436,7 @@ export default class LayerConfig extends WithContextLoader { usingLayer = [ "## Themes using this layer", MarkdownUtils.list( - (usedInThemes ?? []).map((id) => `[${id}](https://mapcomplete.org/${id})`) + (usedInThemes ?? []).map((id) => `[${id}](https://mapcomplete.org/${id})`), ), ] } else if (this.source !== null) { @@ -460,7 +452,7 @@ export default class LayerConfig extends WithContextLoader { " into the layout as it depends on it: ", dep.reason, "(" + dep.context + ")", - ].join(" ") + ].join(" "), ) } @@ -487,7 +479,7 @@ export default class LayerConfig extends WithContextLoader { new And(preset.tags).asHumanString(true) + snaps ) - }) + }), ), ] } @@ -495,8 +487,8 @@ export default class LayerConfig extends WithContextLoader { for (const revDep of Utils.Dedup(layerIsNeededBy?.get(this.id) ?? [])) { extraProps.push( ["This layer is needed as dependency for layer", `[${revDep}](#${revDep})`].join( - " " - ) + " ", + ), ) } @@ -507,10 +499,10 @@ export default class LayerConfig extends WithContextLoader { .filter((values) => values.key !== "id") .map((values) => { const embedded: string[] = values.values?.map((v) => - Link.OsmWiki(values.key, v, true).SetClass("mr-2").AsMarkdown() + Link.OsmWiki(values.key, v, true).SetClass("mr-2").AsMarkdown(), ) ?? ["_no preset options defined, or no values in them_"] const statistics = `https://taghistory.raifer.tech/?#***/${encodeURIComponent( - values.key + values.key, )}/` const tagInfo = `https://taginfo.openstreetmap.org/keys/${values.key}#values` return [ @@ -525,7 +517,7 @@ export default class LayerConfig extends WithContextLoader { : `[${values.type}](../SpecialInputElements.md#${values.type})`, embedded.join(" "), ] - }) + }), ) let quickOverview: string[] = [] @@ -535,7 +527,7 @@ export default class LayerConfig extends WithContextLoader { "this quick overview is incomplete", MarkdownUtils.table( ["attribute", "type", "values which are supported by this layer"], - tableRows + tableRows, ), ] } @@ -569,19 +561,19 @@ export default class LayerConfig extends WithContextLoader { const parts = neededTags["and"] tagsDescription.push( "Elements must match **all** of the following expressions:", - parts.map((p, i) => i + ". " + p.asHumanString(true, false, {})).join("\n") + parts.map((p, i) => i + ". " + p.asHumanString(true, false, {})).join("\n"), ) } else if (neededTags["or"]) { const parts = neededTags["or"] tagsDescription.push( "Elements must match **any** of the following expressions:", - parts.map((p) => " - " + p.asHumanString(true, false, {})).join("\n") + parts.map((p) => " - " + p.asHumanString(true, false, {})).join("\n"), ) } else { tagsDescription.push( "Elements must match the expression **" + - neededTags.asHumanString(true, false, {}) + - "**" + neededTags.asHumanString(true, false, {}) + + "**", ) } diff --git a/src/Models/ThemeConfig/PointRenderingConfig.ts b/src/Models/ThemeConfig/PointRenderingConfig.ts index 8bae5f2960..4c74a48433 100644 --- a/src/Models/ThemeConfig/PointRenderingConfig.ts +++ b/src/Models/ThemeConfig/PointRenderingConfig.ts @@ -143,15 +143,6 @@ export default class PointRenderingConfig extends WithContextLoader { "w-full h-full block absolute top-0 left-0" ) } - - public GetBaseIcon(tags?: Record): BaseUIElement { - return new SvelteUIElement(DynamicMarker, { - marker: this.marker, - rotation: this.rotation, - tags: new ImmutableStore(tags), - }) - } - public RenderIcon( tags: Store>, options?: { diff --git a/src/Models/ThemeConfig/TagRenderingConfig.ts b/src/Models/ThemeConfig/TagRenderingConfig.ts index 1a33ed5d30..77f5f91e21 100644 --- a/src/Models/ThemeConfig/TagRenderingConfig.ts +++ b/src/Models/ThemeConfig/TagRenderingConfig.ts @@ -999,7 +999,7 @@ export class TagRenderingConfigUtils { tags: UIEventSource>, feature?: Feature ): Store { - const isNSI = NameSuggestionIndex.supportedTypes().indexOf(config.freeform?.key) >= 0 + const isNSI = NameSuggestionIndex.supportedTypes.indexOf( config.freeform?.key) >= 0 if (!isNSI) { return new ImmutableStore(config) } @@ -1019,8 +1019,8 @@ export class TagRenderingConfigUtils { ) ) }) - return extraMappings.map((extraMappings) => { - if (!extraMappings || extraMappings.length == 0) { + return extraMappings.mapD((extraMappings) => { + if (extraMappings.length == 0) { return config } const clone: TagRenderingConfig = Object.create(config) diff --git a/src/UI/AllThemesGui.svelte b/src/UI/AllThemesGui.svelte index 9681c01da1..99d2331d19 100644 --- a/src/UI/AllThemesGui.svelte +++ b/src/UI/AllThemesGui.svelte @@ -89,7 +89,7 @@ } let officialSearched: Store = filtered( - new ImmutableStore(officialThemes) + osmConnection.isLoggedIn.map(loggedIn => loggedIn ? officialThemes : officialThemes.filter(th => th.id !== "personal")) ) let hiddenSearched: Store = filtered(visitedHiddenThemes) let customSearched: Store = filtered(customThemes) @@ -102,6 +102,9 @@ } }) + /** + * Opens the first search candidate + */ function applySearch() { const didRedirect = SearchUtils.applySpecialSearch(search.data) if (didRedirect) { diff --git a/src/UI/Base/If.svelte b/src/UI/Base/If.svelte index 2644653ecb..5c87f6495d 100644 --- a/src/UI/Base/If.svelte +++ b/src/UI/Base/If.svelte @@ -5,16 +5,18 @@ /** * For some stupid reason, it is very hard to let {#if} work together with UIEventSources, so we wrap then here */ - export let condition: Store - let _c = condition.data - onDestroy( - condition.addCallback((c) => { - /* Do _not_ abbreviate this as `.addCallback(c => _c = c)`. This is the same as writing `.addCallback(c => {return _c = c})`, - which will _unregister_ the callback if `c = true`! */ - _c = c - return false - }) - ) + export let condition: Store | undefined + let _c = condition?.data + if (condition !== undefined) { + onDestroy( + condition.addCallback((c) => { + /* Do _not_ abbreviate this as `.addCallback(c => _c = c)`. This is the same as writing `.addCallback(c => {return _c = c})`, + which will _unregister_ the callback if `c = true`! */ + _c = c + return false + }) + ) + } {#if _c} diff --git a/src/UI/Base/ToSvelte.svelte b/src/UI/Base/ToSvelte.svelte index c6c7420718..059dd97eac 100644 --- a/src/UI/Base/ToSvelte.svelte +++ b/src/UI/Base/ToSvelte.svelte @@ -29,6 +29,7 @@ html?.remove() uiElement?.Destroy() }) + {#if isSvelte} diff --git a/src/UI/BigComponents/Filterview.svelte b/src/UI/BigComponents/Filterview.svelte index a59962d5ff..aa3bdec8bd 100644 --- a/src/UI/BigComponents/Filterview.svelte +++ b/src/UI/BigComponents/Filterview.svelte @@ -14,6 +14,7 @@ import Translations from "../i18n/Translations" import type { SpecialVisualizationState } from "../SpecialVisualization" import Constants from "../../Models/Constants" + import DefaultIcon from "../Map/DefaultIcon.svelte" export let state: SpecialVisualizationState export let filteredLayer: FilteredLayer @@ -58,7 +59,7 @@ {#if showLayerTitle}
- layer.defaultIcon()} /> +
diff --git a/src/UI/History/History.svelte b/src/UI/History/History.svelte index 66792cefc4..065822d084 100644 --- a/src/UI/History/History.svelte +++ b/src/UI/History/History.svelte @@ -10,6 +10,7 @@ import ToSvelte from "../Base/ToSvelte.svelte" import Tr from "../Base/Tr.svelte" import Translations from "../i18n/Translations" + import DefaultIcon from "../Map/DefaultIcon.svelte" export let onlyShowChangesBy: string[] export let id: OsmId @@ -58,7 +59,7 @@

- +
@@ -95,6 +96,7 @@
Labels
{#if $labels.length === 0} + {:else} {#each $labels as label}
diff --git a/src/UI/InspectorGUI.ts b/src/UI/InspectorGUI.ts index ac54e9c0d1..398250e2bf 100644 --- a/src/UI/InspectorGUI.ts +++ b/src/UI/InspectorGUI.ts @@ -3,5 +3,5 @@ import InspectorGUI from "./InspectorGUI.svelte" const target = document.getElementById("main") target.innerHTML = "" new InspectorGUI({ - target, + target }) diff --git a/src/UI/Map/DefaultIcon.svelte b/src/UI/Map/DefaultIcon.svelte new file mode 100644 index 0000000000..afe7c56751 --- /dev/null +++ b/src/UI/Map/DefaultIcon.svelte @@ -0,0 +1,27 @@ + + +{#if mapRenderings?.length > 0} +
+ {#each mapRenderings as mr} + + {/each} +
+{/if} diff --git a/src/UI/Map/DynamicMarker.svelte b/src/UI/Map/DynamicMarker.svelte index 2f6b1cb905..bc88a22919 100644 --- a/src/UI/Map/DynamicMarker.svelte +++ b/src/UI/Map/DynamicMarker.svelte @@ -24,7 +24,7 @@ } -{#if marker && marker} +{#if marker}
{#each marker as icon}
diff --git a/src/UI/NotFound.svelte b/src/UI/NotFound.svelte index 0ff5649195..9bbdfb6bfe 100644 --- a/src/UI/NotFound.svelte +++ b/src/UI/NotFound.svelte @@ -2,21 +2,26 @@ import Tr from "./Base/Tr.svelte" import Translations from "./i18n/Translations.ts" import BackButton from "./Base/BackButton.svelte" + import Not_found from "../assets/svg/Not_found.svelte" + import World from "../assets/svg/World.svelte" + console.log("???") -
-
- - { +
+
+ +

+ +

+
+ { window.location = "index.html" }} - > -
- -
-
-
-
+ > +
+ +
+ +
diff --git a/src/UI/Popup/DeleteFlow/DeleteFlowState.ts b/src/UI/Popup/DeleteFlow/DeleteFlowState.ts index 97bd828769..cfe7e8d720 100644 --- a/src/UI/Popup/DeleteFlow/DeleteFlowState.ts +++ b/src/UI/Popup/DeleteFlow/DeleteFlowState.ts @@ -43,14 +43,13 @@ export class DeleteFlowState { console.log("Checking deleteability (internet?", useTheInternet, ")") const t = Translations.t.delete const id = this._id - const self = this if (!id.startsWith("node")) { this.canBeDeleted.setData(false) this.canBeDeletedReason.setData(t.isntAPoint) return } - // Does the currently logged in user have enough experience to delete this point? + // Does the currently logged-in user have enough experience to delete this point? const deletingPointsOfOtherAllowed = this._osmConnection.userDetails.map((ud) => { if (ud === undefined) { return undefined @@ -74,10 +73,10 @@ export class DeleteFlowState { // Not yet downloaded return null } - const userId = self._osmConnection.userDetails.data.uid + const userId = this._osmConnection.userDetails.data.uid return !previous.some((editor) => editor !== userId) }, - [self._osmConnection.userDetails] + [this._osmConnection.userDetails] ) // User allowed OR only edited by self? @@ -96,14 +95,13 @@ export class DeleteFlowState { if (allByMyself.data === null && useTheInternet) { // We kickoff the download here as it hasn't yet been downloaded. Note that this is mapped onto 'all by myself' above - const hist = this.objectDownloader - .downloadHistory(id) - .map((versions) => + UIEventSource.FromPromise(this.objectDownloader + .downloadHistory(id)) + .mapD((versions) => versions.map((version) => Number(version.tags["_last_edit:contributor:uid"]) ) - ) - hist.addCallbackAndRunD((hist) => previousEditors.setData(hist)) + ).addCallbackAndRunD((hist) => previousEditors.setData(hist)) } if (allByMyself.data === true) { diff --git a/src/UI/Popup/DisabledQuestionsLayer.svelte b/src/UI/Popup/DisabledQuestionsLayer.svelte index 6460f2fac9..8396e5843e 100644 --- a/src/UI/Popup/DisabledQuestionsLayer.svelte +++ b/src/UI/Popup/DisabledQuestionsLayer.svelte @@ -8,6 +8,7 @@ import { Translation } from "../i18n/Translation" import { XMarkIcon } from "@babeard/svelte-heroicons/mini" import ToSvelte from "../Base/ToSvelte.svelte" + import DefaultIcon from "../Map/DefaultIcon.svelte" export let layer: LayerConfig export let state: ThemeViewState @@ -28,7 +29,7 @@

- layer.defaultIcon()} /> +

diff --git a/src/UI/Popup/TagRendering/Questionbox.svelte b/src/UI/Popup/TagRendering/Questionbox.svelte index 83d21adfa4..44515c746b 100644 --- a/src/UI/Popup/TagRendering/Questionbox.svelte +++ b/src/UI/Popup/TagRendering/Questionbox.svelte @@ -12,7 +12,6 @@ import Translations from "../../i18n/Translations.js" import { Utils } from "../../../Utils" import { onDestroy } from "svelte" - import TagRenderingQuestion from "./TagRenderingQuestion.svelte" import TagRenderingQuestionDynamic from "./TagRenderingQuestionDynamic.svelte" export let layer: LayerConfig @@ -54,6 +53,7 @@ let skippedQuestions = new UIEventSource>(new Set()) let layerDisabledForTheme = state.userRelatedState.getThemeDisabled(state.theme.id, layer.id) layerDisabledForTheme.addCallbackAndRunD((disabled) => { + console.log("Disabled questions are ", disabled) skippedQuestions.set(new Set(disabled.concat(Array.from(skippedQuestions.data)))) }) let questionboxElem: HTMLDivElement diff --git a/src/UI/Popup/TagRendering/SpecialTranslation.svelte b/src/UI/Popup/TagRendering/SpecialTranslation.svelte index 417654a84a..e83b647d19 100644 --- a/src/UI/Popup/TagRendering/SpecialTranslation.svelte +++ b/src/UI/Popup/TagRendering/SpecialTranslation.svelte @@ -49,9 +49,13 @@ function createVisualisation(specpart: Exclude): BaseUIElement { { try { - return specpart.func + const uiEl = specpart.func .constr(state, tags, specpart.args, feature, layer) ?.SetClass(specpart.style) + if (uiEl === undefined) { + console.error("Invalid special translation") + } + return uiEl } catch (e) { console.error( "Could not construct a special visualisation with specification", diff --git a/src/UI/Popup/TagRendering/TagRenderingAnswerDynamic.svelte b/src/UI/Popup/TagRendering/TagRenderingAnswerDynamic.svelte index 97184366f0..56168d48eb 100644 --- a/src/UI/Popup/TagRendering/TagRenderingAnswerDynamic.svelte +++ b/src/UI/Popup/TagRendering/TagRenderingAnswerDynamic.svelte @@ -7,6 +7,7 @@ import { UIEventSource } from "../../../Logic/UIEventSource" import LayerConfig from "../../../Models/ThemeConfig/LayerConfig" import TagRenderingAnswer from "./TagRenderingAnswer.svelte" + import Loading from "../../Base/Loading.svelte" export let tags: UIEventSource | undefined> @@ -20,12 +21,16 @@ let dynamicConfig = TagRenderingConfigUtils.withNameSuggestionIndex(config, tags, selectedElement) - +{#if $dynamicConfig === undefined} + +{:else} + +{/if} diff --git a/src/UI/Popup/TagRendering/TagRenderingEditableDynamic.svelte b/src/UI/Popup/TagRendering/TagRenderingEditableDynamic.svelte index c4fe15c7b1..aeeadd204f 100644 --- a/src/UI/Popup/TagRendering/TagRenderingEditableDynamic.svelte +++ b/src/UI/Popup/TagRendering/TagRenderingEditableDynamic.svelte @@ -7,6 +7,7 @@ import type { SpecialVisualizationState } from "../../SpecialVisualization" import LayerConfig from "../../../Models/ThemeConfig/LayerConfig" import TagRenderingEditable from "./TagRenderingEditable.svelte" + import Loading from "../../Base/Loading.svelte" export let config: TagRenderingConfig export let tags: UIEventSource> @@ -23,14 +24,18 @@ let dynamicConfig = TagRenderingConfigUtils.withNameSuggestionIndex(config, tags, selectedElement) - +{#if $dynamicConfig} + +{:else} + +{/if} diff --git a/src/UI/Popup/TagRendering/TagRenderingMapping.svelte b/src/UI/Popup/TagRendering/TagRenderingMapping.svelte index 73413b0e9e..f28b8633bd 100644 --- a/src/UI/Popup/TagRendering/TagRenderingMapping.svelte +++ b/src/UI/Popup/TagRendering/TagRenderingMapping.svelte @@ -15,6 +15,7 @@ import SvelteUIElement from "../../Base/SvelteUIElement" import Icon from "../../Map/Icon.svelte" import { TagsFilter } from "../../../Logic/Tags/TagsFilter" + import DefaultIcon from "../../Map/DefaultIcon.svelte" export let selectedElement: Feature export let tags: UIEventSource> @@ -27,6 +28,7 @@ */ export let clss: string = "ml-2" export let mapping: { + readonly if?: TagsFilter readonly then: Translation readonly searchTerms?: Record readonly icon?: string @@ -46,13 +48,13 @@ large: "5rem", } - function getAutoIcon(mapping: { if?: TagsFilter }): BaseUIElement { + function getAutoIcon(mapping: { readonly if?: TagsFilter }): Readonly> { for (const preset of layer.presets) { if (!new And(preset.tags).shadows(mapping.if)) { continue } - return layer.defaultIcon(TagUtils.asProperties(preset.tags)) + return TagUtils.asProperties(preset.tags) } return undefined } @@ -62,7 +64,7 @@
{#if mapping.icon === "auto"}
- getAutoIcon(mapping)} /> +
{:else} ([]) let menuIsOpened = new UIEventSource(false) function disableQuestion() { @@ -361,7 +360,7 @@ {#if question !== undefined && $apiState !== "readonly" && $apiState !== "offline"}
- {#if layer.isNormal()} + {#if layer?.isNormal()} @@ -559,7 +558,7 @@

v === "yes" || v === "full" || v === "always" )} > diff --git a/src/UI/Popup/TagRendering/TagRenderingQuestionDynamic.svelte b/src/UI/Popup/TagRendering/TagRenderingQuestionDynamic.svelte index 15cb4f19b2..a0ca380778 100644 --- a/src/UI/Popup/TagRendering/TagRenderingQuestionDynamic.svelte +++ b/src/UI/Popup/TagRendering/TagRenderingQuestionDynamic.svelte @@ -18,6 +18,7 @@ import { twJoin } from "tailwind-merge" import Tr from "../../Base/Tr.svelte" import { TrashIcon } from "@rgossiaux/svelte-heroicons/solid" + import Loading from "../../Base/Loading.svelte" export let config: TagRenderingConfig export let tags: UIEventSource> @@ -31,14 +32,18 @@ let dynamicConfig = TagRenderingConfigUtils.withNameSuggestionIndex(config, tags, selectedElement) - - - +{#if $dynamicConfig } + + + +{:else} + +{/if} diff --git a/src/UI/Search/ActiveFilters.svelte b/src/UI/Search/ActiveFilters.svelte index 3332581080..9452646a7d 100644 --- a/src/UI/Search/ActiveFilters.svelte +++ b/src/UI/Search/ActiveFilters.svelte @@ -14,6 +14,7 @@ import FilterSearch from "../../Logic/Search/FilterSearch" import Locale from "../i18n/Locale" + import DefaultIcon from "../Map/DefaultIcon.svelte" export let activeFilters: (FilterSearchResult & ActiveFilter)[] let language = Locale.language @@ -72,7 +73,7 @@ {#if $activeLayers.length === 1} enableAllLayers()}>
- +
@@ -82,7 +83,7 @@ {#each $nonactiveLayers as nonActive (nonActive.layerDef.id)} nonActive.isDisplayed.set(true)}>
- +
diff --git a/src/UI/Search/FilterResult.svelte b/src/UI/Search/FilterResult.svelte index e19a213391..0ea0e07d6e 100644 --- a/src/UI/Search/FilterResult.svelte +++ b/src/UI/Search/FilterResult.svelte @@ -6,6 +6,7 @@ import type { FilterSearchResult } from "../../Logic/Search/FilterSearch" import LayerConfig from "../../Models/ThemeConfig/LayerConfig" import Loading from "../Base/Loading.svelte" + import DefaultIcon from "../Map/DefaultIcon.svelte" export let entry: FilterSearchResult[] | LayerConfig let asFilter: FilterSearchResult[] @@ -41,7 +42,7 @@
{#if asLayer}
- +
diff --git a/src/UI/Search/GeocodeResult.svelte b/src/UI/Search/GeocodeResult.svelte index 2f3f6fc6fd..3562ab02af 100644 --- a/src/UI/Search/GeocodeResult.svelte +++ b/src/UI/Search/GeocodeResult.svelte @@ -12,6 +12,7 @@ import Icon from "../Map/Icon.svelte" import TagRenderingAnswer from "../Popup/TagRendering/TagRenderingAnswer.svelte" import ArrowUp from "@babeard/svelte-heroicons/mini/ArrowUp" + import DefaultIcon from "../Map/DefaultIcon.svelte" export let entry: GeocodeResult export let state: SpecialVisualizationState @@ -62,9 +63,7 @@
{#if layer}
- layer.defaultIcon(entry.feature.properties)?.SetClass("w-6 h-6")} - /> +
{:else if entry.category} >, args: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): SvelteUIElement { const isOpen = args[0] === "open" const readonly = args[1] === "readonly" || args[1] === "yes" @@ -192,7 +192,7 @@ class StealViz implements SpecialVisualization { selectedElement: otherFeature, state, layer, - }) + }), ) } if (elements.length === 1) { @@ -200,8 +200,8 @@ class StealViz implements SpecialVisualization { } return new Combine(elements).SetClass("flex flex-col") }, - [state.indexedFeatures.featuresById] - ) + [state.indexedFeatures.featuresById], + ), ) } @@ -253,11 +253,11 @@ class CloseNoteViz implements SpecialVisualization { public constr( state: SpecialVisualizationState, tags: UIEventSource>, - args: string[] + args: string[], ): SvelteUIElement { const { text, icon, idkey, comment, minZoom, zoomButton } = Utils.ParseVisArgs( this.args, - args + args, ) return new SvelteUIElement(CloseNoteButton, { @@ -298,7 +298,7 @@ export class QuestionViz implements SpecialVisualization { tags: UIEventSource>, args: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): SvelteUIElement { const labels = args[0] ?.split(";") @@ -315,7 +315,7 @@ export class QuestionViz implements SpecialVisualization { state, onlyForLabels: labels, notForLabels: blacklist, - }).SetClass("w-full") + }) } } @@ -330,7 +330,7 @@ export default class SpecialVisualizations { for (const specialVisualization of SpecialVisualizations.specialVisualizations) { SpecialVisualizations.specialVisualisationsDict.set( specialVisualization.funcName, - specialVisualization + specialVisualization, ) } } @@ -350,15 +350,15 @@ export default class SpecialVisualizations { viz.docs, viz.args.length > 0 ? MarkdownUtils.table( - ["name", "default", "description"], - viz.args.map((arg) => { - let defaultArg = arg.defaultValue ?? "_undefined_" - if (defaultArg == "") { - defaultArg = "_empty string_" - } - return [arg.name, defaultArg, arg.doc] - }) - ) + ["name", "default", "description"], + viz.args.map((arg) => { + let defaultArg = arg.defaultValue ?? "_undefined_" + if (defaultArg == "") { + defaultArg = "_empty string_" + } + return [arg.name, defaultArg, arg.doc] + }), + ) : undefined, "#### Example usage of " + viz.funcName, "" + example + "", @@ -367,18 +367,18 @@ export default class SpecialVisualizations { public static constructSpecification( template: string, - extraMappings: SpecialVisualization[] = [] + extraMappings: SpecialVisualization[] = [], ): RenderingSpecification[] { return SpecialVisualisationUtils.constructSpecification( template, SpecialVisualizations.specialVisualisationsDict, - extraMappings + extraMappings, ) } public static HelpMessage(): string { const helpTexts: string[] = SpecialVisualizations.specialVisualizations.map((viz) => - SpecialVisualizations.DocumentationFor(viz) + SpecialVisualizations.DocumentationFor(viz), ) const firstPart = new Combine([ @@ -411,10 +411,10 @@ export default class SpecialVisualizations { }, }, null, - " " - ) + " ", + ), ).SetClass("code"), - 'In other words: use `{ "before": ..., "after": ..., "special": {"type": ..., "argname": ...argvalue...}`. The args are in the `special` block; an argvalue can be a string, a translation or another value. (Refer to class `RewriteSpecial` in case of problems)', + "In other words: use `{ \"before\": ..., \"after\": ..., \"special\": {\"type\": ..., \"argname\": ...argvalue...}`. The args are in the `special` block; an argvalue can be a string, a translation or another value. (Refer to class `RewriteSpecial` in case of problems)", ]) .SetClass("flex flex-col") .AsMarkdown() @@ -435,7 +435,7 @@ export default class SpecialVisualizations { return new SvelteUIElement(AddNewPoint, { state, coordinate: { lon, lat }, - }).SetClass("w-full h-full overflow-auto") + }) }, }, { @@ -452,10 +452,10 @@ export default class SpecialVisualizations { assignTo: state.userRelatedState.language, availableLanguages: languages, preferredLanguages: state.osmConnection.userDetails.map( - (ud) => ud.languages + (ud) => ud.languages, ), }) - }) + }), ) }, }, @@ -494,7 +494,7 @@ export default class SpecialVisualizations { state: SpecialVisualizationState, tagSource: UIEventSource>, args: string[], - feature: Feature + feature: Feature, ): SvelteUIElement { return new SvelteUIElement(MinimapViz, { state, args, feature, tagSource }) }, @@ -506,7 +506,7 @@ export default class SpecialVisualizations { constr( state: SpecialVisualizationState, - tagSource: UIEventSource> + tagSource: UIEventSource>, ): BaseUIElement { return new VariableUiElement( tagSource @@ -516,7 +516,7 @@ export default class SpecialVisualizations { return new SvelteUIElement(SplitRoadWizard, { id, state }) } return undefined - }) + }), ) }, }, @@ -530,7 +530,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { if (feature.geometry.type !== "Point") { return undefined @@ -553,7 +553,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { if (!layer.deletion) { return undefined @@ -564,7 +564,7 @@ export default class SpecialVisualizations { state, feature, layer, - }).SetClass("p-0 m-0") + }) }, }, new ShareLinkViz(), @@ -579,7 +579,7 @@ export default class SpecialVisualizations { tags: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ) { if (feature.geometry.type !== "LineString") { return undefined @@ -611,7 +611,7 @@ export default class SpecialVisualizations { state: SpecialVisualizationState, tagSource: UIEventSource>, argument: string[], - feature: Feature + feature: Feature, ): BaseUIElement { const [lon, lat] = GeoOperations.centerpointCoordinates(feature) return new SvelteUIElement(CreateNewNote, { @@ -674,7 +674,7 @@ export default class SpecialVisualizations { .map((tags) => tags[args[0]]) .map((wikidata) => { wikidata = Utils.NoEmpty( - wikidata?.split(";")?.map((wd) => wd.trim()) ?? [] + wikidata?.split(";")?.map((wd) => wd.trim()) ?? [], )[0] const entry = Wikidata.LoadWikidataEntry(wikidata) return new VariableUiElement( @@ -684,9 +684,9 @@ export default class SpecialVisualizations { } const response = e["success"] return Translation.fromMap(response.labels) - }) + }), ) - }) + }), ), }, new MapillaryLinkVis(), @@ -700,7 +700,7 @@ export default class SpecialVisualizations { tags: UIEventSource>, _, __, - layer: LayerConfig + layer: LayerConfig, ) => new SvelteUIElement(AllTagsPanel, { tags, layer }), }, { @@ -784,7 +784,7 @@ export default class SpecialVisualizations { nameKey: nameKey, fallbackName, }, - state.featureSwitchIsTesting + state.featureSwitchIsTesting, ) return new SvelteUIElement(StarsBarIcon, { score: reviews.average, @@ -818,7 +818,7 @@ export default class SpecialVisualizations { nameKey: nameKey, fallbackName, }, - state.featureSwitchIsTesting + state.featureSwitchIsTesting, ) return new SvelteUIElement(ReviewForm, { reviews, state, tags, feature, layer }) }, @@ -849,7 +849,7 @@ export default class SpecialVisualizations { nameKey: nameKey, fallbackName, }, - state.featureSwitchIsTesting + state.featureSwitchIsTesting, ) return new SvelteUIElement(AllReviews, { reviews, state, tags, feature, layer }) }, @@ -875,7 +875,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, args: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { return new Combine([ SpecialVisualizations.specialVisualisationsDict["create_review"].constr( @@ -883,14 +883,14 @@ export default class SpecialVisualizations { tagSource, args, feature, - layer + layer, ), SpecialVisualizations.specialVisualisationsDict["list_reviews"].constr( state, tagSource, args, feature, - layer + layer, ), ]) }, @@ -908,7 +908,7 @@ export default class SpecialVisualizations { constr( state: SpecialVisualizationState, _: UIEventSource>, - argument: string[] + argument: string[], ): BaseUIElement { const [text] = argument return new SvelteUIElement(ImportReviewIdentity, { state, text }) @@ -965,7 +965,7 @@ export default class SpecialVisualizations { constr( state: SpecialVisualizationState, tags: UIEventSource>, - args: string[] + args: string[], ): SvelteUIElement { const keyToUse = args[0] const prefix = args[1] @@ -1002,17 +1002,17 @@ export default class SpecialVisualizations { return undefined } const allUnits: Unit[] = [].concat( - ...(state?.theme?.layers?.map((lyr) => lyr.units) ?? []) + ...(state?.theme?.layers?.map((lyr) => lyr.units) ?? []), ) const unit = allUnits.filter((unit) => - unit.isApplicableToKey(key) + unit.isApplicableToKey(key), )[0] if (unit === undefined) { return value } const getCountry = () => tagSource.data._country return unit.asHumanLongValue(value, getCountry) - }) + }), ) }, }, @@ -1065,8 +1065,8 @@ export default class SpecialVisualizations { constr: (state) => { return new SubtleButton( - new SvelteUIElement(Trash).SetClass("h-6"), - Translations.t.general.removeLocationHistory + new SvelteUIElement(Trash), + Translations.t.general.removeLocationHistory, ).onClick(() => { state.historicalUserLocations.features.setData([]) state.selectedElement.setData(undefined) @@ -1107,10 +1107,10 @@ export default class SpecialVisualizations { new SvelteUIElement(NoteCommentElement, { comment, state, - }) - ) + }), + ), ).SetClass("flex flex-col") - }) + }), ), }, { @@ -1143,7 +1143,7 @@ export default class SpecialVisualizations { tagsSource: UIEventSource>, _: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ) => new VariableUiElement( tagsSource.map((tags) => { @@ -1161,9 +1161,7 @@ export default class SpecialVisualizations { feature, layer, }) - .SetClass("px-1") - .setSpan() - }) + }), ), }, { @@ -1179,8 +1177,8 @@ export default class SpecialVisualizations { const challenge = Stores.FromPromise( Utils.downloadJsonCached( `${Maproulette.defaultEndpoint}/challenge/${parentId}`, - 24 * 60 * 60 * 1000 - ) + 24 * 60 * 60 * 1000, + ), ) return new VariableUiElement( @@ -1205,7 +1203,7 @@ export default class SpecialVisualizations { } else { return [title, new List(listItems)] } - }) + }), ) }, docs: "Fetches the metadata of MapRoulette campaign that this task is part of and shows those details (namely `title`, `description` and `instruction`).\n\nThis reads the property `mr_challengeId` to detect the parent campaign.", @@ -1219,15 +1217,15 @@ export default class SpecialVisualizations { "\n" + "```json\n" + "{\n" + - ' "id": "mark_duplicate",\n' + - ' "render": {\n' + - ' "special": {\n' + - ' "type": "maproulette_set_status",\n' + - ' "message": {\n' + - ' "en": "Mark as not found or false positive"\n' + + " \"id\": \"mark_duplicate\",\n" + + " \"render\": {\n" + + " \"special\": {\n" + + " \"type\": \"maproulette_set_status\",\n" + + " \"message\": {\n" + + " \"en\": \"Mark as not found or false positive\"\n" + " },\n" + - ' "status": "2",\n' + - ' "image": "close"\n' + + " \"status\": \"2\",\n" + + " \"image\": \"close\"\n" + " }\n" + " }\n" + "}\n" + @@ -1303,7 +1301,7 @@ export default class SpecialVisualizations { (l) => l.name !== null && l.title && - state.perLayer.get(l.id) !== undefined + state.perLayer.get(l.id) !== undefined, ) .map( (l) => { @@ -1313,8 +1311,8 @@ export default class SpecialVisualizations { const fsBboxed = new BBoxFeatureSourceForLayer(fs, bbox) return new StatisticsPanel(fsBboxed) }, - [state.mapProperties.bounds] - ) + [state.mapProperties.bounds], + ), ) }, }, @@ -1384,7 +1382,7 @@ export default class SpecialVisualizations { constr( state: SpecialVisualizationState, tagSource: UIEventSource>, - args: string[] + args: string[], ): SvelteUIElement { let [text, href, classnames, download, ariaLabel, icon] = args if (download === "") { @@ -1422,7 +1420,7 @@ export default class SpecialVisualizations { }, }, null, - " " + " ", ) + "\n```", args: [ @@ -1446,7 +1444,7 @@ export default class SpecialVisualizations { featureTags: UIEventSource>, args: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ) { const [key, tr, classesRaw] = args let classes = classesRaw ?? "" @@ -1464,7 +1462,7 @@ export default class SpecialVisualizations { "Could not create a special visualization for multi(", args.join(", ") + ")", "no properties found for object", - feature.properties.id + feature.properties.id, ) return undefined } @@ -1476,11 +1474,12 @@ export default class SpecialVisualizations { state, feature, layer, - }).SetClass(classes) + // clss: classes ?? "", + }) .SetClass(classes) elements.push(subsTr) } return elements - }) + }), ) }, }, @@ -1500,7 +1499,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { return new VariableUiElement( tagSource.map((tags) => { @@ -1512,7 +1511,7 @@ export default class SpecialVisualizations { console.error("Cannot create a translation for", v, "due to", e) return JSON.stringify(v) } - }) + }), ) }, }, @@ -1532,7 +1531,7 @@ export default class SpecialVisualizations { tags: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { const key = argument[0] return new SvelteUIElement(FediverseLink, { key, tags, state }) @@ -1554,7 +1553,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, args: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { return new FixedUiElement("{" + args[0] + "}") }, @@ -1575,7 +1574,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { const key = argument[0] ?? "value" return new VariableUiElement( @@ -1593,12 +1592,12 @@ export default class SpecialVisualizations { } catch (e) { return new FixedUiElement( "Could not parse this tag: " + - JSON.stringify(value) + - " due to " + - e + JSON.stringify(value) + + " due to " + + e, ).SetClass("alert") } - }) + }), ) }, }, @@ -1619,7 +1618,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { const giggityUrl = argument[0] return new SvelteUIElement(Giggity, { tags: tagSource, state, giggityUrl }) @@ -1635,12 +1634,12 @@ export default class SpecialVisualizations { _: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { const tags = (( state )).geolocation.currentUserLocation.features.map( - (features) => features[0]?.properties + (features) => features[0]?.properties, ) return new Combine([ new SvelteUIElement(OrientationDebugPanel, {}), @@ -1662,7 +1661,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { return new SvelteUIElement(MarkAsFavourite, { tags: tagSource, @@ -1682,14 +1681,14 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { return new SvelteUIElement(MarkAsFavouriteMini, { tags: tagSource, state, layer, feature, - }).SetClass("w-full h-full") + }) }, }, { @@ -1702,7 +1701,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { return new SvelteUIElement(DirectionIndicator, { state, feature }) }, @@ -1715,7 +1714,7 @@ export default class SpecialVisualizations { state: SpecialVisualizationState, tags: UIEventSource>, argument: string[], - feature: Feature + feature: Feature, ): SvelteUIElement { return new SvelteUIElement(QrCode, { state, tags, feature }) }, @@ -1734,7 +1733,7 @@ export default class SpecialVisualizations { constr( state: SpecialVisualizationState, tagSource: UIEventSource>, - args: string[] + args: string[], ): BaseUIElement { const key = args[0] === "" ? "_direction:centerpoint" : args[0] return new VariableUiElement( @@ -1745,11 +1744,11 @@ export default class SpecialVisualizations { }) .mapD((value) => { const dir = GeoOperations.bearingToHuman( - GeoOperations.parseBearing(value) + GeoOperations.parseBearing(value), ) console.log("Human dir", dir) return Translations.t.general.visualFeedback.directionsAbsolute[dir] - }) + }), ) }, }, @@ -1779,7 +1778,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, args: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { const url = args[0] const readonly = args[3] === "yes" @@ -1805,12 +1804,12 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, args: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { return new Toggle( undefined, new SvelteUIElement(LoginButton, { osmConnection: state.osmConnection }), - state.osmConnection.isLoggedIn + state.osmConnection.isLoggedIn, ) }, }, @@ -1848,7 +1847,7 @@ export default class SpecialVisualizations { tags: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { const key = argument[0] ?? "website" const useProxy = argument[1] !== "no" @@ -1856,7 +1855,7 @@ export default class SpecialVisualizations { const isClosed = (argument[4] ?? "yes") === "yes" const countryStore: Store = tags.mapD( - (tags) => tags._country + (tags) => tags._country, ) const sourceUrl: Store = tags.mapD((tags) => { if (!tags[key] || tags[key] === "undefined") { @@ -1878,24 +1877,24 @@ export default class SpecialVisualizations { const features = await LinkedDataLoader.fetchVeloparkEntry( url, - loadAll + loadAll, ) const feature = features.find( - (f) => f.properties["ref:velopark"] === url + (f) => f.properties["ref:velopark"] === url, ) ?? features[0] const properties = feature.properties properties["ref:velopark"] = url console.log( "Got properties from velopark:", - properties + properties, ) return properties } catch (e) { console.error(e) throw e } - })() + })(), ) } if (country === undefined) { @@ -1907,29 +1906,29 @@ export default class SpecialVisualizations { return await LinkedDataLoader.fetchJsonLd( url, { country }, - useProxy ? "proxy" : "fetch-lod" + useProxy ? "proxy" : "fetch-lod", ) } catch (e) { console.log( "Could not get with proxy/download LOD, attempting to download directly. Error for ", url, "is", - e + e, ) return await LinkedDataLoader.fetchJsonLd( url, { country }, - "fetch-raw" + "fetch-raw", ) } - })() + })(), ) }, - [countryStore] + [countryStore], ) externalData.addCallbackAndRunD((lod) => - console.log("linked_data_from_website received the following data:", lod) + console.log("linked_data_from_website received the following data:", lod), ) return new Toggle( @@ -1944,7 +1943,7 @@ export default class SpecialVisualizations { collapsed: isClosed, }), undefined, - sourceUrl.map((url) => !!url) + sourceUrl.map((url) => !!url), ) }, }, @@ -1964,7 +1963,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { const text = argument[0] const cssClasses = argument[1] @@ -1986,7 +1985,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { const translation = tagSource.map((tags) => { const layer = state.theme.getMatchingLayer(tags) @@ -2018,7 +2017,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): SvelteUIElement { return new SvelteUIElement(ClearCaches, { msg: argument[0] ?? "Clear local caches", @@ -2043,7 +2042,7 @@ export default class SpecialVisualizations { tags: UIEventSource>, argument: string[], selectedElement: Feature, - layer: LayerConfig + layer: LayerConfig, ): SvelteUIElement { const [header, labelsStr] = argument const labels = labelsStr.split(";").map((x) => x.trim()) @@ -2066,7 +2065,7 @@ export default class SpecialVisualizations { tags: UIEventSource>, argument: string[], selectedElement: Feature, - layer: LayerConfig + layer: LayerConfig, ): SvelteUIElement { const t = Translations.t.preset_type const question: QuestionableTagRenderingConfigJson = { @@ -2106,7 +2105,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { const text = argument[0] return new SubtleButton(undefined, text).onClick(() => { @@ -2137,7 +2136,7 @@ export default class SpecialVisualizations { "Invalid special visualisation found: funcName is undefined or doesn't match " + regex + invalid.map((sp) => sp.i).join(", ") + - '. Did you perhaps type \n funcName: "funcname" // type declaration uses COLON\ninstead of:\n funcName = "funcName" // value definition uses EQUAL' + ". Did you perhaps type \n funcName: \"funcname\" // type declaration uses COLON\ninstead of:\n funcName = \"funcName\" // value definition uses EQUAL" ) } diff --git a/src/UI/ThemeViewGUI.svelte b/src/UI/ThemeViewGUI.svelte index 2827533840..6c9862f2ff 100644 --- a/src/UI/ThemeViewGUI.svelte +++ b/src/UI/ThemeViewGUI.svelte @@ -47,6 +47,7 @@ import ChevronRight from "@babeard/svelte-heroicons/mini/ChevronRight" import { Drawer } from "flowbite-svelte" import { linear } from "svelte/easing" + import DefaultIcon from "./Map/DefaultIcon.svelte" export let state: ThemeViewState @@ -395,7 +396,7 @@
- {#if currentViewLayer?.tagRenderings && currentViewLayer.defaultIcon()} + {#if currentViewLayer?.tagRenderings && currentViewLayer.hasDefaultIcon()} { state.selectCurrentView() @@ -403,7 +404,7 @@ on:keydown={forwardEventToMap} >
- currentViewLayer.defaultIcon()} /> +
{/if} diff --git a/src/assets/contributors.json b/src/assets/contributors.json index 98446521a2..c270d25f36 100644 --- a/src/assets/contributors.json +++ b/src/assets/contributors.json @@ -1,7 +1,7 @@ { "contributors": [ { - "commits": 8792, + "commits": 8786, "contributor": "Pieter Vander Vennet" }, { diff --git a/src/assets/generated/editor-layer-index-global.json b/src/assets/generated/editor-layer-index-global.json deleted file mode 100644 index f6818d8337..0000000000 --- a/src/assets/generated/editor-layer-index-global.json +++ /dev/null @@ -1,131 +0,0 @@ -[ - { - "name": "CyclOSM", - "id": "cyclosm", - "url": "https://{switch:a,b,c}.tile-cyclosm.openstreetmap.fr/cyclosm/{zoom}/{x}/{y}.png", - "attribution": { - "text": "Rendering: CyclOSM (hosted by OpenStreetMap France) © Map data OpenStreetMap contributors", - "url": "https://www.cyclosm.org/" - }, - "type": "tms", - "category": "osmbasedmap", - "max_zoom": 20 - }, - { - "name": "Esri World Imagery", - "id": "EsriWorldImagery", - "url": "https://{switch:services,server}.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{zoom}/{y}/{x}", - "attribution": { - "required": true, - "text": "Terms & Feedback", - "url": "https://wiki.openstreetmap.org/wiki/Esri" - }, - "type": "tms", - "category": "photo", - "max_zoom": 22, - "default": true - }, - { - "name": "Esri World Imagery (Clarity) Beta", - "id": "EsriWorldImageryClarity", - "url": "https://clarity.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/MapServer/tile/{zoom}/{y}/{x}", - "attribution": { - "required": true, - "text": "Terms & Feedback", - "url": "https://wiki.openstreetmap.org/wiki/Esri" - }, - "type": "tms", - "category": "photo", - "max_zoom": 22, - "default": true - }, - { - "name": "Mapbox Satellite", - "id": "Mapbox", - "url": "https://{switch:a,b,c,d}.tiles.mapbox.com/v4/mapbox.satellite/{zoom}/{x}/{y}.jpg?access_token=pk.eyJ1Ijoib3BlbnN0cmVldG1hcCIsImEiOiJjbGZkempiNDkyandvM3lwY3M4MndpdWdzIn0.QnvRv52n3qffVEKmQa9vJA", - "attribution": { - "required": true, - "text": "Terms & Feedback", - "url": "https://www.mapbox.com/about/maps" - }, - "type": "tms", - "category": "photo", - "max_zoom": 22, - "default": true - }, - { - "name": "OpenAerialMap Mosaic, by Kontur.io", - "id": "OpenAerialMapMosaic", - "url": "https://apps.kontur.io/raster-tiler/oam/mosaic/{zoom}/{x}/{y}.png", - "type": "tms", - "category": "photo", - "min_zoom": 1, - "max_zoom": 31, - "default": true - }, - { - "name": "OpenStreetMap (Basque Style)", - "id": "osmfr-basque", - "url": "https://tile.openstreetmap.bzh/eu/{zoom}/{x}/{y}.png", - "attribution": { - "required": true, - "text": "Tiles © OpenStreetMap France, data © OpenStreetMap contributors, ODbL", - "url": "https://www.openstreetmap.org/" - }, - "type": "tms", - "category": "osmbasedmap", - "max_zoom": 20 - }, - { - "name": "OpenStreetMap (Breton Style)", - "id": "osmfr-breton", - "url": "https://tile.openstreetmap.bzh/br/{zoom}/{x}/{y}.png", - "attribution": { - "required": true, - "text": "Tiles © OpenStreetMap France, data © OpenStreetMap contributors, ODbL", - "url": "https://www.openstreetmap.org/" - }, - "type": "tms", - "category": "osmbasedmap", - "max_zoom": 20 - }, - { - "name": "OpenStreetMap (French Style)", - "id": "osmfr", - "url": "https://{switch:a,b,c}.tile.openstreetmap.fr/osmfr/{zoom}/{x}/{y}.png", - "attribution": { - "required": true, - "text": "Tiles © cquest@Openstreetmap France, data © OpenStreetMap contributors, ODBL", - "url": "https://www.openstreetmap.org/" - }, - "type": "tms", - "category": "osmbasedmap", - "max_zoom": 20 - }, - { - "name": "OpenStreetMap (HOT Style)", - "id": "HDM_HOT", - "url": "https://{switch:a,b,c}.tile.openstreetmap.fr/hot/{zoom}/{x}/{y}.png", - "attribution": { - "required": true, - "text": "© OpenStreetMap contributors, tiles courtesy of Humanitarian OpenStreetMap Team", - "url": "https://www.hotosm.org/" - }, - "type": "tms", - "category": "osmbasedmap", - "max_zoom": 20 - }, - { - "name": "OpenStreetMap (Occitan Style)", - "id": "osmfr-occitan", - "url": "https://tile.openstreetmap.bzh/oc/{zoom}/{x}/{y}.png", - "attribution": { - "required": true, - "text": "Tiles © OpenStreetMap France, data © OpenStreetMap contributors, ODbL", - "url": "https://www.openstreetmap.org/" - }, - "type": "tms", - "category": "osmbasedmap", - "max_zoom": 20 - } -] \ No newline at end of file diff --git a/src/assets/svg/World.svelte b/src/assets/svg/World.svelte new file mode 100644 index 0000000000..f2d897754b --- /dev/null +++ b/src/assets/svg/World.svelte @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/src/assets/translators.json b/src/assets/translators.json index 5c017a5bd8..5a902b0adb 100644 --- a/src/assets/translators.json +++ b/src/assets/translators.json @@ -741,4 +741,4 @@ "contributor": "Carlos Ramos Carreño" } ] -} \ No newline at end of file +}