From 24b9f045c835b85ba7ec3230f31ebb83c8729d98 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 14 Nov 2023 17:35:50 +0100 Subject: [PATCH] PDF-export: the time-sensitive icons (notably hopening_hours) are now hidden --- assets/layers/icons/icons.json | 3 ++- assets/layers/surveillance_camera/surveillance_camera.json | 2 +- src/UI/DownloadFlow/DownloadButton.svelte | 6 +++++- src/UI/Map/ShowDataLayer.ts | 6 +++++- src/UI/Map/ShowDataLayerOptions.ts | 1 + 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/assets/layers/icons/icons.json b/assets/layers/icons/icons.json index 88e112b99d..35e2a7c362 100644 --- a/assets/layers/icons/icons.json +++ b/assets/layers/icons/icons.json @@ -63,7 +63,8 @@ }, "then": "circle:#f0f;clock:#fff" } - ] + ], + "metacondition": "__showTimeSensitiveIcons!=no" }, { "id": "phonelink", diff --git a/assets/layers/surveillance_camera/surveillance_camera.json b/assets/layers/surveillance_camera/surveillance_camera.json index 049962d336..bcb374085e 100644 --- a/assets/layers/surveillance_camera/surveillance_camera.json +++ b/assets/layers/surveillance_camera/surveillance_camera.json @@ -86,7 +86,7 @@ "_direction:leftright~*" ] }, - "then": "100,35,center" + "then": "50,35,center" } ], "render": "35,35,center" diff --git a/src/UI/DownloadFlow/DownloadButton.svelte b/src/UI/DownloadFlow/DownloadButton.svelte index 2b6fb92546..d15b8eabf7 100644 --- a/src/UI/DownloadFlow/DownloadButton.svelte +++ b/src/UI/DownloadFlow/DownloadButton.svelte @@ -36,7 +36,8 @@ isExporting = true const gpsLayer = state.layerState.filteredLayers.get("gps_location") state.lastClickObject.features.setData([]) - + state.userRelatedState.preferencesAsTags.data["__showTimeSensitiveIcons"] = "no" + state.userRelatedState.preferencesAsTags.ping() const gpsIsDisplayed = gpsLayer.isDisplayed.data try { gpsLayer.isDisplayed.setData(false) @@ -68,6 +69,9 @@ } finally { isExporting = false gpsLayer.isDisplayed.setData(gpsIsDisplayed) + state.userRelatedState.preferencesAsTags.data["__showTimeSensitiveIcons"] = "yes" + state.userRelatedState.preferencesAsTags.ping() + } } diff --git a/src/UI/Map/ShowDataLayer.ts b/src/UI/Map/ShowDataLayer.ts index 39d7b30bd1..33be0dcdea 100644 --- a/src/UI/Map/ShowDataLayer.ts +++ b/src/UI/Map/ShowDataLayer.ts @@ -27,12 +27,14 @@ class PointRenderingLayer { private readonly _allMarkers: Map = new Map() private readonly _selectedElement: Store<{ properties: { id?: string } }> private readonly _markedAsSelected: HTMLElement[] = [] + private readonly _metatags: Store> private _dirty = false constructor( map: MlMap, features: FeatureSource, config: PointRenderingConfig, + metatags?: Store>, visibility?: Store, fetchStore?: (id: string) => Store>, onClick?: (feature: Feature) => void, @@ -41,6 +43,7 @@ class PointRenderingLayer { this._visibility = visibility this._config = config this._map = map + this._metatags = metatags this._fetchStore = fetchStore this._onClick = onClick this._selectedElement = selectedElement @@ -143,7 +146,7 @@ class PointRenderingLayer { } else { store = new ImmutableStore(feature.properties) } - const { html, iconAnchor } = this._config.RenderIcon(store) + const { html, iconAnchor } = this._config.RenderIcon(store, { metatags: this._metatags }) html.SetClass("marker") if (this._onClick !== undefined) { html.SetClass("cursor-pointer") @@ -525,6 +528,7 @@ export default class ShowDataLayer { map, features, pointRenderingConfig, + this._options.metaTags, doShowLayer, fetchStore, onClick, diff --git a/src/UI/Map/ShowDataLayerOptions.ts b/src/UI/Map/ShowDataLayerOptions.ts index 9192649fdc..39569280b7 100644 --- a/src/UI/Map/ShowDataLayerOptions.ts +++ b/src/UI/Map/ShowDataLayerOptions.ts @@ -35,4 +35,5 @@ export interface ShowDataLayerOptions { fetchStore?: (id: string) => Store> onClick?: (feature: Feature) => void + metaTags?: Store> }