Browse Source

twigFunctions: evaluate(): use re-newed evaluate() function

master
parent
commit
a9d5d0c01c
  1. 2
      package.json
  2. 10
      src/twigFunctions.js

2
package.json

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

10
src/twigFunctions.js

@ -84,20 +84,14 @@ OverpassLayer.twig.extendFilter('md5', function (value) {
return md5cache[value] return md5cache[value]
}) })
OverpassLayer.twig.extendFunction('evaluate', function (tags) { OverpassLayer.twig.extendFunction('evaluate', function (tags) {
var ob = {
id: 'x0',
isShown: true,
layer_id: global.currentCategory.id,
object: {
const ob = {
id: 'x0', id: 'x0',
meta: {}, meta: {},
tags: tags, tags: tags,
type: 'special' type: 'special'
} }
}
var d = global.currentCategory.layer.mainlayer.evaluate(ob)
return d
return global.currentCategory.layer.mainlayer.evaluate(ob)
}) })
function enumerate (list) { function enumerate (list) {
if (!list) { if (!list) {

Loading…
Cancel
Save