Anonymous user
Module:Coordinates: Difference between revisions
Jump to navigation
Jump to search
update from sandbox. Add export hook for coord_url, remove uneccesary use of frame:preprocess
(trim spaces on direction for convert_dms2dec) |
(update from sandbox. Add export hook for coord_url, remove uneccesary use of frame:preprocess) |
||
Line 11:
{{#Invoke:Coordinates | dms2dec }} : Simple function for converting DMS format
to decimal degree format.
{{#Invoke:Coordinates | link }} : Export the link used to reach the tools
]]
Line 16 ⟶ 18:
math_mod = require( "Module:Math" );
globalFrame = nil
coordinates = {};
page_name = mw.uri.encode( mw.title.getCurrentTitle().prefixedText, 'WIKI' );
coord_link
--[[ Helper function, replacement for {{coord/display/title}} ]]
Line 205 ⟶ 209:
end
return '<span class="plainlinks nourlexpansion">' ..
▲ '[//tools.wmflabs.org/geohack/geohack.php?pagename={{FULLPAGENAMEE}}¶ms=' ..
▲ uriComponents .. ' ' .. inner .. ']') .. '</span>'
end
Line 454 ⟶ 457:
return errors;
end
--[[
link
Simple function to export the coordinates link for other uses.
Usage:
{{ Invoke:Coordinates | link }}
]]
function coordinates.link(frame)
return coord_link;
end
|