diff --git a/Customizations/JSON/LayerConfig.ts b/Customizations/JSON/LayerConfig.ts index b280d2a..d04d7a4 100644 --- a/Customizations/JSON/LayerConfig.ts +++ b/Customizations/JSON/LayerConfig.ts @@ -21,10 +21,10 @@ export default class LayerConfig { titleIcons: TagRenderingConfig[]; - icon?: TagRenderingConfig; - iconSize?: TagRenderingConfig; - color?: TagRenderingConfig; - width?: TagRenderingConfig; + icon: TagRenderingConfig; + iconSize: TagRenderingConfig; + color: TagRenderingConfig; + width: TagRenderingConfig; wayHandling: number; diff --git a/Logic/FilteredLayer.ts b/Logic/FilteredLayer.ts index 0ee5f8d..e6ca548 100644 --- a/Logic/FilteredLayer.ts +++ b/Logic/FilteredLayer.ts @@ -140,21 +140,24 @@ export class FilteredLayer { const selfFeatures = []; for (let feature of geojson.features) { // feature.properties contains all the properties - + const tags = TagUtils.proprtiesToKV(feature.properties); - const centerPoint = GeoOperations.centerpoint(feature); + + if (!this.filters.matches(tags)) { + leftoverFeatures.push(feature); + continue; + } + if (feature.geometry.type !== "Point") { + const centerPoint = GeoOperations.centerpoint(feature); if (this._wayHandling === LayerConfig.WAYHANDLING_CENTER_AND_WAY) { selfFeatures.push(centerPoint); } else if (this._wayHandling === LayerConfig.WAYHANDLING_CENTER_ONLY) { feature = centerPoint; } } - if (this.filters.matches(tags)) { - selfFeatures.push(feature); - } else { - leftoverFeatures.push(feature); - } + selfFeatures.push(feature); + } diff --git a/UI/LayerSelection.ts b/UI/LayerSelection.ts index 96f5b65..3391e14 100644 --- a/UI/LayerSelection.ts +++ b/UI/LayerSelection.ts @@ -16,10 +16,8 @@ export class LayerSelection extends UIElement { for (const layer of State.state.filteredLayers.data) { let iconUrl = "./asets/checkbox.svg"; - let iconUrlBlank = ""; - if (layer.layerDef.icon && layer.layerDef.icon !== "") { - iconUrl = layer.layerDef.icon as string; - iconUrlBlank = layer.layerDef.icon as string; + if (layer.layerDef.icon ) { + iconUrl = layer.layerDef.icon.GetRenderValue({id:"node/-1"}).txt; } const icon = new FixedUiElement(``); diff --git a/assets/themes/cyclofix/cyclofix.json b/assets/themes/cyclofix/cyclofix.json index 3f6befe..5623eba 100644 --- a/assets/themes/cyclofix/cyclofix.json +++ b/assets/themes/cyclofix/cyclofix.json @@ -25,6 +25,6 @@ "startZoom": 16, "widenFactor": 0.05, "socialImage": "./assets/themes/cyclofix/logo.svg", - "layers": ["bike_cafes", "bike_shops", "bike_repair_station", "drinking_water", "bike_themed_object"], + "layers": ["bike_cafes", "bike_shops", "bike_repair_station", "drinking_water", "bike_themed_object","bike_parking"], "roamingRenderings": [] } \ No newline at end of file