Module talk:Location map/Archive 9

Changing map title
Hello, I'm not too skilled in the coding side of wikipedia, so please bear with me! I'm currently trying to change the title of the map Module:Location map/data/China Tibet topography. Right now, it's showing up in the infobox of articles including Mount Everest as China Tibet topography when all it should say is Tibet. Changing the title value in the code didn't seem to change it. Do I have to move the location map module page? Any help is appreciated. --NoGhost (talk) 20:55, 12 March 2017 (UTC)
 * NoGhost, I searched Mount Everest for "China Tibet topography" and found nothing. What is the problem exactly?  Thanks! Plastikspork ―Œ (talk)  21:26, 12 March 2017 (UTC)
 * Oh, it seems to be displaying correctly now! I guess it just took awhile to update.  Thanks for checking. --NoGhost (talk) 21:57, 12 March 2017 (UTC)

Philadelphia map not big enough?
The coordinates for Watson Comly School are outside the Philadelphia box, and I've double checked that the coordinates are correct and are within Philadelphia. The template uses File:Location Map Philadelphia Metropolitan Area.png, which cuts off at or very near the building's location. I can't quite tell from the map styling. Is this an issue with insufficient border coordinates being set, or should there be a larger map for Philadelphia? (Is this even the right place to ask?) kennethaw88 • talk 07:53, 16 March 2017 (UTC)
 * kennethaw88, if you look at a larger version of the map image, you will see a purple dashed line. that line is the boundary of Philadelphia.  it looks like that when User:Vrysxy exported the image from openstreet map, the image was cropped too much.  you could try to export a new image from open street map using a larger region.  just make sure you keep track of the bounding box lat/long information.  or, try asking at WP:Maps or Graphics Lab/Map workshop to see if someone there can help.  I would help, but I haven't had any luck with exporting images from openstreetmap. Frietjes (talk) 15:27, 16 March 2017 (UTC)
 * Thanks, I asked over at WP:Graphics Lab/Map workshop. kennethaw88 • talk 19:01, 18 March 2017 (UTC)

Template-protected edit request on 23 March 2017
Request to enable the following: to be used as a map for locations within the city of Pretoria itself. SpringbokSam (talk) 16:40, 23 March 2017 (UTC)
 * You can do this yourself. Just create the location map data for it, like I did here: Module:Location map/data/Beijing. You only need the precise latitude and longitude of its edges. Or if you have them but are unsure of creating the module post the coordinates here and someone else can easily do it.-- JohnBlackburne wordsdeeds 17:00, 23 March 2017 (UTC)
 * Ah, it contains coordinates. I have created the data at Module:Location map/data/Pretoria. To use it simply do with appropriate coordinates and other parameters. When you do please double-check the location is right, in case the coordinates are not precise enough for the map.-- JohnBlackburne wordsdeeds 17:07, 23 March 2017 (UTC)
 * And I made a couple of mistakes but have hopefully now corrected them. I added the map to Transvaal Museum as a test and it seems to be working, and is certainly more useful than a map of the whole province.-- JohnBlackburne wordsdeeds 17:17, 23 March 2017 (UTC)

Glitch on the Greenwich date line
Only one of these maps works; the only difference is using E or W for the longitude. Oddly the coordinates both work fine as standalone coordinates: Noticed and fixed at Tema. Is likely not going to come up often as there can’t be that many places exactly on the date line, but something odd is happening.-- JohnBlackburne wordsdeeds 07:01, 6 March 2017 (UTC)
 * 5.66667°N, °W
 * 5.66667°N, °W
 * JohnBlackburne, if you inspect the HTML source, you will see that the coord template is returning  in the metadata for the first one and   for the second one.  the coord2text code expects the two numbers to be positive. the interesting thing is that there is a second chunk of metadata which has the coordinates with sign separated by a semicolon.  I wonder if we should just use that chunk instead of the first chunk.  this would help with translating the module to other wikis which have different letter symbols for North/East/South/West. I recently had to do this [//vi.wikipedia.org/w/index.php?title=Mô_đun%3ALocation_map&type=revision&diff=26266387&oldid=26238632 on the Vietnamese Wiki]. Frietjes (talk) 14:15, 6 March 2017 (UTC)
 * I can see what you mean; Seems to me the problem is with coord, if it’s outputting plus and minus zero for the same coordinate, especially as there are no negative numbers in the inputs which are valid inputs. But it’s not something I’m confident fixing or proposing a fix as I have no experience with either template, and would be far too wary of breaking anything. This is a particular edge case that’s broken, but fixing it might impact other edge cases.-- JohnBlackburne wordsdeeds 06:58, 8 March 2017 (UTC)

One more instance of it: Bilanga-Yanga. Fixed, posted for reference.-- JohnBlackburne wordsdeeds 15:41, 13 March 2017 (UTC)
 * JohnBlackburne, those poor people who have to live in the middle of a lake! I fixed the imprecise coordinates.  thank you! Frietjes (talk) 16:18, 13 March 2017 (UTC)
 * Ah,.thanks. This one I thought "I’ve seen this before!" and rapidly fixed it checking it only in preview. I did not think to check whether the position made sense.-- JohnBlackburne wordsdeeds 16:22, 13 March 2017 (UTC)

Maplandia map problem?
And one more: Ganta, Burkina Faso. This was another one which was wrong, though not horribly wrong so it was easy to find and fix. Except oddly I too got it wrong first time as I copied the values from here: Ganta Map — Satellite Images of Ganta which has the minutes as 30'W instead of 3'W, despite locating it correctly on the map. I don’t know if this is a syatemic error with this service, in which case a lot of other locations could be wrong if people are basing them on it.-- JohnBlackburne wordsdeeds 13:24, 18 March 2017 (UTC) to reply to me 08:46, 23 April 2017 (UTC)
 * Fixed; the issue was that the coord2text regex didn't allow negative numbers. coord should probably be modified so it outputs 0.0°S/W instead of -0.0°N/E. Jc86035 (talk) Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * Thanks. I think I’ve encountered it a couple more times since, but was easy to fix, checking the coords for more precise ones, working round it if zero was correct. I do agree, outputting negative zero makes no sense at all; even if output values ranged over positive and negative numbers, zero is not normally considered negative, outside of some fairly esoteric cases in mathematics.-- JohnBlackburne wordsdeeds 15:13, 23 April 2017 (UTC)

Icon position error
I noticed that the position of the airplane icon (the "pushpin_mark" graphic) is misleading in the Joint Base Anacostia–Bolling article. It appears at the tip of Greenleaf Point, even though the coordinates for JBAB appear to be correct in the template. Clicking on the Coordinates text in the article as displayed shows the correct location about a mile south of Greenleaf Point. At first I thought this error was related to the fact that the pushpin label wraps across three lines, but reducing the label to one line doesn't solve the problem. So I don't know how to fix the problem, but it seems to be real enough. 76.22.118.146 (talk) 02:00, 23 April 2017 (UTC)


 * See the pushpin map at right. Is the aeroplane icon displayed in the correct position here? If it is, there is some sort of problem in extracting coordinate values from but if it is also wrong, the problem is nothing to do with  but concerns, and is most likely to be the corner coordinates that are recorded at Template:Location map USA District of Columbia. The best place to discuss that is at Module talk:Location map. -- Red rose64 &#x1f339; (talk) 08:53, 23 April 2017 (UTC)

to reply to me 15:02, 23 April 2017 (UTC) to reply to me 15:09, 23 April 2017 (UTC)
 * Replacing the map name with "Washington, DC" works for some reason, even though the location map in question appears to be a redirect. I must be looking in the wrong place for the map that is used. I don't know if this helps, but the map corner coordinates used at Module:Location map/data/USA District of Columbia and Template:Location map USA District of Columbia do not match. – Jonesey95 (talk) 14:44, 23 April 2017 (UTC)
 * The template should probably be deleted and its bounding box values moved to the module subpage. (The module subpage also seems to have other problems, like a second image which doesn't exist.) Jc86035 (talk) Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * Fixed the module. Jc86035 (talk) Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * That works for me. Now the two maps match. Why did "Washington, DC" work though? Where is the file or data for that? I see that you also fixed Module:Location map/data/Washington, DC, which was making "Washington, DC" work as a map name.

to reply to me 15:40, 23 April 2017 (UTC)
 * I fixed a typo in the documentation to make that image appear. – Jonesey95 (talk) 15:17, 23 April 2017 (UTC)
 * I've replaced all the redirects to the template as module subpages as well and CSDed the template. Jc86035 (talk) Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * Looks fine now. Thanks to all for your help. 76.22.118.146 (talk) 23:51, 27 April 2017 (UTC)

Selecting maps to show based on coordinates?
I'm trying to incorporate location maps in infoboxes that are entirely using data from Wikidata, such as Template:Infobox telescope. See South Pole Telescope for an example of this in action, where it is working well by using and. However, in cases like Arecibo Observatory, this does not work so well, since the country is the United States, but File:Usa edcp relief location map.png doesn't include the right part of the US. Even worse is places that are located in Hawaii! I was wondering if there was a way of automatically selecting the map to show based on the coordinate given at all? Alternatively, is there a good matching between the location maps here and a Wikidata property that could be applied here? Thanks. Mike Peel (talk) 22:57, 4 May 2017 (UTC)
 * For frwiki, we decide to choose to use the coordinates to determine the map. Note that isn't a perfect solution, it always give the United States map for places in southern Ontario or Quebec. --Fralambert (talk) 23:31, 4 May 2017 (UTC)
 * Sooner rather than later we will be able to link to map data on Commons on Wikidata items. I would guess this could be used to select the correct maps. You probably shouldn't use country but instead "is in administrative territory" (though there are a few other possibilities, that one will be the most relevant), which will get you the smallest place in which the 'scope is located. --Izno (talk) 02:44, 5 May 2017 (UTC)
 * What's the barrier with linking map data on Commons to Wikidata items? Can the location map code cope with, e.g., ? Thanks. Mike Peel (talk) 02:46, 5 May 2017 (UTC)
 * I... don't actually know if I can answer that? Maybe I'm wrong on this point. Maybe drop this question at d:WD:PC for once. --Izno (talk) 02:50, 5 May 2017 (UTC)
 * OK, I've started a discussion at . Thanks. Mike Peel (talk) 03:02, 5 May 2017 (UTC)

Multiple maps without an infobox
not sure if it is just me, but the radio buttons are not in the caption, unless I embed the location map in another container (e.g., 2004 Ryder Cup)? can this be fixed? Frietjes (talk) 13:38, 8 May 2017 (UTC) to reply to me 15:12, 10 May 2017 (UTC)
 * I don't think the radio buttons should be in the image caption, since each image has its own caption. Possibly having them in a container like stack by default would work. Jc86035 (talk) Use &#123;&#123;re&#124;Jc86035&#125;&#125;

Location map error category
I've been fixing errors in the category Category:Location maps with different longitude and latitude precisions. I have cleaned-up all the errors in articles, and a few in Draft/User space too. The category is now empty except for one item, an archived 7-year-old Module talk page. While not causing any "problems", I'd like to get rid of this just to have an empty category, which I will monitor for new errors. Since archives aren't supposed to be edited, and "fixing" the problem there would obscure point of the discussion, is there some technical solution. Can the module be changed to not cause the error report from a talk page perhaps? <b style="color:#00FF00">MB</b> 01:46, 17 May 2017 (UTC)
 * I have removed the category from the template output on the talk page.[//en.wikipedia.org/w/index.php?title=Module_talk:Location_map/Archive_4&diff=780909641&oldid=648503394] I used Special:ExpandTemplates to see the exact code generated, and used Replace to replace it with nothing. PrimeHunter (talk) 21:57, 17 May 2017 (UTC)

Glitches

 * after  is not needed because we don't want to go further if map does not exist ("Template:Location map" will be found, "Module:Location map/data/" not).
 * and    should be deleted too, because if module with its subpage does not exists that does not mean that we have invalid name for a location map definition.
 * should be changed to . Are location templates really regarded as legacy on en.wiki?
 * should be changed to.

PS "What links here" gets links of all modules that don't exist after template is found in second elseif. I've semi-fixed this sr.wiki by reordering module-template check (because templates are used there more than modules, only 12 modules exist). I suppose mw.title.new is doing this. Is there a way to prevent it?--Obsuser (talk) 13:47, 10 May 2017 (UTC)
 * Try your changes out in the sandbox and review the test cases for the templates in which that module is used. --Izno (talk) 13:57, 10 May 2017 (UTC)
 * Unfortunately, none of these changes are good. Specifically:
 * I'd agree about the "end" becoming an "elseif" if not for the intervening code (which was incorrectly removed, as I'll explain below).
 * doesn't mean "if this module doesn't exist"; it means "if this isn't a valid title at all". Compare these links: https://en.wikipedia.org/wiki/Module:Location_map/data/Some_nonexistent_thing and https://en.wikipedia.org/wiki/Module:Location_map/data/Something_with_an_%5B_in_it
 * Regarding the frame error, the checks I'm doing are just to see if the thing is a frame or not. That just makes the error more obscure.
 * Changing the exists line causes a Lua error if a bad title (see above) is used.
 * Eventually, all map definition templates should be converted to modules, so modules should have priority in the loading order.
 * Not being able to find a name makes no sense.
 * Jackmcbarn (talk) 00:41, 26 May 2017 (UTC)
 * Why to have  and go further if we don't have  ?
 * OK.
 * No, module checks if  is not   or if   is not   and if one of these is true then flags error. That's why 'A frame must be provided when using a legacy location map' shuld be changed into more descriptive 'Type of "frame" must be "table" and type of "frame.expandTemplate" must be "function" when using location map via template "Location map ~"'. Again, are location templates really regarded as "legacy" on en.wiki?
 * OK.
 * Then how to stop mw.title.new from polluting "What links here" special page which gets all modules that don't exist after template is found in second elseif? Currently there is way more templates, so one solution is to reorder check or find other way to check if title is going to be valid (use replace to check if there are any for-title-forbidden characters).
 * What was Not being able to find a name makes no sense. related to? --Obsuser (talk) 05:28, 31 May 2017 (UTC)
 * The  function never returns, so none of the code below it runs anyway. Adding an   would just add another indentation level for no actual gain.
 * There's no  function. If there were, I'd use it instead.   is just how I make sure that   is actually a frame. If someone gets that error, they should just pass an actual frame, not add an   function of their own to whatever object they're passing.
 * Either the template or module "What links here" pages will be polluted. There's no way to avoid that. I chose to pollute the module one, since the goal is to eventually convert all location map templates to modules, which will end the pollution. The template form is regarded as legacy, and in fact, you can't create new map definitions in template form. The only reason there's more templates is that conversion is currently a slow, manual process.
 * "Not being able to find a name makes no sense." refers to your sandbox edit that changed the error message "Unable to find the specified location map definition." to "Unable to find the specified location map definition or name."
 * Jackmcbarn (talk) 21:07, 2 June 2017 (UTC)
 * We have  and then   with   and rest; if there is no map, we will not have moduletitle (it will be "Module:Location map/data/" or "Template:Location map "). That's why I don't understand need for running rest of the code, or I miss something...
 * OK for the rest.--Obsuser (talk) 21:52, 2 June 2017 (UTC)
 * The rest of the code already isn't running. Once you call, it immediately bails out of the function you're in. Jackmcbarn (talk) 22:37, 3 June 2017 (UTC)
 * We have  and then   with   and rest; if there is no map, we will not have moduletitle (it will be "Module:Location map/data/" or "Template:Location map "). That's why I don't understand need for running rest of the code, or I miss something...
 * OK for the rest.--Obsuser (talk) 21:52, 2 June 2017 (UTC)
 * The rest of the code already isn't running. Once you call, it immediately bails out of the function you're in. Jackmcbarn (talk) 22:37, 3 June 2017 (UTC)

TfD
If anyone cares, I've nominated Location map+ for deletion on grounds that it can be replaced by Location map many. Jc86035 (talk) <span style="display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1.2em;font-size:80%;text-align:left">Use &#123;&#123;re&#124;Jc86035&#125;&#125; to reply to me 09:40, 8 June 2017 (UTC)

Infobox map
, can we merge template:infobox map here? all it does is (1) if the location map exists, then calls location map and (2) if the location map doesn't exist, it assumes that the value in  is an image, and calls the InfoboxImage module. it seems as though if we were able to specify an action for when the map doesn't exist, then we could directly replace template:infobox map with template:location map. for example, something like, which is (of course) an abbreviated version of what would actually be put in the transcluding infoboxes. Frietjes (talk) 15:30, 3 June 2017 (UTC)
 * I personally don't like that a template with that purpose ever existed (specifically, I think it should be explicit whether you want a map or a static image). Anyway, since I doubt it's going away now, my preferred approach would be to replace it with a nicer Lua wrapper (like /multi is now), rather than to make it part of the main code that every map needs to load. Jackmcbarn (talk) 22:39, 3 June 2017 (UTC)
 * Jackmcbarn, I totally agree with you that it's a bad design to overload the parameters like that. we can get rid of it, but it will be a process to do so.  luckily there are only about 850 pages passing images instead of location maps. but there are about 10 templates which are using it.  so we either (a) start discussions on the individual pages, gain consensus, and change the parameter syntax template-by-template, (b) start another TfD for infobox map and discuss the design flaws there, or (c) start an RfC elsewhere. Frietjes (talk) 13:37, 4 June 2017 (UTC)
 * Unless you foresee major objections, my personal opinion would be to WP:BOLDly start fixing articles and individual templates, then if there's an objection, taking it to WP:TFD. Jackmcbarn (talk) 15:54, 7 June 2017 (UTC)
 * sounds like a good plan. Frietjes (talk) 14:29, 14 June 2017 (UTC)

Allow a static image to be in the list of toggled maps?
Jackmcbarn and others, there is currently an RFC at Middlebury, Connecticut discussing whether or not to include the location map. the primary objection for the location map is that the location map makes the infobox even longer while the static image already shows the location. so, I was thinking that it should be possible to include a static image in the list of toggled maps in this template. so, the static image would be shown first (smallest scale), but one could then toggle to the wider scale location. what do you think? Frietjes (talk) 14:32, 14 June 2017 (UTC) to reply to me 15:03, 14 June 2017 (UTC)
 * No objection, although there might need to be a new parameter for the "Show map of the …" image description. Jc86035 (talk) <span style="display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1.2em;font-size:80%;text-align:left">Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * It's already possible to do this, although it might not be clear how. I'll set it up on that page. Jackmcbarn (talk) 17:29, 13 July 2017 (UTC)
 * Okay, having tried it, this module supports the required functionality, but I don't think Template:Infobox settlement does. I set this up in User:Jackmcbarn/sandbox2 without the infobox. I'm not sure what the cleanest way to do this inside an infobox would be. Jackmcbarn (talk) 17:38, 13 July 2017 (UTC)

Coordinates input
Should coordinates allow forms of input which are easier to type and don't involve Coord, such as the German Wikipedia's  or  ? This would be useful for e.g. Location map many. Currently the module only searches for  or. Jc86035 (talk) <span style="display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1.2em;font-size:80%;text-align:left">Use &#123;&#123;re&#124;Jc86035&#125;&#125; to reply to me 09:47, 8 June 2017 (UTC)
 * Jc86035, I made Module:German coord convert back in 2015 to assist with converting from the German coordinates style. I wouldn't object to having it merged somewhere.  if I recall, the reason why slashes are used as delimiters was that back before LUA the only easy way to split strings was to use "titleparts".  Frietjes (talk) 12:38, 8 June 2017 (UTC)
 * How often do location maps really get used without an accompanying coord? Jackmcbarn (talk) 17:41, 13 July 2017 (UTC)

Toggle options appear in the wrong place
At Hafenstraße the options to view different maps (of Hamburg, of Germany, or both) appear between the first and second paragraphs of the lede, to the left of the maps. This isn't necessarily confusing or disruptive, but common sense dictates that they ought to appear below the map, and the lede ought to be uninterrupted. I expect the best way to fix this will be to incorporate the map(s) into an infobox, but is this a problem people are aware of, and can it be fixed any other way? – Arms &amp; Hearts (talk) 00:21, 10 August 2017 (UTC) to reply to me 15:12, 10 August 2017 (UTC)
 * This has been discussed before, but no action was taken to ameliorate the template. I think right now putting the map in an infobox would be best. Jc86035 (talk) <span style="display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1.2em;font-size:80%;text-align:left">Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * Thanks for the link (and for the reminder that those things are called radio buttons, which I'd completely forgotten). I had a go at putting the map in Infobox street in Hafenstraße but couldn't work out how to do it – or, I can do it by just pasting the code that's already there into the  parameter of the infobox, but it shows up with the thumbnail border, so I assume there's a better way? – Arms &amp; Hearts (talk) 19:34, 10 August 2017 (UTC)
 * I've added the infobox for . —&thinsp;JJMC89&thinsp; (T·C) 20:03, 10 August 2017 (UTC)
 * Nice one, thanks! – Arms &amp; Hearts (talk) 23:17, 10 August 2017 (UTC)

Enabling mapframe
I've started a discussion about enabling mapframe at Village_pump_(technical). This will be of interest to editors here as it is an alternative way to displaying location maps using OSM data. Thanks. Mike Peel (talk) 00:34, 6 September 2017 (UTC)

Map won't display at specific width
The following code creates a map with two labeled marks and works fine (shown on left). But if the width is changed to 330... (see right) <b style="color:#00FF00">MB</b> 02:55, 8 October 2017 (UTC)


 * They both look fine to me. What are you seeing? – Jonesey95 (talk) 04:05, 8 October 2017 (UTC)
 * , On the right, I am seeing where the map should be, just a blue link that says "Location map is located in the Bogota savanna" inside the boxes with the caption properly displayed. The link is to File:Sabana de Bogota.png. After you said it worked for you, I tried using IE instead and it is fine there. I only have the problem with Firefox, and only at width=330. <b style="color:#00FF00">MB</b> 04:21, 8 October 2017 (UTC)
 * I suspect this is because the server sometimes doesn't render 662px correctly (Firefox says it has errors), which is the one displayed to users with high-pixel-density screens. I don't know why this is happening. Jc86035 (talk) 04:30, 8 October 2017 (UTC)

Multiple map problem on Azerbaijani Wikipedia
Hello, I create this module on Azerbaijani Wikipedia. You can see sample in here. But maps not appear separately. I mean we can not use user selection of multiple maps. Can somebody help me? --Drabdullayev17 (talk) 17:02, 25 September 2017 (UTC)
 * I just had a look at this. I can see the problem and was able to reproduce it in my sandbox. az:İstifadəçi:JohnBlackburne. It looks like the output of the module is the same as on en.wiki, but az.wiki does not support the container it is using: a "switcher-container" .I don’t know where this is defined or why it would not be working, but it’s hopefully easy to add.-- JohnBlackburne words<sub style="margin-left:-2.0ex;">deeds 04:38, 8 October 2017 (UTC)
 * Pinging poster in case they are no longer checking here.-- JohnBlackburne words<sub style="margin-left:-2.0ex;">deeds 04:39, 8 October 2017 (UTC)
 * I believe the javascript is in MediaWiki:Gadget-switcher.js, but could probably be of more help. Frietjes (talk) 15:04, 8 October 2017 (UTC)
 * I ask to to our sysops for create MediaWiki:Gadget-switcher.js. After create page I will let you know about result. --Drabdullayev17 (talk) 17:13, 8 October 2017 (UTC)
 * MediaWiki:Gadget-switcher.js crated but problem doesn't solved. Now I notice that Switcher also doesn't work. --Drabdullayev17 (talk) 18:23, 9 October 2017 (UTC)
 * , you probably need to enable it. we enabled it here with [//en.wikipedia.org/w/index.php?title=MediaWiki%3AGadgets-definition&type=revision&diff=636256649&oldid=635402112 this edit], after it is enabled it should be listed in az:MediaWiki:Gadgets-definition. Frietjes (talk) 18:48, 9 October 2017 (UTC)
 * after create gadget problem solved. Thank you very much. --Drabdullayev17 (talk) 19:29, 9 October 2017 (UTC)

Namespace sort for the tracking categories
made a request on my talk page that we could help with the tracking category cleanup by sorting (or splitting) the tracking categories so that the non-articles were separated from the articles. I have implemented [//en.wikipedia.org/w/index.php?title=Module%3ALocation_map%2Fsandbox&type=revision&diff=788954141&oldid=782296600 this untested] modification in the sandbox to prefix the sort key with a 'μ' for anything that's not in the article namespace. note that the string transformations and namespace detection only happens when there are tracking categories, so the overhead should be minimal. another option would be to have a table with the tracking categories with keys for both main and non-main namespaces, then do a lookup at the end. this could help with localization as well. I just went for the least complicated solution here. comments? Frietjes (talk) 13:37, 4 July 2017 (UTC)
 * Two things I'd suggest:
 * Possibly count articles and templates together, since a lot of these problems I see in articles seem to come from a template that contains a location map with an error.
 * Since the sort key already contains useful information, rather than replacing it with a non-useful 'μ', why not use separate categories for articles and non-articles so that that information can be preserved?
 * Jackmcbarn (talk) 17:25, 13 July 2017 (UTC)
 * What I was after was segregating things that should be fixed (like articles) from errors that probably shouldn't (like drafts in User sandboxes). So I would agree templates should be fixed as well as errors in other names spaces except User.
 * I also like the idea of separate categories because that would give a number of errors to be fixed.
 * Also, the "precision errors" are in a separate sub-cat, but the others are lumped together in the main category which I found highly confusing in the beginning. Can all errors be put in individual categories? <b style="color:#00FF00">MB</b> 18:13, 13 July 2017 (UTC)
 * I have modified the sandbox code, so [//en.wikipedia.org/w/index.php?title=Module%3ALocation_map%2Fsandbox&type=revision&diff=790433301&oldid=782296600 this is now the untested] proposed change. splitting the "Page using removed parameter" and "Outside flag not set with mark outside map" into two separate categories would be very easy to do (see [//en.wikipedia.org/w/index.php?title=Module%3ALocation_map%2Fsandbox&type=revision&diff=790433874&oldid=790433301 this additional change]).  please feel free to make any further comments, corrections, suggestions (i.e., names for the categories, implementation, etc.). Frietjes (talk) 18:44, 13 July 2017 (UTC)
 * I note that at least in the documentation, there are two additional possible errors - "Map using removed parameter" and "Name containing pipe".<b style="color:#00FF00">MB</b> 05:56, 14 July 2017 (UTC)

, just wondering if you are going to implement this; there hasn't been any update in six weeks or so. <b style="color:#00FF00">MB</b> 01:12, 6 September 2017 (UTC)
 * , I was hoping to hear back from Jackmcbarn about [//en.wikipedia.org/w/index.php?title=Module%3ALocation_map%2Fsandbox&type=revision&diff=790433301&oldid=782296600 this untested change], which would put 'articles and templates' in a separate category. Frietjes (talk) 13:47, 6 September 2017 (UTC)
 * I've been kind of busy lately, so I don't have time to test that myself, but I looked over it, and if it works, I have no objections. (Just remember to create the new category pages, and to link between them and the old ones). Jackmcbarn (talk) 17:36, 9 September 2017 (UTC)
 * okay, I ended up creating more subcategories and sorting the only non-empty subcategory by "fullpagename", which I believe satisfies the original request. please feel free to adjust it, or point out problems with what I did. Frietjes (talk) 14:52, 14 September 2017 (UTC)
 * This last change has been a big help and enables me to easily find articles that contain map errors which should be fixed. There are none right now and I have been quickly catching some cases of vandalism that previously went unnoticed for months. There are still about 150 "outside" errors, mostly in user space. This number fluctuates slightly; unless I remember the last number exactly I still have to scan the entire list to look for new mainspace errors to fix. I believe it would be better to just not have errors that are not in mainspace. (If a template is causing an error, the articles it affects would be flagged - so the check could be simplified to article-space only). I asked if he was aware of any general practice and he said "Many templates and modules make a namespace check to only add maintenance categories in mainspace. For example, Lang adds Category:Articles containing unknown ISO 639 language template to articles and nothing to other pages." Can we add such a check here? Can it be done within a Module with little overhead? <b style="color:#00FF00">MB</b> 15:55, 12 November 2017 (UTC)
 * definitely possible, perhaps we restrict to (1) article and (2) template namespace as suggested above? if we only check the namespace right before adding the tracking categories, then the overhead is only added for the pages being tracked. Frietjes (talk) 15:58, 13 November 2017 (UTC)
 * I'm not sure anymore that there is a good reason to include Templates. The current category includes about a dozen errors from Template namespace and they are all in unused templates or other subpages - none of which cause mainspace errors. I am assuming that if a template had a map location error, and it was actually transcluded in an article, then that article would be in the category also. Investigation of the error would lead to the template and a template fix would resolve the problem.


 * Is there is some aspect of testing template changes before they are made live that would make this useful? <b style="color:#00FF00">MB</b> 22:44, 13 November 2017 (UTC)

How to apply multiple maps in other Wikipedia?
I try to apply multiple maps in the Javanese Wikipedia, but it doesn't appear as it is in English Wikipedia. I cannot locate where the problem is. The source of Template:Location map in the Javanese Wikipedia is taken from the English Wikipedia. Could anyone here please help me? Thank you in advance.

This is comparison what I've tried about adding multiple maps in sandboxes of the two wikis. The Javanese Wikipedia result and the English Wikipedia result. Wirjadisastra (talk) 07:59, 12 December 2017 (UTC)
 * Wirjadisastra, see the thread about the same thing above. basically, you need to make sure you have the javascript gadget installed: (1) copy en:MediaWiki:Gadget-switcher.js to jv:MediaWiki:Gadget-switcher.js and then (2) edit jv:MediaWiki:Gadgets-definition as we did [//en.wikipedia.org/w/index.php?title=MediaWiki%3AGadgets-definition&type=revision&diff=636256649&oldid=635402112 with this edit]. Frietjes (talk) 14:35, 12 December 2017 (UTC)


 * Thank you so much Frietjes! It's happening! Wirjadisastra (talk) 15:00, 12 December 2017 (UTC)

Multi-map not working on some browsers?
I am having a disagreement with at Talk:Gråen over whether the multiple map feature should be used at all because on his system the multiple map radio buttons are not working and all the maps display at once. I am unable to verify that any browser has this problem and have checked Edge, Explorer and Chrome on Windows 10 and Safari, Firefox, Chrome and Opera on macOS. I am not clear what OS or versions of browsers Boeing720 is using. To me, if the feature is here and widely used it should be used on any article where it is helpful. Does anyone know how many browsers might be affected by this? Even if it is a significant portion of browsers that visit Wikipedia, which I seriously doubt, how could this be an argument against using it on any given article when it is widely used? Thanks for input. —DIYeditor (talk) 21:06, 4 January 2018 (UTC)

I have started an RfC on whether the feature should be used despite it not working for some(?) users at Talk:Gråen which may be of general interest. —DIYeditor (talk) 22:04, 4 January 2018 (UTC)
 * DIYeditor, I believe if you have javascript disabled, you see all the maps at the same time. without specific OS/browser information, it's hard to debug any issues. Frietjes (talk) 00:01, 5 January 2018 (UTC)

Template-protected edit request on 24 January 2018
Ecal saputra (talk) 17:16, 24 January 2018 (UTC) File:Location map Jabodetabek.png
 * Red question icon with gradient background.svg Not done: it's not clear what changes you want to be made. Please mention the specific changes in a "change X to Y" format and provide a reliable source if appropriate. —&thinsp;JJMC89&thinsp; (T·C) 17:22, 24 January 2018 (UTC)


 * If anyone has time on their hands and is familiar with the map creating software has uploaded a couple of images for maps,  File:Location map Jakarta Metropilitan Area.png and  File:Location map Jabodetabek.png, but the coordinates on their description pages are wrong. I only discovered this when trying to create location map data for the first one, and the second one has the same problem. If someone corrects the coordinates for each then it will be easy to create the Location map data for Jabodetabek, and repair the data for Jakarta Metropilitan Area.-- JohnBlackburne words<sub style="margin-left:-2.0ex;">deeds 17:26, 24 January 2018 (UTC)
 * I created Module:Location map/data/Indonesia Jabodetabek after some experimentation with Open Street Map to visually match the borders of the image. better would probably be to reexport the images while keeping track of the edge coordinates. I also corrected the edges in Module:Location map/data/Jakarta Metropolitan Area. Frietjes (talk) 17:40, 24 January 2018 (UTC)
 * the best way to track edge coordinates, I find, is the URL of OpenStreetMap. So, I assume you used the "Share" button. Firstly, Wikipedia generally does SVG, as they scale better. But, when you press that button, it takes you to a page like (you may need to "Copy link address" on your downloads). In that url you have your edge coordinates - bbox=-1.2672472000122073,51.75764705243149,-1.2530851364135744,51.76374974924039. These are bottom left->top right.  &#x2230; Bellezzasolo &#x2721;   Discuss  17:53, 24 January 2018 (UTC)

Template-protected edit request on 29 January 2018
Manado }} Ecal saputra (talk) 12:09, 29 January 2018 (UTC)

Module:Location map/data/Manado created. &#x2230; Bellezzasolo &#x2721;  Discuss  13:47, 29 January 2018 (UTC)

Massive breakdown @ Lua error in Module:Location_map at line 221: attempt to compare number with nil.
This is happening across multiple articles in English Wikipedia, right now. Something must have changed at this moment because the location maps in multiple articles do NOT display the actual files anymore but instead, display the error message reading: Please help, thank you.  Poeticbent  <span style="color:#FFFFFF;font-size:7.0pt;font-weight:bold;background:#FF88AF;border:1px solid #DF2929;padding:0.0em 0.2em;">talk 17:05, 16 January 2018 (UTC)
 * , see the thread directly above and [//en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmtitle=Category%3APages%20with%20script%20errors&cmprop=title&cmlimit=500&cmnamespace=0&format=xml check this report] to find any in articles. Frietjes (talk) 17:07, 16 January 2018 (UTC)
 * Thanks . I don't know what happened but the error messages disappeared as quickly as they came. I was just working on the Nazi extermination camps Treblinka and Sobibor when both maps were replaced with the error messages, buy not anymore. The maps are back. Sorry for the false alarm.  Poeticbent  <span style="color:#FFFFFF;font-size:7.0pt;font-weight:bold;background:#FF88AF;border:1px solid #DF2929;padding:0.0em 0.2em;">talk 17:24, 16 January 2018 (UTC)
 * A few more popped up in the category in the last hour, but purging fixes them in case anyone else comes across them.-- JohnBlackburne words<sub style="margin-left:-2.0ex;">deeds 18:57, 16 January 2018 (UTC)

Hello, I found a similar problem in Indonesian Wikipedia (id.wikipedia.org), How to fix it? error on article id:Piala AFC 2018, id:Module:Location map is updated same with this english version. The detailed error message is:


 * 1) . --Hidayatsrf (talk) 04:09, 7 February 2018 (UTC)
 * the offending line is if (x 100 or y 100) and not args.outside then . Looks like x or y (or both) have got messed up somewhere. &#x2230; Bellezzasolo &#x2721;   Discuss  04:59, 7 February 2018 (UTC)
 * 1) . --Hidayatsrf (talk) 04:09, 7 February 2018 (UTC)
 * the offending line is if (x 100 or y 100) and not args.outside then . Looks like x or y (or both) have got messed up somewhere. &#x2230; Bellezzasolo &#x2721;   Discuss  04:59, 7 February 2018 (UTC)

Multi-map captions?
Hi, recently been working on the Template:Infobox UK place. I worked out the syntax for multi-maps, and applied it to St Anne's College, Oxford, by adding a location_map2 to Template:Infobox residential college. I noticed that there was no way within to specify captions for multiple maps - I suggest using the # separator as in the  parameter. &#x2230; Bellezzasolo &#x2721;  Discuss  23:07, 14 January 2018 (UTC)
 * I have implemented my changes in the sandbox. &#x2230; Bellezzasolo &#x2721;   Discuss  23:57, 14 January 2018 (UTC)

Made an edit request.
 * Changes:

&#x2230; Bellezzasolo &#x2721;  Discuss  16:09, 15 January 2018 (UTC)
 * caption is now parsed for a # sign, as the Location Map is. This will then provide the different captions for the different maps.
 * Any caption with a # is added to the tracking category of possible errors, to allow easy correction of existing pages.
 * Pictogram voting question.svg Question: has this change been fully tested? &mdash; Martin (MSGJ · talk) 09:19, 16 January 2018 (UTC)
 * somewhat, of course I can only edit the sandbox, and this module doesn’t have a good set of testcases. Obviously, if I was editing the live module, I’d be able to preview multiple pages with this change. However, it shouldn’t have any effect except on captions with a #. I added a tracking category, but would a different delimiter be better, such as #$#? My regex knowledge is rather limited. &#x2230; Bellezzasolo &#x2721;   Discuss  10:15, 16 January 2018 (UTC)
 * , I like this idea. how about if we start by (1) adding tracking for all captions with a "#", then (2) inspect any that show up in the tracking category, (3) code to make sure we don't break anything.  my concern is that if there are URLs or section links in the caption, then a "#" in a URL or a section link might break things.  if we find any of these, we can make sure we don't break these with the new syntax. however, if this is not actually happening in practice, then we can use less complicated regular expressions. Frietjes (talk) 15:48, 16 January 2018 (UTC)
 * Yeah, after I proposed the # (because of uniformity with ) I realized how frequently used the # might be. I'd definitely go for tracking category first, and perhaps change to a single character that is very unlikely to be used, like ⨌ ? &#x2230; Bellezzasolo &#x2721;   Discuss  15:54, 16 January 2018 (UTC)
 * , okay, I have added "Category:Pages using location map with a number sign in the caption" and temporarily disabled the "edit request". it will take some time for the category to fill up (if there as anything that should be in there).  once it's done filling, we can decide what to do next.  Frietjes (talk) 16:50, 16 January 2018 (UTC)
 * Cool, thanks &#x2230; Bellezzasolo &#x2721;   Discuss  16:52, 16 January 2018 (UTC)
 * IMPORTANT Syntax error - comparison with nil (see Template:Location map/testcases)
 * Offending line: if mw.ustring.find(args.caption, '#') > 0 then
 * Replace with: if mw.ustring.find(args.caption, '#') then
 * &#x2230; Bellezzasolo &#x2721;  Discuss  16:55, 16 January 2018 (UTC)
 * , I fixed it per [//www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#string.find the manual]. it returns nil if there is no match, unlike Module:String which returns 0 if there is no match. Frietjes (talk) 17:03, 16 January 2018 (UTC)
 * That's pretty silly syntax, makes errors really easy to make. &#x2230; Bellezzasolo &#x2721;   Discuss  17:04, 16 January 2018 (UTC)
 * Looks to me like the contents of the category are using the '#' symbol for colour codes. It also looks like a manageable category, although I don't know how long it will take for everything to filter through. &#x2230; Bellezzasolo &#x2721;   Discuss  21:33, 18 January 2018 (UTC)
 * , yes, so far the tracking is matching (a) colours, (b) section links, (c) unicode ndash entities using &amp;#8211; (which I have been fixing) and (d) (used as a hack to add an empty caption which I have been fixing).  at a minimum, we should probably expect (a) and (b) to be valid inputs.  so, we can either code around those cases or select a different delimiter.  it would be best if the delimiter were something on a standard keyboard, but not something that is going to have false positives.  if there is nothing suitable on a standard keyboard, another option would be to have an axillary template that takes the captions as input, and outputs the captions with the delimiters inserted.  but, in my opinion, that's not the best option. Frietjes (talk) 21:41, 18 January 2018 (UTC)
 * I actually like the auxiliary template idea, and there are several approaches (of course, they would mean another template). However, if we went with a delimiter of ⨌ (I'm pretty sure would get no hits), we could do a template like for people. However, I do think that a template that took a list would be cleaner syntax. Copy/paste isn't too hard, but that way we have an ASCII option. Of course, something on the standard keyboard is ideal, but the options are very limited.  &#x2230; Bellezzasolo &#x2721;   Discuss  21:48, 18 January 2018 (UTC)
 * , another option would be to use  or   or something with more than one character. Frietjes (talk) 21:51, 18 January 2018 (UTC)


 * Yeah, that's pretty ideal (originally, I was thinking ## to generate a # rather than a separator, a la printf). You'd have to do the regex for that one though! &#x2230; Bellezzasolo &#x2721;   Discuss  21:53, 18 January 2018 (UTC)
 * ((?!##).(?<!##))+ Seems right &#x2230; Bellezzasolo &#x2721;   Discuss  21:59, 18 January 2018 (UTC)

local newstr = string.gsub(args['caption'], '##', '⨌') for caption in string.gmatch(newstr, '[^⨌]+') do
 * as on the sandbox seems to be the ticket. &#x2230; Bellezzasolo &#x2721;   Discuss  22:40, 18 January 2018 (UTC)
 * , I would think that you could do this in one step with mw.text.split(args['caption'], '##', true )? Frietjes (talk) 22:46, 18 January 2018 (UTC)
 * yeah, that works. I used gsplit to get an iterator. &#x2230; Bellezzasolo &#x2721;   Discuss  23:33, 18 January 2018 (UTC)
 * okay, I have moved the category to Category:Pages using location map with a double number sign in the caption and updated the tracking. Frietjes (talk) 19:25, 30 January 2018 (UTC)
 * It looks good to me, what do you say to going ahead with the change? &#x2230; Bellezzasolo &#x2721;   Discuss  16:49, 15 February 2018 (UTC)
 * , done, hopefully nothing breaks! Frietjes (talk) 16:56, 15 February 2018 (UTC)

Lint error
Does anyone here know how to identify the pwrap lint error in 2018 Thai League 4? I have no idea how this template is used and nothing jumps out at me. --Izno (talk) 16:00, 20 February 2018 (UTC)
 * I don't see it either, but in a case like this, I usually try to break down the article into smaller pieces to see which piece(s) trigger the error. So take half of the article and put it in a user sandbox, then take the other half and put it in a different user sandbox. Whichever half has the error, keep dividing that text in half until you have isolated the code with the error. It usually works. – Jonesey95 (talk) 19:20, 20 February 2018 (UTC)
 * No idea, but the bottom of that article shows that pushpin locations are appearing in the navbox instead of the map. Search the page for "Yala United" to find one. Johnuniq (talk) 21:39, 20 February 2018 (UTC)
 * I ditched the maps. It's not obvious to me that these are actually valuable, whatsoever. I'm sure I'll be reverted... ~ --Izno (talk) 23:05, 20 February 2018 (UTC)

Template-protected edit request on 16 February 2018
To fix an issue as described by at User talk:Frietjes:
 * Make the changes in
 * This checks for a present, but empty, caption parameter. If so, it propagates to all maps.
 * &#x2230; Bellezzasolo &#x2721;  Discuss
 * Okay, this one is done. Plastikspork <sub style="font-size: 60%">―Œ <sup style="margin-left:-3ex">(talk) 00:08, 17 February 2018 (UTC)

Then:

Updating the code of Location map's p.mark method with. This allows the support of multiple maps by the method. This is complemented by to Location map/multi's p.container method (also copying the switcherHelper from location map).

&#x2230; Bellezzasolo &#x2721;  Discuss  23:30, 16 February 2018 (UTC)
 * Support multiple maps with the same set of multiple marks (see Template:Location map+/testcases). This could be useful for places, like the University of Oxford, with many places in a small area, with a few spread out places.
 * Support multiple map captions for multimaps.
 * who might be able to look this over. Frietjes (talk) 15:23, 18 February 2018 (UTC)
 * I had a look at Module:Location map/multi/sandbox but don't have time to understand the implications of the changes because I don't know anything about this set of modules. I won't be much use, sorry. Johnuniq (talk) 10:22, 19 February 2018 (UTC)
 * Regarding implementation, how it works is Location map+ calls Module:Location map/multi's p.container method. This method handles creating the map, and also puts the multiple marks onto the map, which are passed as a parameter of multiple Location map~ instances. This template calls Module:Location map's p.mark method to place the mark. That's the current system. I changed /multi to produce the switcher maps (this is done with a Javascript gadget internally), which are currently used by Location map (e.g. in the infobox at Cambridge, Massachusetts). Of course, the mark positions vary depending on the map and the scale. p.mark translates the geographical position of the location into a page position (I believe much like Overlay, but I didn't need to touch this code). As a result, I changed p.mark to parse the  parameter much like p.main (same module). This is the same parsing performed by my change to /multi as well, and is consistent with the current consensus. What is done in my version is that a set of (page) coordinates is produced for each map by the p.mark call. This then produces a list of positions, all separated by the string #PlaceList#. It looks like this: (Place1Map1, Place1Map2, ..., Place1MapN, Place2Map1, ..., PlaceMMapN). I then essentially transpose this matrix (in list form) to get a list of the places for each map. The resulting lists are fed to the respective maps, and the result is concatenated into the final, switching, map set. Of course, this procedure would go wrong if the editor put the wrong number of maps into one of the Location map~ instances, however this is, I believe, a matter of WP:CIR, and should be fairly obvious in most cases. It is an unfortunate limitation of the current system, that the parameter has to be duplicated like that. As a final change, I added support for multi-map captions as per the above edit.   &#x2230; Bellezzasolo &#x2721;   Discuss  21:48, 19 February 2018 (UTC)
 * Yes check.svg Done no opposition so I have made the edit &mdash; Martin (MSGJ · talk) 13:15, 23 February 2018 (UTC)