Module:OSM Location map: திருத்தங்களுக்கு இடையிலான வேறுபாடு

உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
"require('strict') local delink=require('Module:Delink').delink local getArgs = require('Module:Arguments').getArgs local p = {} local maplist={} local sgNames={} local highlightOption=false local highlightNum local visibleLinks -- This module creates framed maps of anywhere in the world, at the required scale, and enables annotations, -- dots, shapes, lines and..."-இப்பெயரில் புதிய பக்கம் உருவாக்கப்பட்டுள்ளது
 
imported>Gowtham Sampath
*துவக்கம்*
 
வரிசை 159:
s= s:sub(0,s:find("%d")-1)
opacity=string.match(color,"%d+")
if not CTB[s] then s= colorList[s] end -- check for synonyms and translations
if not CTB[s] then debugmsg(mw.addWarning('color = '..color..'. The color name is not defined. Used default grey instead')) end
-- debugmsg("couldn't find "..s..", try "..(colorList[s] or 'nil') )
s= colorList[s] end
c=CTB[s] or CTB.hardgrey
end
வரி 452 ⟶ 451:
end
 
local function getScale(zoom, lat,magVal)
if magVal and magVal>1 and magVal <=2 then zoom=zoom+(magVal-1) end
local dist=(156543.03 * math.cos(math.rad(math.abs(lat))) / (2 ^ zoom))/17
local y
வரிசை 650:
if shapePos[2]=='with-line' or shapePos[2]=='n-line' then
shapeResult[nval].textEW=(shapePos[3] or '1')..'px' -- width
shapeResult[nval].textEC=(shapePos[4] or shapeResult[nval].shapeColor or 'darkgrey')
elseif shapePos[2]=='photo-panel' then
shapeResult[nval].textEW='2px' -- width
வரிசை 813:
local function makeSquare(result,row,shape,tshape)
local w,h,r=getsize(shape.shapeSize)
if shape.shape=='square' then h=w end -- squares are always square!. box can stretch
local div=mw.html.create ('div')
if tshape then -- Add tooltip if needed
div:attr('title',row.title)
வரி 841 ⟶ 842:
local function makeCircle(result,row,shape,tshape)
local w,h,r=getsize(shape.shapeSize) -- = width,height,rounding
if shape.shape=='circle' then h=w end -- circles are always round. ellipse can stretch
local div=mw.html.create ('div')
if tshape then -- Add tooltip if needed
வரி 848 ⟶ 850:
if shape.outlineWidth ~= "0px" then
div:css('outline', shape.outlineWidth.." "..shape.outlineStyle.." "..getColor(shape.outlineColor))
end
if shape.shapeAngle ~= "0deg" then
div:css('transform',"rotate("..shape.shapeAngle..")")
end
div
வரி 937 ⟶ 942:
-- return the text css div code to position and draw a shape occupying a specified clippath
if not pathshape[shape.shape] then
debugmsg(mw.addWarning('shape'..row.code..' = '..shape.shape..'. The shape name is not defined'))
print("Path shape",shape.shape,"not found...")
return
end
local w,h,r=getsize(shape.shapeSize)
if string.match(shape.shape,"circle") or string.match(shape.shape,"square") then h=w end -- use ellipse and box for stretched shapes
local shifth,shiftv = 0,0
if string.match(shape.shape,"triangle") then
வரி 1,176 ⟶ 1,182:
elseif shape.shape=="curvea" or shape.shape=="curvec" then
makeCurveA(result,row,shape)
elseifelse -- use a pathshape[shape.shape] thenclipPath
if shape.outlineWidth ~= "0px" then
makeClipPath(result,row,shape,true,false) -- larger path-shape to give the outline, if required
வரி 1,444 ⟶ 1,450:
local frame=mw.getCurrentFrame()
local dotTable={}
local magVal,scaleVal = args.magnify,''
local origH,origW=maplist.height,maplist.width
if magVal then --set up the values needed to magnify the top-right portion of the map
-- set up the three nested div boxes (plus an extra if centered) to put the map plus title/caption area, in an appropriate frame on the page
magVal=tonumber(string.match(magVal or '0',"[%.%-?%d]+")) or 1
if magVal>1 and magVal <=2 then
maplist.height= round(maplist.height/magVal,0)
maplist.width=round(maplist.width/magVal,0)
scaleVal='transform: scale('..magVal..') translateY('..tostring((origH-maplist.height)/2)..'px);'
else magVal=1
end
--debugmsg('magVal='..magVal..', Magnify: H='..maplist.height..', ('..origH..'), W='..maplist.width..', ('..origW..'), scale='..scaleVal)
--debugmsg('top: '..tostring(((origW-maplist.width))/2)..'px;right: '..tostring(0-((origW-maplist.width))/2)..'px; (alt top: '..tostring(((origH-maplist.height))/2)..'px;)')
end
-- set up the three nested div boxes (plus an extra if centered) to put the map plus title/caption area, in an appropriate frame on the page
if args.float=='center' or args.float=='centre' then table.insert(result,'<div class="center"><div class="thumb tnone">')
elseif args.float=='left' then table.insert(result,'<div class="thumb tleft">')
வரி 1,452 ⟶ 1,471:
table.insert(result,'<div class="thumbinner" style="position: relative; top: 0px; right: 0px; width: '..(args.width or "400")..'px;">')
if args.title then table.insert(result,'<div class="center" style="font-weight:bold">'..args.title..'</div>') end
if magVal and magVal >1 and magVal<=2 then
table.insert(result,'<div class="thumbinner noresize" style="position: relative; top: 0px; right: 0px; outline:0px; border:0px; padding:0px;')
table.insert(result,'<div class="thumbinner noresize" style="display:block; position: relative; outline:0px; border:0px; padding:0px; background-color:transparent; color:inherit;')
table.insert(result,'height: '..maplist.height..'px; width: '..maplist.width..'px">')
table.insert(result,"'top: 50%; leftright:" '..tostring(left+160-((origW-maplist.width))/2).."'px"; ')
table.insert(result,'height: '..origH..'px; width: '..maplist.width..'px; '..scaleVal..'">')
else
magVal=1
table.insert(result,'<div class="thumbinner noresize" style="position: relative; top: 0px; right: 0px; outline:0px; border:0px; padding:0px;')
table.insert(result,'top: 0px; right: 0px; ')
table.insert(result,'height: '..maplist.height..'px; width: '..maplist.width..'px ">')
end
 
-- Create the basemap using mapframe
local mapframecontent=getmapframecontent(args,'basemap')
வரி 1,480 ⟶ 1,507:
end
if maplist.width-left >216 then top=top+14 end -- shunt scaleline down if it is beyond the copyright stuff
local scalek,scalem=getScale(maplist.zoom, maplist.latbase, magVal)
local magReduce=''
 
table.insert(result,"<div style=\"display:inline-block; position: absolute; background-color: #111111")
table.insert(result,"; color:inherit; clip-path:path(nonzero, &#39;M0,8 l0,4 l20,0 l0,-4 l-0.3,0 l0,3.7 l-19.4,0 l0,-3.7 z&#39;) ")
table.insert(result,"; top:"..tostring(top-1).."px")
table.insert(result,"; left:"..tostring(left+16).."px")
table.insert(result,"; width:20px") -- path is a 20px20px box, and then rescales
if magVal==1 then
table.insert(result,"; height:20px; transform:scale("..tostring(2.5)..", "..tostring(1.5)..")")
table.insert(result,"; top:"..tostring(top-1).."px")
table.insert(result,"; left:"..tostring(left+16).."px")
table.insert(result,"; height:20px; transform:scale("..tostring(2.5)..", "..tostring(1.5)..")")
else -- shrink the scalemark to compensate for magnification
table.insert(result,"; top:"..tostring(top-(magVal*0.28)).."px")
table.insert(result,"; left:"..tostring(left+(16*(magVal*1.15))).."px")
table.insert(result,"; height:20px; transform:scale("..tostring(2.5*(1/magVal))..", "..tostring(1.5*(1/magVal))..")")
magReduce= 'scale('..tostring(1/magVal)..')'
end
table.insert(result,"\"></div>")
table.insert(result,'<div style="position: absolute; top: '..tostring(top)..'px; left: '..tostring(left+47)..'px; font-size: 9.5px; line-height: 126%; width: fit-content;')
table.insert(result,'color: #444433; background-color: transparent; text-align: right; transform: '..magReduce..' translateX(-100%);">'..scalek..'<br>'..scalem..'</div>')
end
"https://tamilar.wiki/w/Module:OSM_Location_map" இலிருந்து மீள்விக்கப்பட்டது