Module:Maki icon overview

local p = {} --p stands for package

p.icons = { "aerialway", "airfield", "airport", "alcohol-shop", "art-gallery", "bakery", "bank", "bar", "baseball", "basketball", "beer", "bicycle", "building", "bus", "cafe", "campsite", "car", "cemetery", "cinema", "circle-stroked", "circle", "city", "clothing-store", "college", "commercial", "cricket", "cross", "dam", "danger", "dentist", "dog-park", "embassy", "entrance", "farm", "fast-food", "ferry", "fire-station", "fuel", "garden", "gift", "golf", "grocery", "hairdresser", "harbor", "heart", "heliport", "hospital", "ice-cream", "land-use", "laundry", "library", "lighthouse", "lodging", "logging", "marker-stroked", "marker", "mobilephone", "monument", "museum", "music", "park", "parking-garage", "parking", "pharmacy", "pitch", "place-of-worship", "playground", "police", "post", "prison", "rail-light", "rail-metro", "rail", "religious-christian", "religious-jewish", "religious-muslim", "restaurant", "roadblock", "rocket", "school", "scooter", "shop", "skiing", "slaughterhouse", "soccer", "square-stroked", "square", "star-stroked", "star", "suitcase", "swimming", "telephone", "tennis", "theatre", "town-hall", "town", "triangle-stroked", "triangle", "village", "warehouse", "waste-basket", "water", "wetland", "zoo", } p.step = 0.05 p.columnCount = 12

function p.grid( frame ) local outputTable = { 		{			"type": "FeatureCollection",			"features": [ }	p.coordGrid( outputTable ) table.insert(outputTable, 		 ]		}	) -- return table.concat(outputTable) return frame:preprocess(table.concat(outputTable)) end

function p.coordGrid( outputTable ) local iconIndex = 1 -- Stop iterating rows when we run out of icons. for y = 0, 999, p.step do	   for x = 0, p.columnCount * p.step, p.step do	    	local icon = p.icons[iconIndex] if not icon then return end -- Positive Y is up, so negate to read top-to-bottom. table.insert(outputTable, '	{ "type": "Feature", "geometry": { "type":"Point", "coordinates":['..x..', -'..y..'] }, "properties": { "title":"Maki Icon: '..icon..'", "marker-symbol":"'..icon..'"} },\n') iconIndex = iconIndex + 1 end end end

function p.list ( frame ) local outputList = '{|class="wikitable" \n |+ Maki icons \n |- \n ! Icon !! Name \n' for key,icon in pairs(p.icons) do		outputList = outputList..' |- \n | || ' ..icon..'\n' end return outputList..'|}' end

return p