Module talk:Location map/Archive 11: Difference between revisions

Content deleted Content added
m Archiving 2 discussion(s) from Module talk:Location map) (bot
m Archiving 2 discussion(s) from Module talk:Location map) (bot
Line 548:
: [[User:Joaosilva2000|Joaosilva2000]], see [[Template:Location map many]] or [[Template:Location map~]]. [[User:Frietjes|Frietjes]] ([[User talk:Frietjes|talk]]) 20:03, 12 October 2023 (UTC)
::The [[Template:Location map many]] its like plural version of [[Template:Location map]] right? [[User:Joaosilva2000|Joaosilva2000]] ([[User talk:Joaosilva2000|talk]]) 03:29, 14 October 2023 (UTC)
 
== image2, image3… ==
{{Edit template-protected|answered=yes}}
 
'''Description of suggested change:''' see below
 
'''Diff:''' [[Special:Diff/1177292789]]
 
[[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 12:51, 23 October 2023 (UTC)
----
[[Module:Location map/data/Zimbabwe]] has three maps in its definition file, but only ''image'' and ''image1'' can be used with the help of {{para|relief}}: no value means ''image'' will be used, any value gives ''image1''. If one wants to use ''image2'', the full file name has to be given to {{para|AlternativeMap}}. However, {{para|relief|2}} could mean ''image2'', and I think that's what many would expect. I'm proposing this little change [[Special:Diff/1177292789]], which would leave everything as it is now, except when {{para|relief|2…99}}. {{ping|TheDJ|Legoktm|Elli|Frietjes}} I'm pinging you as the last four contributors, not sure how much this page is watched.
{|
|-
|{{#invoke:Location map/sandbox|main|Zimbabwe|lat=-21|long=27|width=130|caption=no relief par}}
|{{#invoke:Location map/sandbox|main|Zimbabwe|lat=-21|long=27|width=130|caption=relief{{=}}|relief= }}
|{{#invoke:Location map/sandbox|main|Zimbabwe|lat=-21|long=27|width=130|caption=relief{{=}}yeah|relief=yeah }}
|{{#invoke:Location map/sandbox|main|Zimbabwe|lat=-22.5|long=25.5|width=130|caption=relief{{=}}1|relief= 1 }}
|{{#invoke:Location map/sandbox|main|Zimbabwe|lat=-22.5|long=25.5|width=130|caption=relief{{=}}2|relief=2}}
|}
The same thing tested at test.wiki from {{tl|Location map}} template is here [[:testwiki:User:Ponor/sandbox/Location map]] [[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 02:43, 27 September 2023 (UTC)
 
:This seems like a reasonable change at first glance but I don't actively maintain this module (and didn't write this) so I'll hold off on implementing for a bit to see if anyone else comments. [[User:Elli|Elli]] ([[User_talk:Elli|talk]] | [[Special:Contributions/Elli|contribs]]) 05:03, 27 September 2023 (UTC)
 
Leaving a note here that [[Template:Location map many|Location map many]], [[Template:Location map+|Location map+]] and their modules need no changes in order for this to work (images from [[Module:Location map/data/Africa]]):
{|
|-
|{{Location map/sandbox | Africa | relief = y | width = 130 | caption = relief{{=}}1<br>[[Template:Location map|Location map]] | lat = -21 | long = 24 }}
|{{Location map many/sandbox | Africa | relief = 2 | width = 130 | caption = relief{{=}}2<br>[[Template:Location map many|Location map many]] | lat1 = -21 | long1 = 24 | lat2 = 20 | long2 = -3}}
|{{Location map+/sandbox | Africa | relief = 2 | width = 130 | caption = relief{{=}}2<br>[[Template:Location map+|Location map+]] | places = {{Location map~ | Africa | lat = -21 | long = 24 }} {{Location map~ | Africa | lat = 20 | long = -3 }} }}
|}
[[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 16:21, 30 September 2023 (UTC)
: {{done}} [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 00:08, 27 October 2023 (UTC)
 
== Template contains script error ==
 
The resecently add line
local digits = mw.ustring.match(args.relief,'^[1-9][0-9]?$') or '1' -- image1 to image99
is throwing a script error because args.relief is a boolean not a string. [[User:Phatom87|Phatom87]] <sup>([[User talk:Phatom87|talk]] <small>•</small> [[Special:Contributions/Phatom87|contribs]])</sup> 00:16, 31 October 2023 (UTC)
: Example? Frame arguments should always be strings, even if the module interprets them as booleans. I'm sure if my code were really broken it would have taken less than a month for someone to notice. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 00:50, 31 October 2023 (UTC)
::The documentation explains that {{para|relief}} takes any non-blank value and has special behavior when the value is a number like "2" or "3". {{U|Phatom87}}: A link to a page where something is broken is always helpful when reporting a problem. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 17:47, 31 October 2023 (UTC)
:::Didn't realize this was sourced to multiple pages anyway [[Template:Russo-Ukrainian_War_detailed_relief_map]] is the problem page, [[User:Phatom87|Phatom87]] <sup>([[User talk:Phatom87|talk]] <small>•</small> [[Special:Contributions/Phatom87|contribs]])</sup> 00:33, 4 November 2023 (UTC)
:::: Yeah, that module is doing something strange. I've fixed it. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 00:36, 4 November 2023 (UTC)