Module:Infobox road/map
| This module's documentation is missing, inadequate, or does not accurately describe its functionality or the parameters in its code. Please help add, expand, or improve it. |
{{Module rating }}
Usage
{{#invoke:Infobox road|function_name}}
local p = {}
local format = mw.ustring.format
local mapsizes = {
DEU = "200",
}
function p._map(args)
local map = args.map or ''
if args.map_custom == "yes" then
return format('<div style="white-space:nowrap;">%s</div>', map)
end
if map == '' then
local qid = args.qid
if qid and (#qid == 0) then
qid = nil
end
local entity = mw.wikibase.getEntityObject(qid) or {}
local claims = entity.claims or {}
local mapProp = claims.P15
if not mapProp or mapProp[1].mainsnak.snaktype ~= 'value' then
return ""
end
map = mapProp[1].mainsnak.datavalue.value
end
local mapsize = mapsizes[args.country] or '290'
local alt = args.map_alt or ''
return format("[[File:%s|%spx|alt=%s]]", map, mapsize, alt)
end
function p.map(frame)
local argsModule = require("Module:Arguments")
local args = argsModule.getArgs(frame)
local state = args.state or args.province
if not args.country then
local countryMask = mw.loadData("Module:Road data/countrymask")
args.country = countryMask[state]
end
return p._map(args)
end
return p
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.