Modulo:Coord: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
aggiorno dms2dec/dec2dms alle classi |
+local, miglioro params in geohackParams, -controllo su card |
||
Riga 179:
function DecCoord:__tostring()
return self.deg .. "°" .. self.card
end▼
-- Ritorna i gradi con segno▼
function DecCoord:getDeg()▼
return self.deg * ((self.card == "N" or self.card =="E") and 1 or -1)▼
end
Riga 200 ⟶ 205:
return DmsCoord:new(deg, min, sec, self.card)
▲end
▲-- Ritorna i gradi con segno
▲function DecCoord:getDeg()
▲ return self.deg * ((self.card == "N" or self.card =="E") and 1 or -1)
end
Riga 227:
(self.min and (padleft0(self.min) .. "′") or "") ..
(self.sec and (padleft0(self.sec) .. "″") or "") ..
end
Riga 261:
-- Crea l'HTML ritornato da Coord
local function buildHTML(decLat, decLong, dmsLat, dmsLong,
local root, text, url, displayInline, displayTitle, htmlTitle
Riga 267:
url = cfg.geohackUrl ..
"&pagename=" .. mw.uri.encode(mw.title.getCurrentTitle().prefixedText, "WIKI") ..
"¶ms=" ..
(args["name"] and ("&title=" .. mw.uri.encode(args["name"])) or "")
Riga 329:
-- contenente le coordinate in formato dec e dms come collegamento esterno a geohack.php.
local function coord()
local
local reqFormat, dmsFormat, defaultFormat, geohackParams
reqFormat = paramsParse()
Riga 376 ⟶ 377:
-- crea la stringa param per geohack.php
if reqFormat == "dec" then
else
-- concatena solo i posizionali
end
return args["display"] == "debug" and
(decLat .. " " .. decLong .. " " .. dmsLat .. " " .. dmsLong) or
buildHTML(decLat, decLong, dmsLat, dmsLong,
end
|