Add switch to hide certain features, cleanup of code

This commit is contained in:
Pieter Vander Vennet 2021-03-25 15:19:44 +01:00
parent aa0989b72a
commit 1b1ec9f15d
18 changed files with 230 additions and 173 deletions

View file

@ -64,7 +64,7 @@ export default class SimpleMetaTagger {
SimpleMetaTagger.GetCountryCodeFor(lon, lat, (countries) => {
try {
feature.properties["_country"] = countries[0].trim().toLowerCase();
const tagsSource = State.state.allElements.getEventSourceFor(feature);
const tagsSource = State.state.allElements.addOrGetElement(feature);
tagsSource.ping();
} catch (e) {
console.warn(e)
@ -77,7 +77,7 @@ export default class SimpleMetaTagger {
"If 'opening_hours' is present, it will add the current state of the feature (being 'yes' or 'no')",
(feature => {
const tagsSource = State.state.allElements.getEventSourceFor(feature);
const tagsSource = State.state.allElements.addOrGetElement(feature);
tagsSource.addCallbackAndRun(tags => {
if (tags.opening_hours === undefined || tags._country === undefined) {
return;