Modul:Karte/Work: Unterschied zwischen den Versionen

keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 149: Zeile 149:
end
end


-- Karten-Argumente (display_map) erstellen
if not com.isTrue(args["nomap"]) then -- keine Karte anzeigen?
local map_args = { "", ["zoom"] = args["zoom"], -- gemeinsame settings
-- sondern nur geoobject und SMW-DB
["width"] = args["width"], ["height"] = args["height"],
-- Karten-Argumente (display_map) erstellen
["enablefullscreen"] = "yes", ["resizable"] = "yes"}
local map_args = { "", ["zoom"] = args["zoom"], -- gemeinsame settings
-- geojson-Argument
["width"] = args["width"], ["height"] = args["height"],
if geoobjects.geojson.exists then
["enablefullscreen"] = "yes", ["resizable"] = "yes"}
map_args["geojson"] = geoobjects.geojson.pagename
-- geojson-Argument
if #geoobjects > 0 then
if geoobjects.geojson.exists then
kategorien["Hat geojson und location/lat/lon"] = true
map_args["geojson"] = geoobjects.geojson.pagename
if #geoobjects > 0 then
kategorien["Hat geojson und location/lat/lon"] = true
end
end
end
end
-- location/lat/lon-Argumente
-- location/lat/lon-Argumente
if not (geoobjects.geojson.exists and -- Pin-Anzeige deaktivieren, wenn GeoJson vorhanden und hide_loc_latlon=Ja
if not (geoobjects.geojson.exists and -- Pin-Anzeige deaktivieren, wenn GeoJson vorhanden und hide_loc_latlon=Ja
com.isTrue(args["hide_loc_latlon"])) then -- SMW-DB wird trotzdem geschrieben
com.isTrue(args["hide_loc_latlon"])) then -- SMW-DB wird trotzdem geschrieben
for _, o in ipairs(geoobjects) do
for _, o in ipairs(geoobjects) do
if o["Geokoordinate"] ~= nil then
if o["Geokoordinate"] ~= nil then
if map_args[1] ~= "" then
if map_args[1] ~= "" then
map_args[1] = map_args[1] .. ";"
map_args[1] = map_args[1] .. ";"
end
end
map_args[1] = map_args[1] .. o["Geokoordinate"]
map_args[1] = map_args[1] .. o["Geokoordinate"]
if o["KartePopupTitle"] ~= nil then
if o["KartePopupTitle"] ~= nil then
map_args[1] = map_args[1] .. "~" .. o["KartePopupTitle"]
map_args[1] = map_args[1] .. "~" .. o["KartePopupTitle"]
if o["KartePopupText"] ~= nil then
if o["KartePopupText"] ~= nil then
map_args[1] = map_args[1] .. "~" .. o["KartePopupText"]
map_args[1] = map_args[1] .. "~" .. o["KartePopupText"]
end
end
end
end
end
end
end
end
end
end
 
-- Karte (display_map)
-- Karte (display_map)
if map_args[1] ~= "" or map_args["geojson"] ~= nil then
if map_args[1] ~= "" or map_args["geojson"] ~= nil then
-- mw.logObject(map_args, "map_args")
-- mw.logObject(map_args, "map_args")
t = t .. frame:callParserFunction("#display_map", map_args)
t = t .. frame:callParserFunction("#display_map", map_args)
if geoobjects.geojson.arg ~= nil and map_args["geojson"] == nil then
if geoobjects.geojson.arg ~= nil and map_args["geojson"] == nil then
t = t .. "<small>Karte [" .. geoobjects.geojson.url .. " " ..
t = t .. "<small>Karte [" .. geoobjects.geojson.url .. " " .. geoobjects.geojson.arg .. "] nicht gefunden</small>"
geoobjects.geojson.arg .. "] nicht gefunden</small>"
end
else
if com.isTrue(args["form"]) then
t = t .. "Positionsangabe fehlt oder fehlende Karte<br>" ..
geoobjects.geojson.fullpagename ..
"<br>Bitte Position in Formular eintragen oder"
else
t = t .. "Breiten-/Längengrad (lat/lon) fehlt, Objekt-Lokation " ..
"(location) fehlt oder fehlende Karte<br>" ..
geoobjects.geojson.fullpagename
end
t = t .. "<br>[" .. geoobjects.geojson.url ..
" Hier klicken zum Anlegen der Karte<br>" ..
geoobjects.geojson.fullpagename ..
"].<br>Siehe auch [[Hilfe:Karten]]"
kategorien["Ohne Position"] = true
end
end
else
if com.isTrue(args["form"]) then
-- Box um Karte
t = t .. "Positionsangabe fehlt oder fehlende Karte<br>" .. geoobjects.geojson.fullpagename .. "<br>Bitte Position in Formular eintragen oder"
if com.isTrue(args["box"]) then
else
local headline = args["headline"] or geoobjects.geojson.arg or pagename
t = t .. "Breiten-/Längengrad (lat/lon) fehlt, Objekt-Lokation (location) fehlt oder fehlende Karte<br>" .. geoobjects.geojson.fullpagename
t = box.box{headline = headline, content = t, textalign = center}
end
end
t = t .. "<br>[" .. geoobjects.geojson.url .. " Hier klicken zum Anlegen der Karte<br>" .. geoobjects.geojson.fullpagename .. "].<br>Siehe auch [[Hilfe:Karten]]"
kategorien["Ohne Position"] = true
end


-- Box um Karte
end -- if not com.isTrue(args["nomap"]) then
if com.isTrue(args["box"]) then
local headline = args["headline"] or geoobjects.geojson.arg or pagename
t = box.box{headline = headline, content = t, textalign = center}
end


-- Kategorien setzen
-- Kategorien setzen