Module:Ordnance Survey coordinates/sandbox: Difference between revisions

Content deleted Content added
make a mess
Reverted to revision 976091149 by Hike395 (talk): Rv experiment (TW)
Line 321:
 
function oscoord.main(frame)
local frameArgsargs = getArgs(frame,{parentFirst=true,parentOnly=false,frameOnly=false})
local input = frameArgsargs[1]
if input == nil or string.len(input)==0 then
return warning(nil)
end
local linktitle = frameArgsargs[2]
local namearg = frameArgsargs["name"]
local args = split(input,'_')
local LL
Line 362:
html = html..warning(LL[2])
return html
end
local geohackArgs = {}
local k, v
for i = restargs,#args do
local colonChunks = split(args[i],':')
geohackArgs[colonChunks[1]] = colonChunks[2]
end
for k, v in pairs(frameArgs) do
-- if tonumber(k) == nil and k ~= 'name' then
geohackArgs[k] = v
-- end
end
-- https://geohack.toolforge.org/geohack.php?pagename=Mount_Whitney&params=36.578580925_N_118.29199495_W_type:mountain_region:US-CA_scale:100000_source:NGS
Line 385 ⟶ 374:
url = url..LL[4]..'_E'
end
for k,i v= in pairs(geohackArgs)restargs,#args do
url = url..'_'..k..':'..vargs[i]
end
if not geohackArgs['string.find(input,"region']") == nil then
url = url..'_region:'..LL[1]
end
if namearg then