Jump to content

Module talk:Location map/Archive 8

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Lowercase sigmabot III (talk | contribs) at 03:26, 26 March 2016 (Archiving 8 discussion(s) from Module talk:Location map) (bot). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Archive 5Archive 6Archive 7Archive 8Archive 9Archive 10Archive 11

Detecting missing parameters, and illogical combinations

I want to incorporate the following code:

{{#switch:{{#if:{{{lat|}}}|1|0}}{{#if:{{{lon|}}}|1|0}}{{#if:{{{lat_deg|}}}|1|0}}{{#if:{{{lon_deg|}}}|1|0}}{{#if:{{{lat_min|}}}|1|0}}{{#if:{{{lon_min|}}}|1|0}}{{#if:{{{lat_sec|}}}|1|0}}{{#if:{{{lon_sec|}}}|1|0}}
|11000000|00110000|00111100|00111111=<!-- valid combinations - do none -->
|#default=[[Category:Location map parameter errors]]
}}{{#ifeq:{{#if:{{{lat_dir|}}}|1|0}}|{{#if:{{{lon_dir|}}}|1|0}}|<!-- valid combination - do none -->|[[Category:Location map parameter errors]]}}

But I have no idea how to do it in Lua. --Redrose64 (talk) 12:29, 4 February 2015 (UTC)

@Redrose64: I set this up, but with the generic error category instead of a new one, and also with visible messages explaining exactly what the problem is. Jackmcbarn (talk) 18:45, 4 February 2015 (UTC)
Jackmcbarn, are you checking for 'lat_sec' without 'lon_sec', e.g., |lat_deg=39|lat_min=56|lat_sec=5|lat_dir=N|lon_deg=32|lon_min=52|lon_dir=E that's the issue that prompted this thread. Frietjes (talk) 20:58, 4 February 2015 (UTC)
@Frietjes: No. How is that invalid? Jackmcbarn (talk) 21:00, 4 February 2015 (UTC)
Jackmcbarn, see this thread. the bot did this, which would have been detected in a tracking category had we had a check for 'lat_sec' without 'lon_sec'. no need to issue an error, just a tracking category. Frietjes (talk) 21:03, 4 February 2015 (UTC)
@Frietjes: I think a tracking category for that would be impractical, since lat_sec without lon_sec is valid in a lot of cases. Jackmcbarn (talk) 21:04, 4 February 2015 (UTC)
Jackmcbarn, how about trying it, then seeing if there are a significant number of false positives in the category? I can tell you already that there will be at least 400 based on the list in User:Frietjes/d. seems a lot easier than having a bot scan every transclusion of this module to check. Frietjes (talk) 21:08, 4 February 2015 (UTC)
(edit conflict) It's not picking up Camnago-Lentate railway station, Carimate railway station, Carnate-Usmate railway station, Cassano d'Adda railway station, Ceriano Laghetto-Groane railway station, and plenty more. By my code above, all of these should yield 00111110, which is not one of my four valid combinations. If you consider latitude in isolation from longitude, this would technically be a valid combination, but that was not my intention. My intention was to take latitude and longitude together and ensure that if a parameter for one component of latitude was given, the same component for longitude was also given, and vice versa. In all those example, one parameter pair is imbalanced: there is a |lat_sec= (two of them in most cases) but there is no corresponding |lon_sec=. I know that there are lots more like it, because I've turned up dozens in the last few days. They were caused by at least two sets of bad template documentation, which in some cases (estimated to be 1 in 60) was compounded by a good-faith but incorrect edit by SporkBot (talk · contribs), see User talk:Plastikspork#Wrong action for duplicate template args. What I am trying to do is find those pages which have two |lat_sec=, and no |lon_sec= - and fix them to have one of each. --Redrose64 (talk) 21:11, 4 February 2015 (UTC)
@Redrose64 and Frietjes: I just set up Category:Location maps with different longitude and latitude precisions containing the issue you're talking about. Note that the sortkey identifies which parameter is different (H for hemisphere, aka N/S/E/W). Jackmcbarn (talk) 02:20, 5 February 2015 (UTC)
thanks, already used this correct a dozen of them, including unrelated problems like this. Frietjes (talk) 22:01, 5 February 2015 (UTC)
I have now fixed all but three of the several hundred pages in Category:Location maps with different longitude and latitude precisions - it was useful for detecting typos like |last= for |lats=. The three remaining pages are testcases where the precision is intentionally different. --Redrose64 (talk) 15:48, 27 February 2015 (UTC)

Is it possible to enable switching option in Module:Location map/multi? --Edgars2007 (talk/contribs) 16:14, 12 March 2015 (UTC)

@Jackmcbarn: --Edgars2007 (talk/contribs) 18:21, 16 April 2015 (UTC)
Switch between what? Alakzi (talk) 18:50, 16 April 2015 (UTC)
This one. --Edgars2007 (talk/contribs) 18:53, 16 April 2015 (UTC)
@Edgars2007:  Done Sorry for the delay. Jackmcbarn (talk) 19:41, 16 April 2015 (UTC)
It's ok. Thanks --Edgars2007 (talk/contribs) 19:45, 16 April 2015 (UTC)

location limitation?

Is there a limitation in how many locations I can have in one map? It looks like I've reached the limit [1], if so how can I eventually remove the limit? No points are showing on the map in this edit, but the one before shows all points, [2]. --Ahmetyal (talk) 22:58, 18 April 2015 (UTC)

@Ahmetyal: The module itself doesn't define any limit, but the MediaWiki parser effectively makes one. When you want to use as many points as you are, you're better off using a data module for the points, like Template:Syrian Civil War detailed map does. Jackmcbarn (talk) 04:08, 19 April 2015 (UTC)
For the given example, if you remove the last three points, it then displays all of the others. --Redrose64 (talk) 07:44, 19 April 2015 (UTC)
Thanks for the reply. @Jackmcbarn: is this the right wat to request a move: [3]? --Ahmetyal (talk) 09:29, 19 April 2015 (UTC)

Captions

Lockerbie is located in Scotland
Lockerbie
Lockerbie
Lockerbie in Scotland, UK
Lockerbie is located in the United Kingdom
Lockerbie
Lockerbie
Lockerbie (the United Kingdom)

@Jackmcbarn: If switcher is used and caption is defined, both of them are showing. I think that in such cases caption should be disabled. --Edgars2007 (talk/contribs) 15:59, 8 May 2015 (UTC)

@Edgars2007: I don't see what the problem is. Can you clarify? Jackmcbarn (talk) 16:04, 8 May 2015 (UTC)
Ok, this will be a better example: Fountains Abbey. IMO, the caption (Location of Fountains Abbey and Studley Royal Water Garden in North Yorkshire) should be disabled in module, when you're using multiple location maps. And the caption in this case is actually wrong, when you're viewing map of England :) --Edgars2007 (talk/contribs) 16:14, 8 May 2015 (UTC)
The caption is generated independently in the infobox. These are two separate issues. Alakzi (talk) 16:30, 8 May 2015 (UTC)
Indeed, it appears that there's nothing to fix in this module. If a caption doesn't make sense, it just shouldn't be specified. Jackmcbarn (talk) 16:41, 8 May 2015 (UTC)
S*, yes, it isn't in the location map template :( OK, sorry then. Alakzi, I think there could be some more infoboxes, that should have this change. And this kind of style is used in much more, I think. --Edgars2007 (talk/contribs) 05:59, 9 May 2015 (UTC)
Infobox thumbnail captions need revamping, least of all so that they are shown in Media Viewer. Shoving captions into hardcoded <div>s is hardly ideal. Alakzi (talk) 14:06, 9 May 2015 (UTC)

"name" parameter

It's my understanding that the {{{name}}} parameter of each map's own defining module or template is intended to be used within a default map caption and/or alt text when no explicit caption is supplied by the transcluding article. There's no requirement, as far as I can tell, that this parameter should be the name of an appropriate article. (That requirement would conflict, in some cases, with the previously mentioned intention; see below for an example) Yet when you view the module or template directly, the table that summarises the data wikilinks the name parameter. This can result in an unintended red link or to a link to a disambiguation page. Can the code that generates this table (wherever that is(?)) be modified not to link the name?

An example of this is Module:Location map/data/United Kingdom Preston. In my view, the correct {{{name}}} for this is simply "Preston", but this generates an unwanted link to the disambiguation page Preston. I don't want to replace "Preston" by "Preston, Lancashire" because that would generate some unnecessarily verbose map captions; in the articles where this map appears, disambiguation isn't necessary as other information in the article makes it clear which "Preston" is being referred to. -- Dr Greg  talk  18:27, 2 July 2015 (UTC)

@Dr Greg: Should be fixed now. Jackmcbarn (talk) 18:41, 2 July 2015 (UTC)
@Jack: See Fernyhalgh Wood. Alakzi (talk) 19:02, 2 July 2015 (UTC)
(edit conflict) Though the doc page links to it, {{Location map}} doesn't link to the name out of the box. At some point, somebody must've customised the caption in one of the very many infoboxes this template's used to wikilink to the name; consequently, to bypass a disambiguation page, an imaginative editor must've thought to pipe the name, as is done in Template:Location map Spain Basque Country. This workaround proliferated, and the rest, as they say, is history.
Someone's gonna have to go through all of these map definitions to get rid of the pipes, as well as all of the infoboxes to unlink the name. Alakzi (talk) 18:54, 2 July 2015 (UTC)
(edit conflict) Thanks, @Jackmcbarn:, that seems to work for modules, but not for templates.
Unfortunately, I have now just discovered that Template:Location map Scotland Highland has a piped name Highland (council area){{!}}Highland, which is expecting to be linked. Which is the correct specification for what {{{name}}} is supposed to be?
I wrote the above sentences before Alakzi's reply. (Can we do something clever to detect the presence of a pipe character?) An example of a "misbehaving" infobox is {{Infobox UK feature}}. -- Dr Greg  talk  19:13, 2 July 2015 (UTC)
Only 16 of them in the Template namespace. Alakzi (talk) 19:27, 2 July 2015 (UTC)
And these are all of the infoboxes which link to the name. Alakzi (talk) 19:30, 2 July 2015 (UTC)

@Dr Greg and Alakzi: I added logic to the module to detect pipes in names. It will populate the "N" sortkey of Category:Location maps with possible errors. Note that it will take some time to fill due to the job queue. Jackmcbarn (talk) 22:06, 2 July 2015 (UTC)

That was probably all of them; I don't think there's any in Module: definitions. Alakzi (talk) 22:48, 2 July 2015 (UTC)

points show as lines

I'm trying a fairly simple use of this template in my sandbox but all the points (using map-) show as vertical lines. It would seem that the vertical scale is not being set correctly. On that page are 4 examples: the 2nd two are copied from other pages and show the template working properly and in the first example with the same map. So can someone tell me what I'm doing wrong (in the first two)? Chris55 (talk) 20:06, 18 July 2015 (UTC)

This happened to me once before. You need to use '~' not '-'. See Module talk:Location map/Archive 6#Can't get a map of County Durham to work. I've fixed in in your tests to confirm. This is really not obvious, especially as it looks like something else is happening such as a missing coord.--JohnBlackburnewordsdeeds 20:14, 18 July 2015 (UTC)
Thanks John - couldn't see that!!! Thought it must be something simple. Where the heck do those lines come from?? Chris55 (talk) 20:54, 18 July 2015 (UTC)
I see now I was misled by the documentation. There are 6 examples of "location map-" on that page and only one of "location map~". Chris55 (talk) 22:03, 18 July 2015 (UTC)
What documentation is that? There shouldn't be any of those anywhere. Jackmcbarn (talk) 22:08, 18 July 2015 (UTC)
Actually I see it is the abysmal font used on my browser (Firefox 39 Ubuntu) for the documentation on Template:Location map+. It is indeed a ~ but one could never tell. Looking at it on another platform I can see it. Chris55 (talk) 22:14, 18 July 2015 (UTC)
In my case it’s Safari. In the edit window ~ and - are easy to mistake. The tilde looks almost flat, and on its own is not obviously longer. Plus it’s a rare character not often used in English or in programming languages. So if you look at the source for an example then manually retype it in yours you can get it wrong. Especially as it almost works, but looks like something else has gone wrong such as the x coord being missing. It does not surprise me Firefox also having problems as it has known issues displaying the proper fonts on many pages.--JohnBlackburnewordsdeeds 22:23, 18 July 2015 (UTC)
I've RfD'd the problematic template, since it isn't currently being used for anything and it does cause this sort of confusion. Jackmcbarn (talk) 22:24, 18 July 2015 (UTC)

Delta Plan

Hello. I would like to create a map like for the Delta Plan which would be the translation of fr:Modèle:Carte/Plan Delta or nl:Sjabloon:Zijbalk Deltawerken, but I don't know how to start it. Can someone help me ? I guess I have to create Template:Location map Delta Plan, or Module:Location map/data/Delta Plan but there is always something wrong, the creation is always refused, it says "To preview another page with this template, a page title must be specified." I don't understand I wrote a title in it.--Io Herodotus (talk) 05:36, 7 September 2015 (UTC)

 Done Just one thing, on Module:Location map/data/Delta Plan, the map doesn't show. Perhaps it doesn't matter as long as Template:Delta Plan works. --Io Herodotus (talk) 20:52, 7 September 2015 (UTC)
Someone kindly fixed it.--Io Herodotus (talk) 07:38, 8 September 2015 (UTC)

Hey. On this article, is there a way to disable the ability to click on the location map itself? In other words, the only link on the map is the pogs, not the map itself. Also on a separate note, is there a way to fix the tooltips that show when you hover on the pogs? For example, when you hover on any of the green or red pogs, the tooltip shows as List of dams and reservoirs in Sri Lanka. I want that to change to the name of the link, or if that is not possible, a custom text instead of the current article name. Can anyone help? Thanks in advance! Rehman 12:22, 15 November 2015 (UTC)

Rehman, try setting |maplink= but leave it blank. Frietjes (talk) 23:16, 17 November 2015 (UTC)
Thanks Frietjes, you're a genius! Any clue if the tooltip thing is possible? Rehman 13:34, 18 November 2015 (UTC)
Rehman, two options, |alt= and |link=. the alt parameter will override the entire alt text. the link parameter will override the first part of it. Frietjes (talk) 15:00, 18 November 2015 (UTC)
It doesn't work for some reason. Adding the alt text doesn't change the tooltip text when hovering over the pogs... Rehman 00:06, 19 November 2015 (UTC)
Managed to find a solution. Thanks! Rehman 05:28, 21 November 2015 (UTC)