Modul:Karte: Unterschied zwischen den Versionen

218 Bytes hinzugefügt ,  Gestern um 21:22
geocode format="float", directional="no". lat/lon mit popuptitle und popuptext
(+ subobjectIdCleaner())
(geocode format="float", directional="no". lat/lon mit popuptitle und popuptext)
 
Zeile 45: Zeile 45:
if location ~= "" then
if location ~= "" then
subobject_entry["Geolokation"] = location
subobject_entry["Geolokation"] = location
local geocode = frame:callParserFunction("#geocode", location)
local geocode = frame:callParserFunction("#geocode", {location, format="float", directional="no"})
if geocode ~= "Geocoding failed" then
if geocode ~= "Geocoding failed" then
subobject_entry["Geokoordinate"] = geocode
subobject_entry["Geokoordinate"] = geocode
Zeile 65: Zeile 65:
-- geocode lon/lat
-- geocode lon/lat
if (not minimum_one_geocode_ok or com.isTrue(args["Ehemals"])) and args["lat"] ~= nil and args["lon"] ~= nil then
if (not minimum_one_geocode_ok or com.isTrue(args["Ehemals"])) and args["lat"] ~= nil and args["lon"] ~= nil then
local geocode = frame:callParserFunction("#geocode", args["lat"] .. "," .. args["lon"])
local geocode = frame:callParserFunction("#geocode", {args["lat"] .. "," .. args["lon"], format="float", directional="no"})
if geocode ~= "Geocoding failed" then
if geocode ~= "Geocoding failed" then
local subobject_entry = {}
local subobject_entry = {}
subobject_entry["Geokoordinate"] = geocode
subobject_entry["Geokoordinate"] = geocode
one_geocode_ok = true
if popuptitle ~= "" then
subobject_entry["KartePopupTitle"] = popuptitle
end
if popuptext ~= "" then
subobject_entry["KartePopupText"] = popuptext
end
table.insert(subobjects, subobject_entry)
table.insert(subobjects, subobject_entry)
end
end
end
end
mw.logObject(subobjects, "subobjects")
-- subobjects setzen
-- subobjects setzen
mw.logObject(subobjects, "subobjects")
for _, s in ipairs(subobjects) do
for _, s in ipairs(subobjects) do
s["SubObjektTyp"] = "Geo"
s["SubObjektTyp"] = "Geo"