Module:fi-dialects/map

Hello, you have come here looking for the meaning of the word Module:fi-dialects/map. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:fi-dialects/map, but we will also tell you about its etymology, its characteristics and you will know how to say Module:fi-dialects/map in singular and plural. Everything you need to know about the word Module:fi-dialects/map you have here. The definition of the word Module:fi-dialects/map will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:fi-dialects/map, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

Implements parts of the Finnish dialectal data map.


local export = {}
	
local sin = math.sin
local cos = math.cos

-- image: name of image.
-- x: function that takes lat,long (degrees °N, °E respectively) and returns 0-100% (from left to right on the map).
-- y: function that takes lat,long (degrees °N, °E respectively) and returns 0-100% (from top to bottom on the map).
local parameters = {
	 = "Finnish dialect location map.svg",
	 = function (lat, lon) return (lon - 12) * 100 / 20.5 end,
	 = function (lat, lon) return (lat - 70.5) * -100 / 11.5 end
}

function export.show(args)
	local frame = args.frame
	local parishes = args.parishes
	local peg = args.peg
	
	local size = args.size and "|" .. args.size or ""
	
	local pegs = {}
	
	for _, parish in ipairs(parishes) do
		local lat, lon = parish:getCoordinates()
		local x = parameters.x(lat, lon)
		local y = parameters.y(lat, lon)
		table.insert(pegs, peg(parish, y .. "%", x .. "%"))
	end
	
	return '<div style="position:relative;display:inline-block;">' .. frame:preprocess("]") .. table.concat(pegs, "") .. "</div>"
end

return export