Modul:Faktenbox/Zeilen: Unterschied zwischen den Versionen

zeileGeoDaten() verwendet geoobjects
(Kategorie:Heiko)
(zeileGeoDaten() verwendet geoobjects)
Zeile 101: Zeile 101:
-- mw.log("zeileGeoDaten(fbdata)")
-- mw.log("zeileGeoDaten(fbdata)")
-- mw.logObject(fbdata, "fbdata")
-- mw.logObject(fbdata, "fbdata")
-- Konsolenzeile zum Debuggen:
-- fab = require("Modul:Faktenbox"); fbdata=fab.fbdata{pargs={}}; fbdata.fullpagename="Isaak-Loewi-Straße 1, 3, 5, 7, 9, Liesl-Kießling-Straße 16"; print(p.zeileGeoDaten_(fbdata))
local t = ""
local t = ""
if fbdata.geoobjects == nil then
if fbdata.geoobjects ~= nil then
t = t .. "[[Kategorie:Heiko]]"
-- die Zeile
end
if #fbdata.geoobjects > 0 or fbdata.geoobjects.geojson.exists then
local geokoordinate = smw.getValues(fbdata.fullpagename, "Geokoordinate", true)
t = t .. "<dt>Geo-Daten</dt><dd>"
local geojson = smw.getValues(fbdata.fullpagename, "GeoJson", true)
local first = true
if #geojson > 0 then
for _, o in ipairs(fbdata.geoobjects) do
geojson = geojson[1]
if first then
else
first = false
geojson = "GeoJson:" .. fbdata.pagename
else
if not wik.pageExists(geojson) then
t = t .. ",<br>"
geojson = nil
end
end
t = t .. geo.osmLink(fbdata.frame, o["Geokoordinate"])
end
if #geokoordinate > 0 or geojson ~= nil then
t = t .. "<dt>Geo-Daten</dt><dd>"
local first = true
for _, g in ipairs(geokoordinate) do
if first then
first = false
else
t = t .. ",<br>"
end
end
t = t .. geo.osmLink(fbdata.frame, g)
if fbdata.geoobjects.geojson.exists then
end
if not first then
if geojson ~= nil then
t = t .. ",<br>"
if not first then
end
t = t .. ",<br>"
t = t .. "[[" .. fbdata.geoobjects.geojson.fullpagename .. "|GeoJson-Karte]]"
end
end
t = t .. "[[" .. geojson .. "|GeoJson-Karte]]"
t = t .. "</dd>"
end
end
t = t .. "</dd>"
end
end
-- mw.logObject(t, "t")
-- mw.logObject(t, "t")