Module:Sandbox/Evad37/X1
| This module is a sandbox for testing XFDcloser. It may occasionally have deletion or speedy deletion notices; please do not actually delete it. |
Tests
{{#invoke:Sandbox/Evad37/X1|main}} → Module:Sandbox/Evad37/X1
12°18′N 45°36′E / 12.3°N 45.6°E
42°21′37″N 71°03′28″W / 42.3603°N 71.0578°W
{{#invoke:Sandbox/Evad37/X1|getCoords}} →
<mapframe>: The JSON content is not valid GeoJSON+simplestyle. The list below shows all attempts to interpret it according to the JSON Schema. Not all are errors.
- /0/query: The property query is required
- /0/ids: The property ids is required
- /0: Failed to match at least one schema
- /0/title: The property title is required
- /0/service: The property service is required
- /0: Failed to match exactly one schema
- /0/geometries: The property geometries is required
- /0/type: Does not have a value in the enumeration ["GeometryCollection"]
- /0/type: Does not have a value in the enumeration ["MultiPolygon"]
- /0/type: Does not have a value in the enumeration ["Point"]
- /0/type: Does not have a value in the enumeration ["MultiPoint"]
- /0/type: Does not have a value in the enumeration ["LineString"]
- /0/type: Does not have a value in the enumeration ["MultiLineString"]
- /0/type: Does not have a value in the enumeration ["Polygon"]
- /0/coordinates: The property coordinates is required
- /0/geometry: The property geometry is required
- /0/type: Does not have a value in the enumeration ["Feature"]
- /0/features: The property features is required
- /0/type: Does not have a value in the enumeration ["FeatureCollection"]
You are on the desktopmobile website.
-- This module is a sandbox. It is also used for testing XFDcloser
local getArgs = require('Module:Arguments').getArgs
local parser = require("Module:WikitextParser")
local mapframe = require("Module:Mapframe")
local p = {}
p.server = function(frame)
return mw.site.server
end
p.main = function(frame)
local childFrame = frame:newChild{ title = "Sandbox", args = {} }
local FULLPAGENAME = childFrame:preprocess( "{{FULLPAGENAME}}" )
return FULLPAGENAME
end
p.getCoords = function(frame)
local args = getArgs(frame, {parentFirst = true})
local title = args.article and mw.title.new(args.article) or mw.title.getCurrentTitle()
local content = frame:preprocess(
args.section and parser.getSection(content, args.section) or title:getContent()
)
local coords = {}
for geo in mw.ustring.gmatch(content, "<span class=\"geo%-default\">(.-)%)</span></span></span>%]</span>") do
local coord = mw.ustring.match(geo, "<span class=\"geo%-dec\".->(.-)</span>")
mw.logObject({
geo = geo,
coord = coord
})
if coord then
local coord = mw.ustring.gsub(coord, "[° ]", "_")
local name = mw.ustring.match(geo, "<span class=\"fn org\">(.-)</span>")
coords[coord] = name
end
end
local mapframeArgs = {
display = "inline",
frame = "yes"
}
local count = 1
for coord, name in pairs(coords) do
mapframeArgs["type"..count] = "point"
mapframeArgs["coord"..count] = coord
mapframeArgs["title"..count] = name
count = count + 1
end
local map = mapframe._main(mapframeArgs)
return frame:preprocess(map)
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.