From e85cf43ffbf9de86491a2d3aaa4b7f0a52082843 Mon Sep 17 00:00:00 2001 From: Nadhem Date: Sat, 8 Oct 2022 22:24:30 +0100 Subject: [PATCH 1/3] feat(themes): add osm community index as a layer --- .../osm_community_index/license_info.json | 12 ++ assets/layers/osm_community_index/osm.svg | 5 + .../osm_community_index.json | 132 ++++++++++++++++++ .../mapcomplete-changes.json | 8 ++ .../osm_community_index/license_info.json | 12 ++ assets/themes/osm_community_index/osm.svg | 5 + .../osm_community_index.json | 21 +++ 7 files changed, 195 insertions(+) create mode 100644 assets/layers/osm_community_index/license_info.json create mode 100644 assets/layers/osm_community_index/osm.svg create mode 100644 assets/layers/osm_community_index/osm_community_index.json create mode 100644 assets/themes/osm_community_index/license_info.json create mode 100644 assets/themes/osm_community_index/osm.svg create mode 100644 assets/themes/osm_community_index/osm_community_index.json diff --git a/assets/layers/osm_community_index/license_info.json b/assets/layers/osm_community_index/license_info.json new file mode 100644 index 0000000000..822410b4cd --- /dev/null +++ b/assets/layers/osm_community_index/license_info.json @@ -0,0 +1,12 @@ +[ + { + "path": "osm.svg", + "license": "ISC License", + "authors": [ + "osmlab" + ], + "sources": [ + "https://github.com/osmlab/osm-community-index/blob/main/dist/img/osm.svg" + ] + } +] diff --git a/assets/layers/osm_community_index/osm.svg b/assets/layers/osm_community_index/osm.svg new file mode 100644 index 0000000000..0d8640ed76 --- /dev/null +++ b/assets/layers/osm_community_index/osm.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/layers/osm_community_index/osm_community_index.json b/assets/layers/osm_community_index/osm_community_index.json new file mode 100644 index 0000000000..a7aeb05dbf --- /dev/null +++ b/assets/layers/osm_community_index/osm_community_index.json @@ -0,0 +1,132 @@ +{ + "id": "osm_community_index", + "name": { + "en": "OSM Community Index" + }, + "title": { + "render": { + "en": "OSM Community Index" + } + }, + "source": { + "geoJson": "https://raw.githubusercontent.com/osmlab/osm-community-index/main/dist/completeFeatureCollection.json", + "osmTags": "resources~*", + "isOsmCache": false + }, + "calculatedTags": [ + "_community_links=Object.values(JSON.parse(feat.properties.resources || '{}')).map(value =>{return value.resolved.nameHTML + '
 ' + value.resolved.descriptionHTML}).join('
')" + ], + "tagRenderings": [ + { + "id": "country_name", + "condition": "level=country", + "render": "{nameEn} {emojiFlag}", + "description": "The name of the country" + }, + { + "id": "community_links", + "render": "{_community_links}", + "condition": "_community_links~*", + "description": "Community Links (Discord, meetups, Slack groups, IRC channels, mailing lists etc...)" + } + ], + "mapRendering": [ + { + "icon": { + "render": "pin:#6BC4F7;./assets/layers/osm_community_index/osm.svg" + }, + "iconSize": "40,40,bottom", + "location": [ + "point" + ] + }, + { + "color": "#444444", + "width": { + "render": "1" + } + } + ], + "filter": [ + { + "id": "country", + "options": [ + { + "question": { + "en": "Country" + }, + "osmTags": "level=country" + } + ] + }, + { + "id": "sub_country", + "options": [ + { + "question": { + "en": "Sub Country Group" + }, + "osmTags": "level=subcountryGroup" + } + ] + }, + { + "id": "region", + "options": [ + { + "question": { + "en": "Region" + }, + "osmTags": "level=region" + } + ] + }, + { + "id": "intermediate_region", + "options": [ + { + "question": { + "en": "Intermediate Region" + }, + "osmTags": "level=intermediateRegion" + } + ] + }, + { + "id": "territory", + "options": [ + { + "question": { + "en": "Territory" + }, + "osmTags": "level=territory" + } + ] + }, + { + "id": "world", + "options": [ + { + "question": { + "en": "World" + }, + "osmTags": "level=world" + } + ] + }, + { + "id": "other", + "options": [ + { + "question": { + "en": "Other Communities" + }, + "osmTags": "level=" + } + ] + } + ], + "description": { + "en": "A layer showing the OpenStreetMap Communities" + } +} diff --git a/assets/themes/mapcomplete-changes/mapcomplete-changes.json b/assets/themes/mapcomplete-changes/mapcomplete-changes.json index b9e7d12e9a..fba53fcf90 100644 --- a/assets/themes/mapcomplete-changes/mapcomplete-changes.json +++ b/assets/themes/mapcomplete-changes/mapcomplete-changes.json @@ -294,6 +294,10 @@ "if": "theme=openwindpowermap", "then": "./assets/themes/openwindpowermap/logo.svg" }, + { + "if": "theme=osm_community_index", + "then": "./assets/themes/osm_community_index/osm.svg" + }, { "if": "theme=parkings", "then": "./assets/themes/parkings/parkings.svg" @@ -389,6 +393,10 @@ { "if": "theme=waste_basket", "then": "./assets/themes/waste_basket/waste_basket.svg" + }, + { + "if": "theme=width", + "then": "./assets/themes/width/icon.svg" } ] }, diff --git a/assets/themes/osm_community_index/license_info.json b/assets/themes/osm_community_index/license_info.json new file mode 100644 index 0000000000..822410b4cd --- /dev/null +++ b/assets/themes/osm_community_index/license_info.json @@ -0,0 +1,12 @@ +[ + { + "path": "osm.svg", + "license": "ISC License", + "authors": [ + "osmlab" + ], + "sources": [ + "https://github.com/osmlab/osm-community-index/blob/main/dist/img/osm.svg" + ] + } +] diff --git a/assets/themes/osm_community_index/osm.svg b/assets/themes/osm_community_index/osm.svg new file mode 100644 index 0000000000..0d8640ed76 --- /dev/null +++ b/assets/themes/osm_community_index/osm.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/themes/osm_community_index/osm_community_index.json b/assets/themes/osm_community_index/osm_community_index.json new file mode 100644 index 0000000000..a51b0f6291 --- /dev/null +++ b/assets/themes/osm_community_index/osm_community_index.json @@ -0,0 +1,21 @@ +{ + "id": "osm_community_index", + "title": { + "en": "OSM Community Index" + }, + "description": { + "en": "A list of resources for users of OpenStreetMap. 'Resources' can be links to forums, meetups, Slack groups, IRC channels, mailing lists, and so on. Anything that mappers, especially beginners, might find interesting or helpful." + }, + "shortDescription": { + "en": "An index of community resources for OpenStreetMap." + }, + "icon": "./assets/themes/osm_community_index/osm.svg", + "startLat": 50.8465573, + "defaultBackgroundId": "CartoDB.Voyager", + "startLon": 4.351697, + "startZoom": 16, + "clustering": false, + "layers": [ + "osm_community_index" + ] +} From ad87ebc6f408a4558175541b536495b6cede9a0f Mon Sep 17 00:00:00 2001 From: Nadhem Date: Sat, 8 Oct 2022 22:44:04 +0100 Subject: [PATCH 2/3] nit: remove unintentionally added lines --- assets/themes/mapcomplete-changes/mapcomplete-changes.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/assets/themes/mapcomplete-changes/mapcomplete-changes.json b/assets/themes/mapcomplete-changes/mapcomplete-changes.json index fba53fcf90..346c8baa89 100644 --- a/assets/themes/mapcomplete-changes/mapcomplete-changes.json +++ b/assets/themes/mapcomplete-changes/mapcomplete-changes.json @@ -393,10 +393,6 @@ { "if": "theme=waste_basket", "then": "./assets/themes/waste_basket/waste_basket.svg" - }, - { - "if": "theme=width", - "then": "./assets/themes/width/icon.svg" } ] }, @@ -557,4 +553,4 @@ } } ] -} \ No newline at end of file +} From 89186c8610185e56bf9afa78b2765c45b2a939bd Mon Sep 17 00:00:00 2001 From: Nadhem Date: Sun, 9 Oct 2022 04:37:10 +0100 Subject: [PATCH 3/3] fix: resize svgs --- assets/layers/osm_community_index/osm.svg | 54 +++++++++++++++++++++-- assets/themes/osm_community_index/osm.svg | 54 +++++++++++++++++++++-- 2 files changed, 100 insertions(+), 8 deletions(-) diff --git a/assets/layers/osm_community_index/osm.svg b/assets/layers/osm_community_index/osm.svg index 0d8640ed76..c963f2f2b4 100644 --- a/assets/layers/osm_community_index/osm.svg +++ b/assets/layers/osm_community_index/osm.svg @@ -1,5 +1,51 @@ - - - - + + + + + + + diff --git a/assets/themes/osm_community_index/osm.svg b/assets/themes/osm_community_index/osm.svg index 0d8640ed76..c963f2f2b4 100644 --- a/assets/themes/osm_community_index/osm.svg +++ b/assets/themes/osm_community_index/osm.svg @@ -1,5 +1,51 @@ - - - - + + + + + + +