Home
Random
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Geonotice map
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
-- If the "country": "GB" feature is used instead of "corners", we need the Wikidata ID of the country for the map to use local countries = { GB = "Q145", US = "Q30", CA = "Q16", MX = "Q96", JM = "Q766", TT = "Q754", GY = "Q734", GT = "Q774", DO = "Q786", BS = "Q778", CR = "Q800", BZ = "Q242", PA = "Q804", } local p = {} function p.main(frame) local data = mw.loadJsonData("Wikipedia:Geonotice/list.json") local geojson = {} for name, info in pairs(data) do local properties = { title = name, description = info.text .. "<br>(Start: " .. info.begin .. ", end: " .. info["end"] .. ")" } local feature if info.country ~= nil then feature = { type = "ExternalData", service = "geoshape", ids = countries[info.country], properties = properties } else feature = { type = "Feature", properties = properties, geometry = { type = "Polygon", -- note that GeoJSON is lon, lat while Geonotice is lat, lon. sigh. coordinates = { { { info.corners[1][2], info.corners[1][1] }, { info.corners[2][2], info.corners[1][1] }, { info.corners[2][2], info.corners[2][1] }, { info.corners[1][2], info.corners[2][1] }, { info.corners[1][2], info.corners[1][1] } } } } } end table.insert(geojson, feature) end local width = frame.args.width or "full" local height = frame.args.height or "500" return frame:extensionTag{ name = 'mapframe', content = mw.text.jsonEncode(geojson), args = { width = width, height = height, text = "See a map of actively configured geonotices" } } end return p
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Geonotice map/doc
(
edit
)