Module talk:Location map/Archive 9
![]() | This is an archive of past discussions about Module:Location map. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 5 | ← | Archive 7 | Archive 8 | Archive 9 | Archive 10 | Archive 11 |
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)
- @Plastikspork: 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
![]() | This edit request to Module:Location map has been answered. Set the |answered= parameter to no to reactivate your request. |
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.--JohnBlackburnewordsdeeds 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 {{Location map|Pretoria}} 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.--JohnBlackburnewordsdeeds 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.--JohnBlackburnewordsdeeds 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.--JohnBlackburnewordsdeeds 07:01, 6 March 2017 (UTC)
- JohnBlackburne, if you inspect the HTML source, you will see that the {{coord}} template is returning
5.66667°N 0.00000°E
in the metadata for the first one and5.66667°N -0.00000°E
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 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.--JohnBlackburnewordsdeeds 06:58, 8 March 2017 (UTC)
One more instance of it: Bilanga-Yanga. Fixed, posted for reference.--JohnBlackburnewordsdeeds 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.--JohnBlackburnewordsdeeds 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.--JohnBlackburnewordsdeeds 13:24, 18 March 2017 (UTC)
- @JohnBlackburne and Frietjes: 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 {{re|Jc86035}}
to reply to me 08:46, 23 April 2017 (UTC)- 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.--JohnBlackburnewordsdeeds 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
{{Coord|38|50|34|N|077|00|58|W|name=JB Anacostia–Bolling|display=inline,title}}
but if it is also wrong, the problem is nothing to do with{{coord}}
but concerns{{Location map}}
, 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. --Redrose64 🌹 (talk) 08:53, 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)
- @Jonesey95: 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 {{re|Jc86035}}
to reply to me 15:02, 23 April 2017 (UTC) - Fixed the module. Jc86035 (talk) Use {{re|Jc86035}}
to reply to me 15:09, 23 April 2017 (UTC)- 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.
- That works for me. Now the two maps match.
- @Jonesey95: 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 {{re|Jc86035}}
- 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)
- I fixed a typo in the documentation to make that image appear. – Jonesey95 (talk) 15:17, 23 April 2017 (UTC)
- @Jonesey95: I've replaced all the redirects to the template as module subpages as well and CSDed the template. Jc86035 (talk) Use {{re|Jc86035}}
to reply to me 15:40, 23 April 2017 (UTC)- Looks fine now. Thanks to all for your help. 76.22.118.146 (talk) 23:51, 27 April 2017 (UTC)
- @Jonesey95: I've replaced all the redirects to the template as module subpages as well and CSDed the template. Jc86035 (talk) Use {{re|Jc86035}}
- I fixed a typo in the documentation to make that image appear. – Jonesey95 (talk) 15:17, 23 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 coordinate location (P625) and country (P17). 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)
- @Mike Peel: 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)
- @Izno: What's the barrier with linking map data on Commons to Wikidata items? Can the location map code cope with, e.g., Arecibo (Q640728)? Thanks. Mike Peel (talk) 02:46, 5 May 2017 (UTC)
- @Mike Peel: 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)
- @Izno: OK, I've started a discussion at [1]. Thanks. Mike Peel (talk) 03:02, 5 May 2017 (UTC)
- @Mike Peel: 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)
- @Izno: What's the barrier with linking map data on Commons to Wikidata items? Can the location map code cope with, e.g., Arecibo (Q640728)? Thanks. Mike Peel (talk) 02:46, 5 May 2017 (UTC)
Multiple maps without an infobox
@Jackmcbarn: 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)
- @Frietjes: 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 {{re|Jc86035}}
to reply to me 15:12, 10 May 2017 (UTC)
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? MB 01:46, 17 May 2017 (UTC)
- I have removed the category from the template output on the talk page.[2] 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
end
afterif not map then
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).local moduletitle = mw.title.new('Module:Location map/data/' .. map)
andif not moduletitle then
error(string.format('%q is not a valid name for a location map definition', map), 2)
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.A frame must be provided when using a legacy location map
should be changed toType of "frame" must be "table" and type of "frame.expandTemplate" must be "function" when using location map via template "Location map ~"
. Are location templates really regarded as legacy on en.wiki?elseif moduletitle.exists then
should be changed toelseif mw.title.new('Module:Location map/data/' .. map).exists then
.
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)
- @Obsuser: 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).
if not moduletitle then
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)
- @Jackmcbarn:
- Why to have
end
and go further if we don't havemap
? - OK.
- No, module checks if
type(frame)
is nottable
or iftype(frame.expandTemplate)
is notfunction
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)
- @Obsuser:
- The
error
function never returns, so none of the code below it runs anyway. Adding anelse
would just add another indentation level for no actual gain. - There's no
isFrame()
function. If there were, I'd use it instead.type(frame) ~= 'table' or type(frame.expandTemplate) ~= 'function'
is just how I make sure thatframe
is actually a frame. If someone gets that error, they should just pass an actual frame, not add anexpandTemplate
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."
- The
- Jackmcbarn (talk) 21:07, 2 June 2017 (UTC)
- @Jackmcbarn:
- We have
if not map then error('The name of the location map definition to use must be specified', 2) end
and thenlocal moduletitle
with.. map
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...
- We have
- OK for the rest.--Obsuser (talk) 21:52, 2 June 2017 (UTC)
- @Obsuser: The rest of the code already isn't running. Once you call
error()
, it immediately bails out of the function you're in. Jackmcbarn (talk) 22:37, 3 June 2017 (UTC)
- @Obsuser: The rest of the code already isn't running. Once you call
- @Jackmcbarn:
- Why to have
- @Jackmcbarn:
TfD
If anyone cares, I've nominated {{Location map+}} for deletion on grounds that it can be replaced by {{Location map many}}. Jc86035 (talk) Use {{re|Jc86035}}
to reply to me 09:40, 8 June 2017 (UTC)
Infobox map
Jackmcbarn, 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 map
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,
{{Location map|{{{map}}} | coordinates = {{{coordinates|}}} | badmaperror = {{#invoke:InfoboxImage | InfoboxImage | image={{{map}}} }} }}
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)
- @Frietjes: 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)
- @Frietjes: 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)
- @Frietjes: 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)
- 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)
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)
- No objection, although there might need to be a new parameter for the "Show map of the …" image description. Jc86035 (talk) Use {{re|Jc86035}}
to reply to me 15:03, 14 June 2017 (UTC) - 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
@Frietjes and Jackmcbarn: Should |coordinates=
allow forms of input which are easier to type and don't involve {{Coord}}, such as the German Wikipedia's d/m/s/[N/S] d/m/s/[E/W]
or ±d ±d
? This would be useful for e.g. {{Location map many}}. Currently the module only searches for d°m′s″[N/S] d°m′s″[E/W]
or d°[N/S] d°[E/W]
. Jc86035 (talk) Use {{re|Jc86035}}
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 & Hearts (talk) 00:21, 10 August 2017 (UTC)
- @Arms & Hearts: 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) Use {{re|Jc86035}}
to reply to me 15:12, 10 August 2017 (UTC)- @Jc86035: 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
image_map
parameter of the infobox, but it shows up with the thumbnail border, so I assume there's a better way? – Arms & Hearts (talk) 19:34, 10 August 2017 (UTC)- I've added the infobox for you. — JJMC89 (T·C) 20:03, 10 August 2017 (UTC)
- Nice one, thanks! – Arms & Hearts (talk) 23:17, 10 August 2017 (UTC)
- I've added the infobox for you. — JJMC89 (T·C) 20:03, 10 August 2017 (UTC)
- @Jc86035: 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
Enabling mapframe
I've started a discussion about enabling mapframe at Wikipedia:Village_pump_(technical)#Should_we_ask_for_mapframe_to_be_turned_on.3F. 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)