From a38ab81356c28d34648cf2ac9fa1dce659a5d941 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Mon, 11 Oct 2021 23:28:51 +0200 Subject: [PATCH] Fix metatag _isOpen, fix clustering zoom behaviour --- InitUiElements.ts | 2 +- Logic/SimpleMetaTagger.ts | 7 ++++--- UI/SpecialVisualizations.ts | 6 +++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/InitUiElements.ts b/InitUiElements.ts index dfd5b4439..e7113e2d6 100644 --- a/InitUiElements.ts +++ b/InitUiElements.ts @@ -454,7 +454,7 @@ export class InitUiElements { return false; } - if (z >= clustering.maxZoom) { + if (z > clustering.maxZoom) { return true } diff --git a/Logic/SimpleMetaTagger.ts b/Logic/SimpleMetaTagger.ts index 4cf5a8c47..b0e4d50bf 100644 --- a/Logic/SimpleMetaTagger.ts +++ b/Logic/SimpleMetaTagger.ts @@ -209,7 +209,7 @@ export default class SimpleMetaTagger { configurable: true, get: () => { delete feature.properties._isOpen - feature.properties._isOpen = "" + feature.properties._isOpen = undefined const tagsSource = State.state.allElements.getEventSourceById(feature.properties.id); tagsSource.addCallbackAndRunD(tags => { if (tags.opening_hours === undefined || tags._country === undefined) { @@ -230,7 +230,8 @@ export default class SimpleMetaTagger { const oldNextChange = tags["_isOpen:nextTrigger"] ?? 0; if (oldNextChange > (new Date()).getTime() && - tags["_isOpen:oldvalue"] === tags["opening_hours"]) { + tags["_isOpen:oldvalue"] === tags["opening_hours"] + && tags["_isOpen"] !== undefined) { // Already calculated and should not yet be triggered return false; } @@ -267,7 +268,7 @@ export default class SimpleMetaTagger { } }) - return feature.properties["_isOpen"] + return undefined } }) diff --git a/UI/SpecialVisualizations.ts b/UI/SpecialVisualizations.ts index bc41f916c..9cdadec04 100644 --- a/UI/SpecialVisualizations.ts +++ b/UI/SpecialVisualizations.ts @@ -55,7 +55,11 @@ export default class SpecialVisualizations { if (!tags.hasOwnProperty(key)) { continue } - parts.push([key, tags[key] ?? "undefined"]); + let v = tags[key] + if(v === ""){ + v = "empty string" + } + parts.push([key, v ?? "undefined"]); } for(const key of calculatedTags){