15.852
Bearbeitungen
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
| Zeile 34: | Zeile 34: | ||
-- geojson-Angabe auswerten | -- geojson-Angabe auswerten | ||
geoobjects.geojson = {} | |||
geoobjects.geojson.arg = args["geojson"] | |||
geoobjects.geojson.pagename = geoobjects.geojson.arg or pagename | |||
geoobjects.geojson.fullpagename = "GeoJson:" .. geoobjects.geojson.pagename | |||
geoobjects.geojson.url = "{{canonicalurl:" .. geoobjects.geojson.fullpagename .. "}}" | |||
geoobjects.geojson.exists = wik.pageExists(geoobjects.geojson.fullpagename) | |||
-- width/height | -- width/height | ||
| Zeile 130: | Zeile 133: | ||
end -- to do: obsolete, wenn sobobject genutzt | end -- to do: obsolete, wenn sobobject genutzt | ||
-- GeoJson | -- GeoJson | ||
if | if geoobjects.geojson.exists then | ||
setAttr(attrlist, "GeoJson", | setAttr(attrlist, "GeoJson", geoobjects.geojson.fullpagename) | ||
end | end | ||
-- zoom | -- zoom | ||
| Zeile 152: | Zeile 155: | ||
["enablefullscreen"] = "yes", ["resizable"] = "yes"} | ["enablefullscreen"] = "yes", ["resizable"] = "yes"} | ||
-- geojson-Argument | -- geojson-Argument | ||
if | if geoobjects.geojson.exists then | ||
map_args["geojson"] = | map_args["geojson"] = geoobjects.geojson.pagename | ||
if #geoobjects > 0 then | if #geoobjects > 0 then | ||
kategorien["Hat geojson und location/lat/lon"] = true | kategorien["Hat geojson und location/lat/lon"] = true | ||
| Zeile 159: | Zeile 162: | ||
end | end | ||
-- location/lat/lon-Argumente | -- location/lat/lon-Argumente | ||
if not ( | 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 | ||
| Zeile 182: | Zeile 185: | ||
t = t .. frame:callParserFunction("#display_map", map_args) | t = t .. frame:callParserFunction("#display_map", map_args) | ||
if args["geojson"] ~= nil and map_args["geojson"] == nil then | if args["geojson"] ~= nil and map_args["geojson"] == nil then | ||
t = t .. "<small>Karte [" .. | t = t .. "<small>Karte [" .. geoobjects.geojson.url .. " " .. args["geojson"] .. "] nicht gefunden</small>" | ||
end | end | ||
else | else | ||
if com.isTrue(args["form"]) then | if com.isTrue(args["form"]) then | ||
t = t .. "Positionsangabe fehlt oder fehlende Karte<br>" .. | t = t .. "Positionsangabe fehlt oder fehlende Karte<br>" .. geoobjects.geojson.fullpagename .. "<br>Bitte Position in Formular eintragen oder" | ||
else | else | ||
t = t .. "Breiten-/Längengrad (lat/lon) fehlt, Objekt-Lokation (location) fehlt oder fehlende Karte<br>" .. | t = t .. "Breiten-/Längengrad (lat/lon) fehlt, Objekt-Lokation (location) fehlt oder fehlende Karte<br>" .. geoobjects.geojson.fullpagename | ||
end | end | ||
t = t .. "<br>[" .. | 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 | kategorien["Ohne Position"] = true | ||
end | end | ||