Module talk:Location map: Difference between revisions

Content deleted Content added
Əkrəm (talk | contribs)
m Archiving 2 discussion(s) to Module talk:Location map/Archive 11) (bot
 
(13 intermediate revisions by 6 users not shown)
Line 12:
{{Copied |from=Template:Location map/Creating a new map definition |from_oldid=1207855218 |to=Template:Location map data documentation/doc |date=15 February 2024 |afd= |merge= |diff= |to_diff=1207858852 |to_oldid=1207854611 }}
{{Lua sidebar}}
 
== Linter errors with <code>span</code> ==
 
{{ping|Jonesey95}} In your recent revert in the sandbox, do you mean if a user passes a label like this: <code><nowiki>label=<div style="color:green">New York</div></nowiki></code> (when using module syntax)? [[User:Alexiscoutinho|Alexis Coutinho]] ([[User talk:Alexiscoutinho|talk]]) 16:23, 20 May 2024 (UTC)
:Yes. A span tag cannot wrap a div tag. Many real-world examples appear in [https://en.wikipedia.org/w/index.php?search=hastemplate%3A%22Location+map%22+insource%3A%2Flabel%5C%3D%5C%3Cdiv%2F&title=Special:Search&profile=advanced&fulltext=1&ns0=1&ns4=1&ns10=1&ns12=1 these search results]. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 20:23, 20 May 2024 (UTC)
::👍 [[User:Alexiscoutinho|Alexis Coutinho]] ([[User talk:Alexiscoutinho|talk]]) 20:44, 20 May 2024 (UTC)
 
== Map label background bug in dark mode ==
 
The map labels in dark mode have a black background and black text. The background should either be transparent on maps where the label text colour has sufficient contrast with the background or white so the black text has sufficient contrast. Here are three examples from [[Moulins, Allier]], and [[Con Mine]].
[[File:Con Min map label bug.png|thumb]]
[[File:Con mine screenshot.png|thumb]]
[[File:Screen_shot_of_moulins,_allier_wiki_page_in_dark_mode.png|thumb]] [[User:JScherer-WMF|JScherer-WMF]] ([[User talk:JScherer-WMF|talk]]) 21:18, 29 May 2024 (UTC)
 
:In case this helps debugging: I noticed that the maps in [[Grand Canyon]] use the same template but do not have the bug. [[User:JScherer-WMF|JScherer-WMF]] ([[User talk:JScherer-WMF|talk]]) 16:55, 30 May 2024 (UTC)
::Hey @[[User:JScherer-WMF|JScherer-WMF]] this should be fixed now with the recent additions to [[Module:Location_map/styles.css]]. <span style="background:white; color: black;">🐸</span>&nbsp;[[User:Jdlrobson|Jdlrobson]] ([[User talk:Jdlrobson|talk]]) 04:35, 31 May 2024 (UTC)
:::I think these changes got broken again. See [[Caen]] [[User:Kabelsalat22|Kabelsalat22]] ([[User talk:Kabelsalat22|talk]]) 19:23, 13 June 2024 (UTC)
 
== Still not showing up ==
 
Hi! I tried using a map with like 27 locations on it, I followed it and it's still not showing up! help me! [[User:45BearsFan|45BearsFan]] ([[User talk:45BearsFan|talk]]) 03:43, 28 June 2024 (UTC)
 
:@[[User:45BearsFan|45BearsFan]] there was a <code>}}</code> missing at the end of your call to {{tl|Location map+}}. [[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 13:00, 28 June 2024 (UTC)
::Now that I got the easy part out of the way. The dots aren't showing up in their places. [[User:45BearsFan|45BearsFan]] ([[User talk:45BearsFan|talk]]) 14:13, 28 June 2024 (UTC)
:::[[Special:Permalink/1231480913]] [[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 14:31, 28 June 2024 (UTC)
::::Thank you so much!! [[User:45BearsFan|45BearsFan]] ([[User talk:45BearsFan|talk]]) 14:36, 28 June 2024 (UTC)
 
== {{tl|Location map~}} {{para|background}} is sometimes ignored when {{para|position|bottom}} or {{para|position|top}} ==
 
[[Special:Permalink/1237233339#Venues|Example here]] in which the label background color is ignored for one element:
 
:<code><nowiki>{{Location map~|France Paris and inner ring|lat=48.8737|long=2.2950|background = #ffcc7777|label=<div style="font-size:70%;">'''[[Arc de Triomphe]]'''<br />'''[[Place Charles de Gaulle]]'''</div>|position=top}}</nowiki></code>
 
In the above example, the color has partial alpha but that's irrelevant to the issue: I previewed {{para|background|#ffcc77}} and/or {{para|position|bottom}} with same problem; changing {{para|position|left}} or {{para|position|right}} work OK. likewise changing other elements' {{para|position}} broke them.
 
[[User:Jnestorius|jnestorius]]<sup>([[User talk:Jnestorius|talk]])</sup> 20:26, 28 July 2024 (UTC)
 
* It's the <code><nowiki><div style="font-size:70%;"></nowiki></code>. [[Special:Diff/1237243334|My workaround]] was to use {{tl|resize}} instead, which is better practice anyway. The underlying issue may still be worth fixing, whenever. [[User:Jnestorius|jnestorius]]<sup>([[User talk:Jnestorius|talk]])</sup> 21:00, 28 July 2024 (UTC)
 
== Buggy and unnecessary float ==
 
The {{para|float}} is causing infobox problems at [[2024_Wayanad_landslides]], see [[MediaWiki_talk:Gadget-switcher.js#Interface-protected_edit_request_on_1_August_2024_fix_floating_radio_buttons]].
 
According to the monthly parameter usage report, the {{para|float}} had only 1 use, which I removed. Furthermore, do we even need the CSS <code>float:right</code> when it's mostly in infoboxes, which are narrow? [[Special:Contributions/142.113.140.146|142.113.140.146]] ([[User talk:142.113.140.146|talk]]) 08:04, 1 August 2024 (UTC)
 
:So I tested on mobile and saw the display. It is unclear why the controls are to the left of the image. I haven't heard of any UI pattern like this layout. On mobile, we should be spacing things out on the page with plenty of padding, not trying to cram everything on one row. [[Special:Contributions/142.113.140.146|142.113.140.146]] ([[User talk:142.113.140.146|talk]]) 19:56, 1 August 2024 (UTC)
 
== Urgent: Please fix this template for printed content [[Module:Location map/sandbox/styles.css]]. ==
 
<div lang="en" dir="ltr">
Firstly, apologies for writing in English if this is not your first language (this is an automated message).
 
This template has been detected as one of 436 pages using styles that break the page when printed when the user is using dark mode. The fix is very straightforward - all your styles relating to dark mode must be scoped to. Since there is a high risk of this templates being copied to other wikis it is important this notice is acted on ASAP.
 
To fix this:
# Update `@media (prefers-color-scheme: dark` to `@media screen and (prefers-color-scheme: dark`
# Wrap any styles relating to `html.skin-theme-clientpref-night` in `@media screen`
 
If this message has not been acted on in 7 days, this will be fixed by an automated script. Thank you for your help fixing this important issue.
 
For any questions feel free to ask them at [[phab:T369874]].
 
[[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 18:22, 2 August 2024 (UTC) on behalf of the web team.
 
</div>
 
== Urgent: Please fix this template for printed content [[Module:Location map/styles.css]]. ==
Line 145 ⟶ 80:
 
This enhancement would improve the flexibility and usability of ___location maps across Wikipedia. I welcome feedback and discussion on this proposal. [[User:Abhiramakella|Abhiramakella]] ([[User talk:Abhiramakella|talk]]) 23:42, 2 April 2025 (UTC)
 
:I would find this very helpful, particularly for locations that are very close to each other that the editor wishes to label. I would suggest alternatively that every label could have a certain "offset" parameter, in pixels, on top of the existing position parameter. This would specify the offset from a default position so editors could adjust the label to be anywhere they wish on the map. [[User:LivinAWestLife|LivinAWestLife]] ([[User talk:LivinAWestLife|talk]]) 18:41, 8 August 2025 (UTC)
{{outdent}}
@[[User:LivinAWestLife|LivinAWestLife]]: Adding some vertical offset to left- and right-positioned labels isn't too hard ([[Special:Diff/1305013356/1305042106]]). I don't think we need it for top- and bottom-positioned ones, and I'd advise against adding any left-right offset to those, as people tend to fine tune the absolute positions to what looks good on their screens, disregarding many other different devices and font sizes.
The new parameter is <code>top_offset</code>, available in <syntaxhighlight inline lang="wikitext">{{Location map/sandbox |top_offset=}}</syntaxhighlight>
{|
!current!!top_offset=0!!SW: top_ofset=−1!!NW: top_offset=+1
|-
|{{Location map|Croatia Dalmatia|label=[[Vela Luka]]|lat=43|long=16.7|position=left|width=180|float=none|caption=}}
|{{Location map/sandbox|Croatia Dalmatia|label=[[Vela Luka]]|lat=43|long=16.7|position=left|width=180|float=none|caption=}}
|{{Location map/sandbox|Croatia Dalmatia|label=[[Vela Luka]]|lat=43|long=16.7|position=left|width=180|float=none|caption=|top_offset=-1}}
|{{Location map/sandbox|Croatia Dalmatia|label=[[Vela Luka]]|lat=43|long=16.7|position=left|width=180|float=none|caption=|marksize=13|label_size=110|top_offset=1}}
|-
!current!!top_offset=0!!NE: top_ofset=−0.8!!SE: top_offset=+0.6
|-
|{{Location map|Croatia Dalmatia|label=[[Vela Luka]]|lat=43|long=16.7|position=right|width=180|float=none|caption=}}
|{{Location map/sandbox|Croatia Dalmatia|label=[[Vela Luka]]|lat=43|long=16.7|position=right|width=180|float=none|caption=}}
|{{Location map/sandbox|Croatia Dalmatia|label=[[Vela Luka]]|lat=43|long=16.7|position=right|width=180|float=none|caption=|top_offset=-0.8}}
|{{Location map/sandbox|Croatia Dalmatia|label=[[Vela Luka]]|lat=43|long=16.7|position=right|width=180|float=none|caption=|marksize=13|label_size=110|top_offset=0.6|label_width=4}}
|}
:::[[Special:Permalink/1231480913]]Let me know what you think! [[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 1418:3151, 289 JuneAugust 20242025 (UTC)
 
:Hi, this looks like it would be very useful, thank you! I hope implementing it wasn't very hard. I can understand why you wouldn't want to be able to fine tuning the absolute positions if it makes the display worse on certain screens. I will try it out now. [[User:LivinAWestLife|LivinAWestLife]] ([[User talk:LivinAWestLife|talk]]) 19:37, 9 August 2025 (UTC)
 
== Automatic color mode bug ==
Line 157 ⟶ 115:
== Edit request 13 May 2025 ==
 
{{Editedit template-protected|Module:Location map/styles.css|answered=yes}}
 
'''Description of suggested change:'''
the whole map section, including the caption, gets affected by the grayscaling effect on lines [[module:___location map/styles.css#L-66|66]] and [[module:___location map/styles.css#L-79|79]] in [[module:___location map/styles.css|styles.css]], which causes some weird coloring (see [https://ibb.co/LXYjbtkm])
Line 168 ⟶ 125:
filter: grayscale(0.6);
} }} [[User:Əkrəm|<span style="padding: 4px 6px; background-color: black; color: white; font-weight: bold">əkrəm<span style="color: #ABABAB">.</span></span>]] 18:06, 13 May 2025 (UTC)
:{{done}}<!-- Template:ETp --> [[User:Izno|Izno]] ([[User talk:Izno|talk]]) 23:48, 23 May 2025 (UTC)
 
==Discussion at [[:Template talk:Wikidata ___location map#fallback default map vs. mapframe|Template talk:Wikidata ___location map §&nbsp;fallback default map vs. mapframe]]==
[[File:Symbol watching blue lashes high contrast.svg|25px|link=|alt=]]&nbsp;You are invited to join the discussion at [[:Template talk:Wikidata ___location map#fallback default map vs. mapframe|Template talk:Wikidata ___location map §&nbsp;fallback default map vs. mapframe]]. &#x0020;-- [[User:Joy|Joy]] ([[User talk:Joy|talk]]) 15:26, 16 August 2025 (UTC)<!-- [[Template:Please see]] -->