Modul:Karte: Unterschied zwischen den Versionen

Aus FürthWiki

switch zu smw.addAttr2List()
(loggings aus)
(switch zu smw.addAttr2List())
Zeile 138: Zeile 138:
-- Geokoordinate setzen (zusätzlich zu den subobjects für div. Karten-Queries)
-- Geokoordinate setzen (zusätzlich zu den subobjects für div. Karten-Queries)
for _, o in ipairs(geoobjects) do
for _, o in ipairs(geoobjects) do
setAttr(attrlist, "Geokoordinate", o["Geokoordinate"])
smw.addAttr2List(attrlist, "Geokoordinate", o["Geokoordinate"])
end
end
-- GeoJson
-- GeoJson
if geoobjects.geojson.exists then
if geoobjects.geojson.exists then
setAttr(attrlist, "GeoJson", geoobjects.geojson.fullpagename)
smw.addAttr2List(attrlist, "GeoJson", geoobjects.geojson.fullpagename)
end
end
-- zoom
-- zoom
setAttr(attrlist, "Zoomlevel", args["zoom"])
smw.addAttr2List(attrlist, "Zoomlevel", args["zoom"])
-- jetzt "normale" Attribute setzen
-- jetzt "normale" Attribute setzen
logObject(attrlist, "attrlist")
logObject(attrlist, "attrlist")
Zeile 259: Zeile 259:
t = frame:preprocess(t)
t = frame:preprocess(t)
return t, geoobjects
return t, geoobjects
end
function setAttr(attrlist, attr, val)
if val ~= nil then
if attrlist[attr] == nil then
attrlist[attr] = {val}
else
table.insert(attrlist[attr], val)
end
end
end
end