Jump to content

Module talk:Location map

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Bad contrast

[edit]

Hi. Look at this please: The entry

And these are the provided links in the entry: This, and this. Aminabzz (talk) 13:42, 27 February 2025 (UTC)[reply]

How do I set the Location map width to the reader's thumb size preference?

[edit]

From the documentation, it appears that the |width= of the location map image is specified in pixels, but per MOS:IMGSIZE, Except with very good reason, a fixed width in pixels (e.g. 17px) should not be specified, because it ignores the user's base width setting. Thus upright=scaling factor is preferred when it is desired to present an image at other than the default width. How do I set the location map size to match the reader's thumb size preference, as recommended by MOS? – Jonesey95 (talk) 04:44, 12 March 2025 (UTC)[reply]

The context of MOS:IMGSIZE is clearly about stand-alone images, not ones in infoboxes. To have uniformly formatted infoboxes should be the standard. -- P 1 9 9   18:03, 14 March 2025 (UTC)[reply]
I agree that a uniform image width should be the standard, which is why I am asking how to set a location map to match the reader's standard thumb size preference. MOS:IMGSIZE refers to the size of a "lead image". MOS:LEADIMAGE, on the same page, explains the lead image like this: It is common for an article's lead or infobox to carry a representative image. Module:InfoboxImage, which is commonly used to display lead images in infoboxes, has frameless and upright options, which allow lead images in infoboxes to comply with both MOS:IMGSIZE and with readers' preferences. So how do we follow this standard for location maps so that they match the infobox's lead image size? – Jonesey95 (talk) 19:26, 14 March 2025 (UTC)[reply]

Export

[edit]

What's the best way to export the resulting map, please? Motivation: Template_talk:Location_map-line#Use_in_Wikidata. fgnievinski (talk) 14:06, 15 March 2025 (UTC)[reply]

Proposal: Add Custom Label Positioning in Module:Location map

[edit]

I would like to propose an enhancement to Module:Location map that would allow for more precise label positioning. Currently, the module supports basic label positions (top, bottom, left, right), but does not include options for diagonal placements like northeast, northwest, southeast, or southwest.

Suggested Changes:

[edit]
  • Expand the |position= argument to recognize and support:
    • northeast (ne)
    • northwest (nw)
    • southeast (se)
    • southwest (sw)

Benefits:

[edit]
  • Greater Precision: Labels can be positioned more naturally relative to markers, reducing overlap and improving clarity.
  • Consistency: Many mapping tools and templates already support compass-based positioning, making this a logical extension.
  • Improved Readability: This would allow editors to optimize label placement in cases where the default positions (top, bottom, left, right) do not work well.

Possible Implementation:

[edit]
  • Modify the |position= handling in Module:Location map to recognize the additional options and adjust label offsets accordingly.
  • Use a simple logic-based adjustment to move the label diagonally when a compass-based position is selected.

This enhancement would improve the flexibility and usability of location maps across Wikipedia. I welcome feedback and discussion on this proposal. Abhiramakella (talk) 23:42, 2 April 2025 (UTC)[reply]

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. LivinAWestLife (talk) 18:41, 8 August 2025 (UTC)[reply]

@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 top_offset, available in {{Location map/sandbox |top_offset=}}

current top_offset=0 SW: top_ofset=−1 NW: top_offset=+1
Lua error in Module:Location_map/sandbox at line 425: No value was provided for longitude. Lua error in Module:Location_map/sandbox at line 425: No value was provided for longitude. Lua error in Module:Location_map/sandbox at line 425: No value was provided for longitude.
current top_offset=0 NE: top_ofset=−0.8 SE: top_offset=+0.6
Lua error in Module:Location_map/sandbox at line 425: No value was provided for longitude. Lua error in Module:Location_map/sandbox at line 425: No value was provided for longitude. Lua error in Module:Location_map/sandbox at line 425: No value was provided for longitude.

Let me know what you think! Ponor (talk) 18:51, 9 August 2025 (UTC)[reply]

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. LivinAWestLife (talk) 19:37, 9 August 2025 (UTC)[reply]

Automatic color mode bug

[edit]

I'm seeing a bug with text background color for annotations on location maps in articles, but not in the docs. Both logged-in and -out. E.g. screenshot at phab:F59386868 of the random article Fechenheim (and same elsewhere). But the examples in Template:Location_map all work properly(!?). I'm not sure where the bug is coming from, whether it's in Module:Location map/styles.css or elsewhere. I hope those clues help! Quiddity (talk) 02:12, 25 April 2025 (UTC)[reply]

Changing template name to "Template:Pushpin Location map"

[edit]

Hi, just like Template:OSM Location map, I think it is better to mention the type of Location map, which is in this case is pushpin. So I propose to move this article to Template:Pushpin Location map. Thanks, Hooman Mallahzadeh (talk) 03:02, 1 May 2025 (UTC)[reply]

The pushpin (pog) is just the default marker. Templates like {{Infobox airport}} use a different image file to show locations. There is a whole family of location maps, not just this module and template; I might support a name change if their name was something like "LM", but "Location map" is reasonably descriptive. – Jonesey95 (talk) 15:16, 1 May 2025 (UTC)[reply]

Edit request 13 May 2025

[edit]

Description of suggested change: the whole map section, including the caption, gets affected by the grayscaling effect on lines 66 and 79 in styles.css, which causes some weird coloring (see [1])

Diff:

html.skin-theme-clientpref-night .locmap { filter: grayscale(0.6); }
+
html.skin-theme-clientpref-night .locmap img { filter: grayscale(0.6); }

əkrəm. 18:06, 13 May 2025 (UTC)[reply]

 Done Izno (talk) 23:48, 23 May 2025 (UTC)[reply]

 You are invited to join the discussion at Template talk:Wikidata location map § fallback default map vs. mapframe. -- Joy (talk) 15:26, 16 August 2025 (UTC)[reply]

 You are invited to join the discussion at Template talk:MergedMap. -- Joy (talk) 12:36, 27 November 2025 (UTC)[reply]

Template-protected edit request on 21 December 2025

[edit]

Category:Pages with script errors ~2025-42305-35 (talk) 22:17, 21 December 2025 (UTC)[reply]

 Not done: it's not clear what changes you want made. Please detail the specific changes in a "change X to Y" format and provide a reliable source if appropriate. Zackmann (Talk to me/What I been doing) 01:32, 22 December 2025 (UTC)[reply]