feat(themes): add osm community index as a layer

This commit is contained in:
Nadhem 2022-10-08 22:24:30 +01:00
parent 0702e47f29
commit e85cf43ffb
7 changed files with 195 additions and 0 deletions

View file

@ -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"
]
}
]

View file

@ -0,0 +1,5 @@
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 50 50">
<path d="M0,0.653 L4.237,11.768 L0,22.883 L4.237,33.998 L0,45.113 L2.601,46.105 L16.735,31.987 L19.271,32.377 L22.349,29.3 C20.532,27.197 19.173,24.688 18.43,21.917 L19.873,20.732 C19.625,19.582 19.489,18.391 19.489,17.166 C19.489,11.054 22.752,5.683 27.625,2.704 L22.243,0.653 L11.121,4.887 L0,0.653 z" fill="currentColor"/>
<path d="M36.319,3.373 C43.875,3.373 50,9.494 50,17.045 C50,24.596 43.875,30.717 36.32,30.717 C28.764,30.717 22.639,24.596 22.639,17.045 C22.639,9.494 28.764,3.373 36.32,3.373 L36.319,3.373 z" fill="currentColor"/>
<path d="M47.267,30.181 C44.327,32.63 40.552,34.104 36.437,34.104 C35.212,34.104 34.02,33.968 32.869,33.72 L31.683,35.163 C29.05,34.457 26.65,33.203 24.613,31.524 L21.428,34.712 L21.82,37.068 L9.976,48.91 L11.121,49.347 L22.243,45.113 L33.365,49.347 L44.486,45.113 L48.724,33.998 L47.267,30.181 z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 986 B

View file

@ -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 + '<br>&emsp;' + value.resolved.descriptionHTML}).join('<br>')"
],
"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"
}
}