Module:fi-dialects/map/mapframe

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


local export = {}

local m_data = mw.loadData("Module:fi-dialects/map/data")

function export.show(args)
	local frame = args.frame
	local parishes = args.parishes
	local pin = args.pin
	local width = args.width
	local height = args.height
	
	local features = {}
	
	for _, parish in ipairs(parishes) do
		local feature = pin(parish)
		if feature then
			if feature then
				for _, subfeature in ipairs(feature) do
					table.insert(features, subfeature)
				end
			else
				table.insert(features, feature)
			end
		end
	end
	
	local geojson
	if #features > 0 then
		geojson = "," .. mw.ustring.gsub(mw.ustring.gsub(mw.text.jsonEncode(features), "^%s*%%s*$", "")
	else
		geojson = ""
	end

	geojson = m_data.borders_geojson_start .. geojson .. m_data.borders_geojson_end
	return '<div style="position:relative;display:inline-block;">' .. frame:extensionTag("mapframe", geojson, {
		class = "fi-dial-map__map",
		mapstyle = "osm-intl",
		width = width,
		height = height,
	}) .. "</div>"
end

return export