Browse Source

Wikidata: twig filter 'wikidataEntity': recalc map feature after loading

master
parent
commit
8a7b40f04e
  1. 3
      package.json
  2. 7
      src/wikidata.js

3
package.json

@ -44,7 +44,8 @@
"openstreetmap-date-format": "^0.3.1",
"openstreetmap-date-parser": "^0.1.2",
"openstreetmap-tag-translations": "git+https://github.com/plepe/openstreetmap-tag-translations.git",
"overpass-layer": "^3.1.1",
"overpass-frontend": "^2.7.2",
"overpass-layer": "^3.2.0",
"query-string": "^6.13.8",
"sheet-router": "^4.2.3",
"sprintf-js": "^1.1.2",

7
src/wikidata.js

@ -44,11 +44,16 @@ module.exports = {
}
OverpassLayer.twig.extendFilter('wikidataEntity', function (value, param) {
const ob = global.currentMapFeature
if (value in cache) {
return cache[value]
}
wikidataLoad(value, () => {})
wikidataLoad(value, () => {
if (ob) {
ob.recalc()
}
})
return null
})
Loading…
Cancel
Save