"ഘടകം:Slippymap/sandbox" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം

No edit summary
No edit summary
വരി 9: വരി 9:
local args = (frame:getParent() or frame).args
local args = (frame:getParent() or frame).args


-- Map configuration options
-- Extract and process map options from arguments
local options = {
local options = {
latitude = tonumber(clean(args.lat)) or 51.3432699,
latitude = tonumber(clean(args.lat)) or 51.3432699,
വരി 18: വരി 18:
align = clean(args.alignment) or "center",
align = clean(args.alignment) or "center",
text = clean(args.text) or "Custom Marker",
text = clean(args.text) or "Custom Marker",
marker = clean(args.marker) ~= "no",
}
}


-- GeoJSON content for the marker with a custom image
-- If a marker is requested, generate GeoJSON for the marker
local content = mw.text.jsonEncode({
local content = nil
type = "FeatureCollection",
if options.marker then
features = {
content = mw.text.jsonEncode({
{
type = "FeatureCollection",
type = "Feature",
features = {
geometry = {
{
type = "Point",
type = "Feature",
coordinates = { options.longitude, options.latitude },
geometry = {
},
type = "Point",
properties = {
coordinates = { options.longitude, options.latitude },
title = options.text,
},
icon = {
properties = {
iconUrl = "//schoolwiki.in/images/5/5f/63rd_state_kalolsavam_logo.png", -- Custom image URL
title = options.text, -- Use the provided text for the popup
iconSize = { 50, 50 }, -- Size of the marker icon
icon = {
iconAnchor = { 25, 50 }, -- Position of the icon's anchor point
iconUrl = "//schoolwiki.in/images/5/5f/63rd_state_kalolsavam_logo.png", -- Custom marker image
popupAnchor = { 0, -50 }, -- Popup position relative to the marker
iconSize = { 50, 50 }, -- Width and height of the icon
iconAnchor = { 25, 50 }, -- Anchor point (center bottom of the icon)
popupAnchor = { 0, -50 }, -- Popup anchor position
},
},
},
},
},
},
},
},
})
})
end


-- Generate the mapframe tag with marker and options
-- Return the mapframe tag with content and options
return frame:extensionTag {
return frame:extensionTag {
name = "mapframe",
name = "mapframe",
"https://schoolwiki.in/ഘടകം:Slippymap/sandbox" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്