15.326
Bearbeitungen
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
| Zeile 20: | Zeile 20: | ||
mw.log("karte(frame, args)") | mw.log("karte(frame, args)") | ||
mw.logObject(args, "args") | mw.logObject(args, "args") | ||
-- Konsolenzeilen zum Debuggen: | |||
-- =p.karte(mw.getCurrentFrame(), args) | |||
-- =p.karte(mw.getCurrentFrame(), {pagename="Zum Adler", location="Restaurant Zum Adler, Fürth, Bayern, Deutschland"}) | |||
local t = "" | local t = "" | ||
local pagename = args["pagename"] or wik.pagename() -- nur zum Debugging pagename vorgebbar | |||
-- geocode location and locationlist | -- geocode location and locationlist | ||
| Zeile 45: | Zeile 49: | ||
if location ~= "" then | if location ~= "" then | ||
subobject_entry["Geolokation"] = location | subobject_entry["Geolokation"] = location | ||
local geocode = frame:callParserFunction("#geocode", {location, format="float", directional="no"}) | 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 | ||
minimum_one_geocode_ok = true | minimum_one_geocode_ok = true | ||
else | |||
smw_geokoordinate = mw.smw.ask( | |||
"[[-Has subobject::" .. pagename .. "]]" .. | |||
"[[Geolokation::" .. location .. "]]" .. | |||
"|?Geokoordinate") | |||
if smw_geokoordinate ~= nil then | |||
subobject_entry["Geokoordinate"] = smw_geokoordinate["Geokoordinate"] | |||
minimum_one_geocode_ok = true | |||
end | |||
end | end | ||
end | end | ||