ഘടകം:Slippymap/sandbox
ഈ ഘടകത്തിന്റെ വിവരണം ഘടകം:Slippymap/sandbox/വിവരണം എന്ന താളിൽ നിർമ്മിക്കാവുന്നതാണ്
local p = {} function p.slippymap(frame) -- Get arguments from the template or directly from the page local args = frame:getParent().args local lat = args["lat"] or "0" -- Default latitude local lon = args["lon"] or "0" -- Default longitude local text = args["text"] or "Marker" -- Default marker text local logo = args["logo"] or "File:63rd_state_kalolsavam_logo.png" -- Default logo image (complete URL) -- Ensure lat and lon are numeric lat = tonumber(lat) or 0 lon = tonumber(lon) or 0 -- Generate the map HTML using Kartographer local mapHtml = mw.html.create("div") mapHtml:addClass("kartographer-map") mapHtml:attr("style", "width: 100%; height: 400px;") -- Generate the logo HTML local logoHtml = mw.html.create("div") logoHtml:addClass("logo") logoHtml:attr("style", "position: absolute; bottom: 10px; left: 10px;") logoHtml:wikitext('[[File:' .. logo .. '|100px|link=]]') -- Returning the HTML output with both map and logo return tostring(mapHtml) .. tostring(logoHtml) .. '\n{{#invoke:Kartographer|map|' .. lat .. ',' .. lon .. '|' .. text .. '}}' end return p