Module talk:Location map: Difference between revisions

Content deleted Content added
m Archiving 2 discussion(s) to Module talk:Location map/Archive 11) (bot
 
Line 1:
{{Permanently protected}}
This template takes in latitute and longitude, should we get it to include the [[Template:coor d|template Coor d]] which also takes in latitute and longtitude and seems to be the ultimate top-level template for the ___location of places. This would ensure that anything that reads the geographic ___location of articles would then pick up anything using this map. See [[Wikipedia:WikiProject_Geographical_coordinates|WikiProject Geographical coordinates]] for more details. --<font color="blue">[[User:MarkS|Mark]]</font><font color="#0080A0">[[User:MarkS|S]]</font><small> ([[User_talk:MarkS|talk]])</small> 19:55, 26 June 2006 (UTC)
{{talk header}}
{{WikiProject banner shell|1=
{{WikiProject Maps|importance=top}}
{{WikiProject Geographical coordinates}}
}}
{{User:MiszaBot/config|algo=old(365d)
|archive=Module talk:Location map/Archive %(counter)d
|archiveheader={{talk archive navigation}}
|counter=11|maxarchivesize=70K|minthreadstoarchive=2|minthreadsleft=10}}
{{Central|text=several talk pages redirect here.}}
{{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}}
 
== Urgent: Please fix this template for printed content [[Module:Location map/styles.css]]. ==
== Thanks ==
 
<div lang="en" dir="ltr">
Thanks so much to everyone who contributed to this template. It was such a relief when I found this one. I had been thinking on how to create this for sometime while working on a [[User:Ganeshbot|bot]] that creates [[India]]n towns and cities. I was able to plug-in this template and get the bot running. Thanks again, <font color="navy">[[User:Ganeshk|Ganeshk]] ([[User talk:Ganeshk|talk]])</font> 21:03, 26 June 2006 (UTC)
Firstly, apologies for writing in English if this is not your first language (this is an automated message).
:See [[Mumbai]] for an example. - <font color="navy">[[User:Ganeshk|Ganeshk]] ([[User talk:Ganeshk|talk]])</font> 21:04, 26 June 2006 (UTC)
 
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.
== Is it possible ==
 
To fix this:
...or would it be possible to have more than one city on these maps? --[[User:Estavisti|estavisti]] 19:52, 9 July 2006 (UTC)
# Update `@media (prefers-color-scheme: dark` to `@media screen and (prefers-color-scheme: dark`
:It's not possible at the moment, but it could be done. One serious problem would be overlapping of names, which would create a need to micromanage the position of names. That would be likely to break across browsers. [[User talk:Zocky|Zocky]] | [[User:Zocky/Picture Popups|picture popups]] 19:32, 13 July 2006 (UTC)
# Wrap any styles relating to `html.skin-theme-clientpref-night` in `@media screen`
:Another note: The way this is implemented now, all the smart bits are in this template, and subtemplates just return the requested data. We could make pretty much any other template that uses that data - i.e. the same place on several maps, several places on the same map, superimposition of other things than labels, etc., without breaking or influencing this one in any way. [[User talk:Zocky|Zocky]] | [[User:Zocky/Picture Popups|picture popups]] 19:37, 13 July 2006 (UTC)
:It is possible. See [[Template:Location map start]]. -- <font color="navy">[[User:Ganeshk|Ganeshk]] ([[User talk:Ganeshk|talk]])</font> 14:58, 26 October 2006 (UTC)
 
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.
== Hungary Map ==
 
For any questions feel free to ask them at [[phab:T369874]].
Could somebody create a ___location map for Hungary (according o Croatia map)? thx. --[[User:Neoneo13|Neoneo13]] 13:01, 22 September 2006 (UTC)
 
[[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 18:22, 2 August 2024 (UTC) on behalf of the web team.
== Position parameter ==
 
</div>
Would it be a good idea to add Top and Bottom values to the position parameter (position=top and position=bottom)? Currently it allows for right and left. On a multiple ___location map, having just two options means the map is very cluttered. Top and bottom values will give more usage options. -- <font color="navy">[[User:Ganeshk|Ganeshk]] ([[User talk:Ganeshk|talk]])</font> 23:29, 26 October 2006 (UTC)
:I have added top and bottom params. Can someone please check if it looks okay. -- <font color="navy">[[User:Ganeshk|Ganeshk]] ([[User talk:Ganeshk|talk]])</font> 06:31, 9 November 2006 (UTC)
 
:Done. [[User:Izno|Izno]] ([[User talk:Izno|talk]]) 22:09, 3 August 2024 (UTC)
==Alt text==
Should we add an alt-text to the image? If there is a caption, it would be simply {{{caption}}}, otherwise, e.g. "Map of ___location within {{{1}}}". -- User:Docu
 
== Location Map with only part of a file ==
== A few suggestions ==
 
Hi, so is it possible with this template to like display for example the map of germany and cut the part that isn't of interest ?
Excellent work on this. You've made life a lot easier for many people. Are you familiar with the {{tl|Lageplan}} template from the German wiki? They made this for their German town infobox and I brought it over to the English wiki for use in the English version of this infobox: {{tl|Infobox German Location}} - at the time I did not know about the Location map.
For context I'm creating french pages for German Regionalligen and from 2012 til now it's fine since all 5 groups have ___location maps i can use, but for the period when it was divided into 3 groups there is no ___location map file for now and instead of creating new files (cuz i don't really know how to) i wondered if i can just used ___location map with the full germany map file, and then ask it to for example cut the south when showing regionalliga nord, then cut the north when showing regionalliga süd and then cut the east when showing regionalliga west.
If it's not possible then I'll go ask around on how to edit svg maps and create ___location maps ig [[User:TheÆtherPlayer|TheÆtherPlayer]] ([[User talk:TheÆtherPlayer|talk]]) 13:40, 7 October 2024 (UTC)
 
== Bad contrast ==
The Lageplan template has now also been modified for use in {{tl|Infobox Town GR}} for Greek locations.
 
Hi. Look at this please: [https://s6.uupload.ir/files/screenshot_2025-02-27_170348_wc6e.png The entry]
Lageplan has a few nice features that Location map does not. On [[User:52 Pickup/Drafts/Frankfurt|this page]] I have put up two versions of the infobox used for [[Frankfurt]], one using Lageplan, the other with Location map. I would gladly change the template to use Location map if a few changes were made:
*Border: Is there any way to turn off the image border? It is alright for some cases but, as you can see, not for this one
*Error: Instead of shifting the dot off the edge of the map if the co-ordinate values are either not given or out of range, would it be neater to have some sort of error display? In Lageplan, a second map can be displayed (DE: [[:Image:Missing Map of Germany.png]], GR: [[:Image:Prefectures Greece nocoord.png]]). So either the addition of a second error image or the overlaying of a question mark image would look better.
*Dot size: (a minor issue) Can the size of the dot be adjustable?
*Floating text: (another minor issue) Can the float text be modifiable? Also, Lageplan makes it possible for the dot to also have float text of its own
 
And these are the provided links in the entry: [https://s6.uupload.ir/files/screenshot_20250224_153809_chrome_4ac6.jpg This], and [https://s6.uupload.ir/files/screenshot_20250224_154028_chrome_hydo.jpg this]. [[User:Aminabzz|Aminabzz]] ([[User talk:Aminabzz|talk]]) 13:42, 27 February 2025 (UTC)
Keep up the good work. - [[User:52 Pickup|52 Pickup]] 09:35, 24 January 2007 (UTC)
 
== How do I set the Location map width to the reader's thumb size preference? ==
== Russia and Canada ==
 
From the documentation, it appears that the {{para|width}} of the ___location map image is specified in pixels, but per [[MOS:IMGSIZE]], {{tq|1=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? – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 04:44, 12 March 2025 (UTC)
[[image:Rs-map.png|thumb|a "normal" map of Russia]]
:The context of MOS:IMGSIZE is clearly about stand-alone images, not ones in infoboxes. To have uniformly formatted infoboxes should be the standard. -- '''[[User:P199|<span style="color: #199199;">P&nbsp;1&nbsp;9&nbsp;9</span>]]'''&nbsp;&nbsp;<big>[[User talk:P199|✉]]</big> 18:03, 14 March 2025 (UTC)
There's not yet a template for Russia or Canada (countries near the [[North Pole]]). There are some difficulties to solve. The images are distorted by orthogonal projection. In [[:de:Vorlage Diskussion:Positionskarte#andere Projektion|dewiki]] we discuss a possible hint to use "normal" maps.
::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: {{tq|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 <code>frameless</code> and <code>upright</code> 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? – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 19:26, 14 March 2025 (UTC)
 
== Export ==
The image on the right side looks like using polar coordinates:
:The formulas for the coordinates we need are
:x=x_middle - r*(90-lon)*cos(k*lat)
:y=y_middle + r*(90-lon)*sin(k*lat)
 
What's the best way to export the resulting map, please? Motivation: [[Template_talk:Location_map-line#Use_in_Wikidata]]. [[User:Fgnievinski|fgnievinski]] ([[User talk:Fgnievinski|talk]]) 14:06, 15 March 2025 (UTC)
:x_middle and y_middle are the coordinates of the North pole in the picture.
:r and k we have to check in the picture.
 
== Proposal: Add Custom Label Positioning in Module:Location map ==
What do you think? Is that the right way? Any ideas?
--[[User:Obersachse|Obersachse]] 17:36, 6 February 2007 (UTC)
:I made a russian map using equirectangular projection. --[[User:Obersachse|Obersachse]] 15:13, 5 March 2007 (UTC)
::Could you point to it, please? Thanks.&mdash;[[User:Ezhiki|Ëzhiki (Igels Hérissonovich Ïzhakoff-Amursky)]]&nbsp;•&nbsp;([[User talk:Ezhiki|yo?]]); 15:47, 5 March 2007 (UTC)
:::[[Template:Location map Russia]]. There's an [[Oymyakon|example]] too. --[[User:Obersachse|Obersachse]] 23:28, 6 March 2007 (UTC)
::::Great! A couple of suggestions, though: can another map be created which would have the same colors as current locator maps for Russian federal subjects ([[:Image:RussiaKrasnoyarsk2007-01.png|example]], and can it be updated to show the January 2007 borders (i.e., taking into consideration Perm and Krasnoyarsk Krai mergers)? Thanks!&mdash;[[User:Ezhiki|Ëzhiki (Igels Hérissonovich Ïzhakoff-Amursky)]]&nbsp;•&nbsp;([[User talk:Ezhiki|yo?]]); 14:17, 7 March 2007 (UTC)
:::::Ask [[User:Koryakov Yuri]], please. --[[User:Obersachse|Obersachse]] 00:06, 18 March 2007 (UTC)
 
I would like to propose an enhancement to <code>Module:Location map</code> that would allow for more precise label positioning. Currently, the module supports basic label positions (<code>top</code>, <code>bottom</code>, <code>left</code>, <code>right</code>), but does not include options for diagonal placements like <code>northeast</code>, <code>northwest</code>, <code>southeast</code>, or <code>southwest</code>.
==The problem of maps crossing the +/- 180 meridian ==
is solved in ruwiki and dewiki by inserting a new parameter crosses180. See e.g. [[:de:Uelen]]. Thanks to [[:ru:User:Kalan]]. --[[User:Obersachse|Obersachse]] 00:03, 18 March 2007 (UTC)
 
=== Suggested Changes: ===
== Why does the floating to the right not work anymore ? ==
 
* Expand the {{para|position}} argument to recognize and support:
{{Location map|Indonesia|lat=-7.608|long=110.20|float=right|caption=Borobudur ___location on Indonesia map.|label=Borobudur|width=300}}
** <code>northeast</code> (<code>ne</code>)
I see in the text they are not working anymore, and also for example this:
** <code>northwest</code> (<code>nw</code>)
:<nowiki>{{Location map|Indonesia|lat=-7.608|long=110.20|float=right|caption=Borobudur ___location on Indonesia map.|label=Borobudur|width=300}}</nowiki>
** <code>southeast</code> (<code>se</code>)
And also why does the label in Indonesia map not show up also ? The difference is only that our map uses SVG rather than PNG image. Is it a problem in labelling? Any idea?? &mdash; [[User:Indon|Indon]] ([[User_talk:Indon |<font color="green">reply</font>]]) &mdash; 08:47, 23 March 2007 (UTC)
** <code>southwest</code> (<code>sw</code>)
:[[User:Kalan|Kalan]] made some changes to the template - I believe he was trying to fix the problem with maps that cross the 180° meridian. In doing so he broke the float functionality. I've now reverted those changes to restore the float function, as it was screwing up the formatting of a lot of articles. [[User:Waggers|Waggers]] 09:40, 23 March 2007 (UTC)
 
:: Hmm. In Russian version (that I've copied here) it was all ok. — [[User:Kalan|Kalan]] 11:01, 23 March 2007 (UTC)
=== Benefits: ===
:: Anyway, it works in ruWiki, see [[:ru:Уэлен]]. — [[User:Kalan|Kalan]] 11:12, 23 March 2007 (UTC)
 
:: He, this was a problem with ''your'' code, you should write <code>float</code> instead of <code><s>"float"</s></code>. Now I'll try to fix it. — [[User:Kalan|Kalan]] 11:17, 23 March 2007 (UTC)
* '''Greater Precision''': Labels can be positioned more naturally relative to markers, reducing overlap and improving clarity.
:::Now it does not work and the label is gone. &mdash; [[User:Indon|Indon]] ([[User_talk:Indon |<font color="green">reply</font>]]) &mdash; 11:25, 23 March 2007 (UTC)
* '''Consistency''': Many mapping tools and templates already support compass-based positioning, making this a logical extension.
::::Yes, [[User:Kalan|Kalan]] has been trying to fix it but apparently to no avail. I've rolled back to the working version again, as he really shouldn't use the live version for testing. [[User:Waggers|Waggers]] 12:51, 23 March 2007 (UTC)
:::::* Hooff,'''Improved I donReadability't'': knowThis howwould toallow fixeditors it.to <code>[[m:ParserFunctions|#switch]]</code>optimize doesn'tlabel work, text fromplacement olderin revisioncases giveswhere the samedefault resultpositions (?!). Anyway, when a bot will replate deprecated <code>|lattop</code> and, <code>|longbottom</code>, it could also change <code>|float="left"</code> and, <code>|float="right"</code>) todo correctnot valueswork well. — [[User:Kalan|Kalan]] 12:52, 23 March 2007 (UTC)
 
::::::Ok, thanks very much for trying. [[User:Waggers|Waggers]] 13:00, 23 March 2007 (UTC)
=== Possible Implementation: ===
:::::::The "working version" doesn't work. See the examples for ''Western Hemisphere'' and ''Country that crosses 180° meridian''. --[[User:Obersachse|Obersachse]] 13:11, 23 March 2007 (UTC)
 
::::::::The "working version" hasn't worked in that respect for a while and that's been documented. But breaking the float functionality to fix the 180° meridian problem doesn't really solve much. What we have is a straight choice between a template that floats but doesn't work for maps that cross the 180° meridian and a template that doesn't float but does work for those maps. Given that the 180° meridian problem is fairly well known, surely it's better to stick with the bug we know about until we can solve it without creating a new bug elsewhere in the template. [[User:Waggers|Waggers]] 13:30, 23 March 2007 (UTC)
* Modify the {{para|position}} handling in <code>Module:Location map</code> to recognize the additional options and adjust label offsets accordingly.
:::::::::Please test Template:Location map/Temp. I think the problem is solved now. Will You? --[[User:Obersachse|Obersachse]] 13:36, 23 March 2007 (UTC)
* Use a simple logic-based adjustment to move the label diagonally when a compass-based position is selected.
::::::::::I think Kalan has made the change to the actual template now. Seems to work this time! Well done to everyone involved. [[User:Waggers|Waggers]] 13:41, 23 March 2007 (UTC)
 
:::::::::::Very fine! --[[User:Obersachse|Obersachse]] 19:20, 23 March 2007 (UTC)
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)
(unindent) Now, last question. The floating is working, but the label is now missing. Is there incompatibility with SVG images, because it appears label shown up with PNG images? &mdash; [[User:Indon|Indon]] ([[User_talk:Indon |<font color="green">reply</font>]]) &mdash; 10:14, 24 March 2007 (UTC)
 
:Can You give an example (link)? --[[User:Obersachse|Obersachse]] 13:57, 24 March 2007 (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}}
|}
Let me know what you think! [[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 18:51, 9 August 2025 (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 ==
 
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! [[User:Quiddity|Quiddity]] ([[User talk:Quiddity|talk]]) 02:12, 25 April 2025 (UTC)
 
== Changing template name to "Template:Pushpin Location map" ==
 
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, [[User:Hooman Mallahzadeh|Hooman Mallahzadeh]] ([[User talk:Hooman Mallahzadeh|talk]]) 03:02, 1 May 2025 (UTC)
:The pushpin (pog) is just the default marker. Templates like {{tl|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. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 15:16, 1 May 2025 (UTC)
 
== Edit request 13 May 2025 ==
 
{{edit 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])
 
'''Diff:'''
{{TextDiff| html.skin-theme-clientpref-night .locmap {
filter: grayscale(0.6);
} | html.skin-theme-clientpref-night .locmap img {
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]] -->