Modulo:Mapframe: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
m margine in legenda |
m variabile geo non necessaria, divido in sezioni |
||
Riga 56:
function p._mappa(args)
local points = {}
local geo = args.dati or -1▼
local sinottico = tonumber(args.sinottico) or 0
local colore = args.colore or '#b80000'
Riga 74 ⟶ 73:
}
-- =================================
-- popola la sequence points
-- =================================
local num = 1
if sinottico == 1 and args.lat1 == nil and args.lon1 == nil then
Riga 107 ⟶ 109:
end
-- =================================
-- popola la table m_args
-- =================================
-- valore ingrandimento
if args.zoom then
m_args.zoom = tonumber(args.zoom)
elseif
if #points == 1 then
m_args.zoom = 10 -- valore predefinito per singolo punto
Riga 137 ⟶ 142:
if args.centro_lon then
m_args.longitude = tonumber(args.centro_lon)
elseif
if #points == 1 then
m_args.longitude = points[1].lon
Riga 147 ⟶ 152:
if args.centro_lat then
m_args.latitude = tonumber(args.centro_lat)
elseif
if #points == 1 then
m_args.latitude = points[1].lat
Riga 159 ⟶ 164:
end
-- =================================
-- popola la table m_dati
-- =================================
local m_dati
if
else▼
m_dati = { type = 'FeatureCollection', features = {} }
for i, point in ipairs(points) do
Riga 179 ⟶ 189:
end
m_dati = mw.text.jsonEncode(m_dati)
▲ else
▲ m_dati = mw.getCurrentFrame():preprocess(geo)
end
|