モジュール:Location_map
[Wikipedia|▼Menu]
.mw-parser-output .documentation,.mw-parser-output .documentation-metadata{border:1px solid #a2a9b1;background-color:#ecfcf4;clear:both}.mw-parser-output .documentation{margin:1em 0 0 0;padding:1em}.mw-parser-output .documentation-metadata{margin:0.2em 0;font-style:italic;padding:0.4em 1em}.mw-parser-output .documentation-startbox{padding-bottom:3px;border-bottom:1px solid #aaa;margin-bottom:1ex}.mw-parser-output .documentation-heading{font-weight:bold;font-size:125%}.mw-parser-output .documentation-clear{clear:both}.mw-parser-output .documentation-toolbar{font-style:normal;font-size:85%} モジュールの解説[作成]このScribuntoモジュールの解説ページを作成することができます。
編集者は、このモジュールをサンドボックス (編集 | 差分)とテストケース (作成)で試すことができます。(解説
/docのサブページにカテゴリを追加してください。 このモジュールのサブページ一覧。require('strict')local p = {}local getArgs = require('Module:Arguments').getArgslocal function round(n, decimals) local pow = 10^(decimals or 0) return math.floor(n * pow + 0.5) / powendfunction p.getMapParams(map, frame) if not map then error('Location mapの名前は必ず指定しなければなりません。', 2) end local moduletitle = mw.title.new('Module:Location map/data/' .. map) if not moduletitle then error(string.format('%qはLocation mapの名前として無効です。', map), 2) elseif moduletitle.exists then local mapData = mw.loadData('Module:Location map/data/' .. map) return function(name, params) if name == nil then return 'Module:Location map/data/' .. map elseif mapData[name] == nil then return '' elseif params then return mw.message.newRawMessage(tostring(mapData[name]), unpack(params)):plain() else return mapData[name] end end elseif mw.title.new('Template:Location map ' .. map).exists then local cache = {} if type(frame) ~= 'table' or type(frame.expandTemplate) ~= 'function' then error('古いLocation mapを使うときにフレームが存在しなければなりません。') end return function(name, params) if params then return frame:expandTemplate{title = 'Location map ' .. map, args = { name, unpack(params) }} else if name == nil then return 'Template:Location map ' .. map elseif cache[name] == nil then cache[name] = frame:expandTemplate{title = 'Location map ' .. map, args = { name }} end return cache[name] end end else error('Location mapのモジュール「"Module:Location map/data/' .. map .. '"」もしくはテンプレート「"Template:Location map ' .. map .. '"」が作成されていません。', 2) endendfunction p.data(frame, args, map) if not args then args = getArgs(frame, {frameOnly = true}) end if not map then map = p.getMapParams(args[1], frame) end local params = {} for k,v in ipairs(args) do if k > 2 then params[k-2] = v end end return map(args[2], #params ~= 0 and params)endlocal hemisphereMultipliers = { longitude = { W = -1, w = -1, E = 1, e = 1 }, latitude = { S = -1, s = -1, N = 1, n = 1 }}local function decdeg(degrees, minutes, seconds, hemisphere, decimal, direction) if decimal then if degrees then error(direction .. 'において10進数形式と度分秒は両方指定できません。
次ページ
記事の検索
おまかせリスト
▼オプションを表示
ブックマーク登録
mixiチェック!
Twitterに投稿
オプション/リンク一覧
話題のニュース
列車運行情報
暇つぶしWikipedia

Size:90 KB
出典: フリー百科事典『ウィキペディア(Wikipedia)
担当:undef