Fix: fix UK-Addresses themes again

This commit is contained in:
Pieter Vander Vennet 2023-11-12 15:26:08 +01:00
parent b2e7b7d221
commit 370b200bb3
2 changed files with 110 additions and 12 deletions

View file

@ -45,7 +45,18 @@
},
"pointRendering": [],
"lineRendering": [
{}
{
"width": 2,
"color": {
"render": "#00f",
"mappings": [
{
"if": "_has_address=true",
"then": "#0f0"
}
]
}
}
]
},
{
@ -112,7 +123,7 @@
"_embedding_object:addr:housenumber=JSON.parse(feat.properties._embedding_object)?.['addr:housenumber']",
"_embedding_object:addr:street=JSON.parse(feat.properties._embedding_object)?.['addr:street']",
"_embedding_inspire_polygon_has_address=overlapWith(feat)('raw_inspire_polygons')[0]?.feat?.properties?._has_address",
"_embedding_object:id=feat.get('_embedding_object')?.id ?? feat.properties._embedding_inspire_polygon_has_address"
"_embedding_object:id=get(feat, '_embedding_object')?.id ?? feat.properties._embedding_inspire_polygon_has_address"
],
"filter": [
{
@ -137,7 +148,37 @@
}
],
"description": "Alamat",
"pointRendering": [],
"pointRendering": [
{
"marker":[{
"icon": {
"render": "./assets/themes/uk_addresses/housenumber_unknown.svg",
"mappings": [
{
"if": {
"and": [
"_embedding_object:id~*",
"_embedding_object:id!=false"
]
},
"then": "./assets/themes/uk_addresses/housenumber_unknown_small.svg"
},
{
"if": "_imported=yes",
"then": "./assets/themes/uk_addresses/housenumber_unknown_small.svg"
}
]
}
}],
"iconSize": "40,40",
"location": [
"point",
"centroid"
],
"anchor": "center"
}
],
"lineRendering": [
{}
]
@ -581,9 +622,62 @@
}
}
],
"pointRendering": [],
"lineRendering": [
{}
"pointRendering": [ {
"label": {
"render": "<div style='margin-top: -42px; color: white' class='rounded-full p-1 font-bold relative'>{addr:housenumber}</div>",
"condition": "addr:housenumber~*"
},
"iconSize": "50,50",
"marker":[{
"icon": {
"render": "./assets/layers/address/housenumber_blank.svg",
"mappings": [
{
"if": {
"or": [
{
"and": [
"addr:housenumber=",
"nohousenumber!=yes"
]
},
"addr:street="
]
},
"then": "./assets/themes/uk_addresses/housenumber_unknown.svg"
}
]
}
}]
,
"location": [
"point",
"centroid"
],
"anchor": "center"
}],
"lineRendering": [ {
"color": {
"render": "#00f",
"mappings": [
{
"if": {
"or": [
{
"and": [
"addr:housenumber=",
"nohousenumber!=yes"
]
},
"addr:street="
]
},
"then": "#ff0"
}
]
},
"width": "3"
}
]
},
"named_streets"
@ -609,4 +703,4 @@
"minNeededFeatures": 25,
"maxZoom": 16
}
}
}

View file

@ -45,11 +45,15 @@ export default class ShowOverlayRasterLayer {
let zoom = this._mapProperties?.zoom?.data
let withinRange = zoom === undefined || zoom > this._layer.min_zoom
let isDisplayed = (this._isDisplayed?.data ?? true) && withinRange
this._map.data?.setLayoutProperty(
this._layer.id,
"visibility",
isDisplayed ? "visible" : "none"
)
try {
this._map.data?.setLayoutProperty(
this._layer.id,
"visibility",
isDisplayed ? "visible" : "none"
)
} catch (e) {
console.error(e)
}
}
private async awaitStyleIsLoaded(): Promise<void> {