Add search previews on the map

This commit is contained in:
Pieter Vander Vennet 2024-08-23 02:16:24 +02:00
parent 1c46a65c84
commit 4f52483a98
19 changed files with 315 additions and 87 deletions

View file

@ -356,9 +356,32 @@
}
}
}
},
{
"#": "ignore-image-in-then",
"if": "osm_id~*",
"then": {
"special": {
"type": "link",
"text": "<img alt='on osm' textmode='🗺️' src='./assets/svg/osm-logo-us.svg'/>",
"href": "https://www.openstreetmap.org/{osm_id}",
"arialabel": {
"en": "Open on openstreetmap.org",
"nl": "Bekijk op openstreetmap.org",
"de": "Auf openstreetmap.org öffnen",
"pl": "Otwórz na openstreetmap.org",
"da": "Åbn på openstreetmap.org"
}
}
}
}
],
"condition": "id~(node|way|relation)/[0-9]*"
"condition": {
"or": [
"id~(node|way|relation)/[0-9]*",
"osm_id~*"
]
}
},
{
"id": "rating",

View file

@ -0,0 +1,66 @@
{
"id": "search",
"description": {
"en": "Priviliged layer showing the search results"
},
"source": "special",
"title": "{display_name}",
"tagRenderings": [
{
"id": "intro",
"render": {
"en": "Search result"
}
},
{
"id": "osm",
"render": {
"*": "<a href='https://openstreetmap.org/{osm_type}/{osm_id}'>On OpenStreetMap</a>"
}
},
"all_tags"
],
"pointRendering": [
{
"location": [
"point",
"centroid"
],
"marker": [
{
"icon": "circle",
"color": "white"
},
{
"icon": {
"render": "globe_alt",
"mappings": [
{
"if": "category~city|locality|county",
"then": "building_office_2"
},
{
"if": "category=train_station",
"then": "train"
},
{
"if": "category=airport",
"then": "airport"
},
{
"if": "category=house",
"then": "house"
},
{
"if": "category=shop",
"then": "building_storefront"
}
]
}
}
],
"label": "{display_name}",
"labelCssClasses": "bg-white rounded p-2 no-wrap"
}
]
}