Modul:Location map: Perbedaan antara revisi

Konten dihapus Konten ditambahkan
kembalikan dulu fungsi untuk Templat:Location map xxxx di p.getMapParams(); masih banyak yang belum dipindah ~2000 galat skrip
Taylor 49 (bicara | kontrib)
-require('Module:No globals')
 
(5 revisi perantara oleh 2 pengguna tidak ditampilkan)
Baris 1:
require('Module:No globals')
 
local p = {}
 
Baris 48 ⟶ 46:
end
else
error('Tidak dapat menemukan definisi peta lokasi yang ditentukan. Baik "Modul:Location Peta lokasimap/data/' .. map .. '" maupun "Templat:Location map ' .. map .. '" tidak ada', 2)
end
end
Baris 76 ⟶ 74:
if decimal then
if degrees then
error('DecimalDerajat anddesimal dan DMS degrees cannot bothtidak bedapat provideddiberikan foruntuk ' .. direction, 2)
elseif minutes then
error('MinutesMenit canhanya onlydapat bediberikan provideddengan withderajat DMS degrees foruntuk ' .. direction, 2)
elseif seconds then
error('SecondsDetik canhanya onlydapat bediberikan provideddengan withderajat DMS degrees foruntuk ' .. direction, 2)
elseif hemisphere then
error('AHemisfer hemispherehanya candapat onlydiberikan bedengan provided withderajat DMS degrees foruntuk ' .. direction, 2)
end
local retval = tonumber(decimal)
Baris 90 ⟶ 88:
error('Nilai "' .. decimal .. '" yang disediakan untuk ' .. direction .. ' tidak sah', 2)
elseif seconds and not minutes then
error('SecondsDetik weredisediakan provided foruntuk ' .. direction .. ' without minutes alsotanpa beingmenentukan providedmenit', 2)
elseif not degrees then
if minutes then
error('MinutesMenit weredisediakan provided foruntuk ' .. direction .. ' without degrees alsotanpa beingmenentukan providedderajat', 2)
elseif hemisphere then
error('AHemisfer hemispheredisediakan was provided foruntuk ' .. direction .. ' without degrees alsotanpa beingmenentukan providedderajat', 2)
end
return nil
Baris 111 ⟶ 109:
local multiplier = hemisphereMultipliers[direction][hemisphere]
if not multiplier then
error('The hemisphereHemisfer "' .. hemisphere .. '" providedyang fordisediakan untuk ' .. direction .. ' is nottidak validsah', 2)
end
decimal = decimal * multiplier
Baris 228 ⟶ 226:
image,
width,
args.alt or ((args.label or currentTitle.text) .. ' is located indi ' .. map('name')),
args.maplink and ('|link=' .. args.maplink) or ''
)
if args.caption and args.caption ~= '' then
if (currentTitle.namespace == 0) and mw.ustring.find(args.caption, '##') then
retval = retval .. '[[CategoryKategori:PagesHalaman usingyang locationmenggunakan mappeta withlokasi adengan doubletanda numberangka signganda inpada the captionketerangannya]]'
end
end
Baris 281 ⟶ 279:
mw.logObject(args, 'args')
if currentTitle.namespace == 0 then
retval = retval .. '[[CategoryKategori:LocationPeta mapslokasi withdengan removedparameter parametersyang dihapus|caption_undefined]]'
end
end
Baris 291 ⟶ 289:
(map('crosses180') ~= '' and 'crosses180' or '') ..
(map('type') ~= '' and 'type' or '')
retval = retval .. '[[CategoryKategori:LocationPeta mapslokasi withdengan removedparameter parametersyang dihapus|' .. key .. ' ]]'
end
end
Baris 297 ⟶ 295:
mw.log('Pipe used in name of map definition ' .. map())
if currentTitle.namespace == 0 then
retval = retval .. '[[CategoryKategori:LocationPeta mapslokasi withdengan anama nameyang containingmengandung a pipepipa]]'
end
end
Baris 433 ⟶ 431:
end
if args.link and (currentTitle.namespace == 0) then
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withmenggunakan linkedpenanda markerstertaut withdengan coordinateskoordinat fromdari Wikidata]]')
end
end
if not longitude then
error('NoTidak valueada wasnilai providedyang fordiberikan longitudeuntuk garis bujur')
elseif not latitude then
error('NoTidak valueada wasnilai providedyang fordiberikan latitudeuntuk garis lintang')
end
if currentTitle.namespace > 0 then
if (not args.lon_deg) ~= (not args.lat_deg) then
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withdengan differentpresisi longitudegaris andbujur latitudedan precisionsgaris lintang yang berbeda|DegreesDerajat]]')
elseif (not args.lon_min) ~= (not args.lat_min) then
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withdengan differentpresisi longitudegaris andbujur latitudedan precisionsgaris lintang yang berbeda|MinutesMenit]]')
elseif (not args.lon_sec) ~= (not args.lat_sec) then
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withdengan differentpresisi longitudegaris andbujur latitudedan precisionsgaris lintang yang berbeda|SecondsDetik]]')
elseif (not args.lon_dir) ~= (not args.lat_dir) then
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withdengan differentpresisi longitudegaris andbujur latitudedan precisionsgaris lintang yang berbeda|HemisphereHemisfer]]')
elseif (not args.long) ~= (not args.lat) then
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withdengan differentpresisi longitudegaris andbujur latitudedan precisionsgaris lintang yang berbeda|DecimalDesimal]]')
end
end
if ((tonumber(args.lat_deg) or 0) < 0) and ((tonumber(args.lat_min) or 0) ~= 0 or (tonumber(args.lat_sec) or 0) ~= 0 or (args.lat_dir and args.lat_dir ~='')) then
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withdengan negativederajat degreesdan andmenit minutesatau ordetik secondsnegatif]]')
end
if ((tonumber(args.lon_deg) or 0) < 0) and ((tonumber(args.lon_min) or 0) ~= 0 or (tonumber(args.lon_sec) or 0) ~= 0 or (args.lon_dir and args.lon_dir ~= '')) then
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withdengan negativederajat degreesdan andmenit minutesatau ordetik secondsnegatif]]')
end
if (((tonumber(args.lat_min) or 0) < 0) or ((tonumber(args.lat_sec) or 0) < 0)) then
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withdengan negativederajat degreesdan andmenit minutesatau ordetik secondsnegatif]]')
end
if (((tonumber(args.lon_min) or 0) < 0) or ((tonumber(args.lon_sec) or 0) < 0)) then
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withdengan negativederajat degreesdan andmenit minutesatau ordetik secondsnegatif]]')
end
if args.skew or args.lon_shift or args.markhigh then
Baris 477 ⟶ 475:
(args.lon_shift and 'lon_shift' or '') ..
(args.markhigh and 'markhigh' or '')
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withdengan removedparameter parametersyang dihapus|' .. key ..' ]]')
end
end
Baris 499 ⟶ 497:
if currentTitle.namespace == 0 then
local key = currentTitle.prefixedText
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withdengan markstanda outsidedi mapluar andpeta outsidedan parameter notluar settidak diatur|' .. key .. ' ]]')
end
end
Baris 558 ⟶ 556:
local altmaps = switcherSeparate(args.AlternativeMap)
if #altmaps > #map then
error(string.format('%d AlternativeMapsAlternatifMaps were provideddisediakan, buttetapi onlyhanya peta %d maps wereyang provideddisediakan', #altmaps, #map))
end
local overlays = switcherSeparate(args.overlay_image)
if #overlays > #map then
error(string.format('%d overlay_images were provideddisediakan, buttetapi onlyhanya peta %d maps wereyang provideddisediakan', #overlays, #map))
end
if #caption_list > #map then
error(string.format('%d captions were provideddisediakan, buttetapi onlyhanya peta %d maps wereyang provideddisediakan', #caption_list, #map))
end
local outputs = {}