Template talk:Infobox mapframe
| Template:Infobox mapframe is indefinitely protected from editing as it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases. |
| This is the talk page for discussing improvements to the Infobox mapframe template. |
|
| Archives: 1, 2, 3, 4Auto-archiving period: 2 months |
| This template does not require a rating on Wikipedia's content assessment scale. It is of interest to multiple WikiProjects. | ||||||||
| ||||||||
Frequently asked questions (see also: mw:Help:Extension:Kartographer) Q1: Where to file a bug report when there is a problem with the base map? (e.g. a missing lake)
A1: If the problem also occurs on OpenStreetMap, it needs to be fixed there. If the problem is only on Wikimedia's maps, it can be reported on Phabricator (you can log in with you Wikipedia account). See mw:How to report a bug for instructions (for the tags, use Maps). (Alternatively, you can try mw:Help talk:Extension:Kartographer) Q2: Where to report other bugs or problems with the maps?
A2: This may be a problem with the Wikipedia module, or it may be an underlying software bug (there are lots of those).
Q3: Why does the thumbnail map render as a static image when viewing pages, but is interactive when editing pages?
A3: On Wikipedia, and most wikis other than Wikivoyage, the emdeded thumbnail is a static map, and the full screen map needs to be opened before the map can be zoomed or panned. This is for for performance reasons, and to present some content if javascript is disabled, and for printing. That preview mode shows an interactive map is a bug, phab:T203863 (and also a performance issue). Further explanation can be found in the comments on phab:T202793. Q4: Why is a line or shape feature from OpenStreetMap not being shown?
A4: There are several possible causes:
Q5: Why are line, shape, or point features are not shown after editing or adding a map, even though they were shown in the page preview?
A5: This is a bug related to generating thumbnail map images. It should fix itself in an hour or two. See phab:T269984 for details. Q6: A page using mapframe's
|raw= parameter (within the |mapframe-custom= parameter of an infobox that uses Module:Infobox mapframe) is showing error messages of "The time allocated for running scripts has expired." What can be done?A6: If the amount of raw data to be processed is too large, that timeout message may be shown. You can try moving the raw data to Commons (example) or replacing the mapframe template with the equivalent wikitext using Special:ExpandTemplates (example) |
| Related pages |
|---|
You are invited to join the discussion at Wikipedia:Village pump (miscellaneous) § Automatic map generation from Wikidata. -- Joy (talk) 08:51, 14 December 2025 (UTC)
mapframe-wikidata implicitly on, instead of off?
[edit]At Herero and Nama genocide, there's {{infobox civilian attack}}, which had to have |mapframe=no. Now, this is confusing, because there were no |coordinates= in that infobox call, nor is there |mapframe-wikidata=yes there or in the infobox template defaults.
This needs to be fixed in order to maintain the logical consistency of the current state of Wikipedia:Mapframe maps in infoboxes#Background. --Joy (talk) 12:10, 15 December 2025 (UTC)
- Does it need the mapframe parameter? I removed it and there are no visible errors in preview, is it in a tracking category? Clearly won't show until there are coords defined. Definitely shouldn't show a map by default, due to the nature of the article it may need a bespoke map. Regs, The Equalizer (talk) 08:57, 17 December 2025 (UTC)
- Sorry, in the meantime there was a change on the infobox to also change the onByDefault. I'll have to find a different, less convoluted example. --Joy (talk) 09:45, 17 December 2025 (UTC)
- OK, here's a different example of the same:
- {{Infobox military memorial}} has
|onByDefault=yes, but does not have|mapframe-wikidata=set (so I searched for this) - Alamein Memorial does not have
|coordinates=set, and it has no mapframe parameters set, but d:Q16161233 has P625 coordinates, and a mapframe is shown in the infobox
- {{Infobox military memorial}} has
- That's not supposed to happen - if there's no coordinates in the article, the default mapframe-wikidata in infoboxes was supposed to be off. --Joy (talk) 09:51, 17 December 2025 (UTC)
- I think this happened with this 10 November edit @Hike395 - the part where we had:
-- But do not use wikidata when local coords are specified (and not turned off), unless explicitly set
if useWikidata and config.coord ...
- That last part wasn't kept in the new version - the condition that there is already a set of coordinates in the local config.
- Rather, the suppressWikidata logic was implemented as part of the generic ternary.
- If we want to keep this module code this way, we have to actually go through all the invoking templates and set mapframe-wikidata=off wherever it's not set already.
- I don't know if that's cleaner compared to just having a global default here. --Joy (talk) 10:18, 17 December 2025 (UTC)
- @Joy: Let's try to clarify what you are proposing, since I think you're asking for a behavior change, not a bug fix. Remember that "wikidata" is not really an appropriate name for the parameter, so this may be mixing things up. You said, above
if there's no coordinates in the article, the default mapframe-wikidata in infoboxes was supposed to be off.
- Even before I started editing this module, it drew lines and polygons even if no local coordinates were provided. The canonical example
{{Infobox mapframe|id=Q100}}produces the map to the right
- The test cases contain the behavior of the module as of 2020 (in the third column). The very first test case is this simple case, and you can see that it drew a polygon without coordinates even back in 2020 (albeit with the wrong zoom and with too high of a fill opacity). This is why I think you're asking for a new behavior, rather than fixing an introduced bug.
- I also want to clarify that I am not the maintainer of this module. I've tried to make the module better, but ever since I've gotten involved, I've been pinged with feature requests that are either (a) impossible (because I can't change Kartographer), (b) confusing, (c) very difficult to implement, or (d) I don't agree with. Some of these requests have been rather rude (IMO). I find editing this module now very energy-sapping and unpleasant, so I want to stop editing this module, per WP:VOLUNTEER. I want to concentrate on encyclopedic content, rather than endlessly fiddling with maps.
- Having said that, I can fix actual user-facing bugs that I've introduced over the last couple of months (if any). But I don't want to change the behavior of the template any more. I'll let other editors do that. — hike395 (talk) 13:01, 17 December 2025 (UTC)
- The problem is that when we called the template it would use Wikidata, but when we did #invoke: from other infoboxes, it did not. I know this was so because it was both something that I noticed as a mildly annoying incongruence in practice, and because I kept finding examples like that in practice and having to address them.
- Thinking about examples for the latter, I checked and found a couple from December 6, December 4. In those cases I visually checked what was rendered before and after the conversion from template call to embedded invocation, and then did those updates to get the same features back.
- However, this timeline doesn't actually match the aforementioned commit, so I'm actually back to the drawing board on that.
- Apologies if this came across as rude. I definitely don't have an expectation that you'll make further changes. I'm just trying to confer with you about the code because you seem to have the current insights about its logic, and I'm not sure if I'm looking at the right place (and as we can see from the above, I wasn't). Figuring out what is intended and what is not is important in plotting a way forward, because this code often seems to me like a Chesterton's fence :) --Joy (talk) 14:05, 17 December 2025 (UTC)
- I should note that those two examples were about {{Infobox settlement}}, which can't any longer be used to trivially verify this, because in the meantime the default behavior of that template changed[1] following a brief discussion here. --Joy (talk) 08:09, 18 December 2025 (UTC)
- I created a new fourth column in the test cases based on Template:Infobox mapframe/sandbox3. Several of those test cases now illustrate this behavior. I'm not sure it's entirely right as such, because the custom attributes don't seem to be taken in consistently. --Joy (talk) 08:24, 18 December 2025 (UTC)
- Okay, I get it now, all the testcase parameters are tested as "foo=bar" rather than "mapframe-foo=bar". But the latter form would be needed with #invoke:. I remember a discussion about this, but I can't seem to find it right now. qid is the same in all cases, however, so we still seem to have a basic test of what the default Wikidata behavior does. --Joy (talk) 08:39, 18 December 2025 (UTC)
- @Joy: Let's try to clarify what you are proposing, since I think you're asking for a behavior change, not a bug fix. Remember that "wikidata" is not really an appropriate name for the parameter, so this may be mixing things up. You said, above
- I think this happened with this 10 November edit @Hike395 - the part where we had:
- OK, here's a different example of the same:
- Sorry, in the meantime there was a change on the infobox to also change the onByDefault. I'll have to find a different, less convoluted example. --Joy (talk) 09:45, 17 December 2025 (UTC)
I suspect you are getting confused by a basic difference between {{Infobox mapframe}} and Module:Infobox mapframe. The former takes only the arguments it is given, while the latter inherits arguments from the calling template. Specifically, Module:Infobox mapframe inherits |coordinates= from the infobox that contains its call. Note that both the template and the module call the same underlying code.
This explains the behavior you are seeing at Zaprešić. Before Zackmann08 changed it to use the module, the behavior was
After he edited it to use the module call in {{Infobox settlement}}, the behavior was
because coordinates are supplied in the infobox and there is no OpenStreetMap relation ID (P402) nor geoshape (P3896) at d:Q5408. When you edited Zaprešić, you asked for an explicit shape, so you got
On December 11, Zackmann edited {{Infobox settlement}} to add |mapframe-wikidata=yes by default, which would always draw OpenStreetMap line and polygons, regardless of whether Wikidata has OpenStreetMap relation ID (P402) nor geoshape (P3896). If you hadn't edited Zaprešić and waited for Zackmann, you would have seen
As far as I can tell, there is no bug, everything is working as intended. Zackmann setting |mapframe-wikidata=yes in {{Infobox settlement}} was probably a good idea (modulo perhaps all of the recent controversy about the reliability of OpenStreetMap lines/polygons). — hike395 (talk) 12:46, 18 December 2025 (UTC)
- Okay, thanks, that all makes sense for that use case. But what about the inverse, the case at e.g. Alamein Memorial I mentioned before? --Joy (talk) 13:34, 18 December 2025 (UTC)
- I don't understand why this is a problem?
- {{Infobox military memorial}} sets
|mapframe-marker=monument, so it's always going to show a monument marker (if either local coordinates or Wikidata coordinates are provided) - If
|mapframe-wikidata=is not set, then it will display a polygon or line under the cases "no local coordinates given" or "Wikidata provides geodata". Both of those booleans are true, so it draws a shape.
- {{Infobox military memorial}} sets
- Everything is working as intended. What would you propose doing differently? Remember we need to stay close to Evad37's original design, because the module is used on more than 1 million pages. — hike395 (talk) 14:17, 18 December 2025 (UTC)
- I personally think that's fine, but in the meantime another editor complained that it's too obfuscated for editors that way - in the article, there's no mention of either coordinates or mapframe in the source, yet they appears, sort of automagically, and they then don't know what to do with it until they re-read the documentation (either in the infobox template or in the visual editor).
- I can't really tell what's @Evad37's original design here. I went back to re-read their RFC Wikipedia:Requests for comment/Mapframe maps in infoboxes and the outcome is actually fairly ambiguous in this regard - Q2 didn't get consensus at the time, while Q4 did, yet Q4 can actually be seen as logically dependent on Q2.
- I guess I'll have to go draft a new RFC to try to arrive at a new, hopefully clearer consensus. --Joy (talk) 14:47, 18 December 2025 (UTC)
- {{Infobox military memorial}} could show Wikidata coordinates with that little pencil added whenever the coordinates are not supplied locally. It'd be more clear where the map magic comes from. I think (some) people need to get used to things like this. To me, most of these maps are "the sky is blue". It'd take a lot of "assume bad faith" for me to think otherwise. Ponor (talk) 15:11, 18 December 2025 (UTC)
- @Joy: where is the discussion you've mentioned (above)? — hike395 (talk) 16:02, 18 December 2025 (UTC)
- I couldn't seem to find it... I think it included @Zackmann08. It was about dropping the complexity of handling both foo and mapframe-foo arguments. --Joy (talk) 18:47, 18 December 2025 (UTC)
- Sorry haven't been following this one... To many balls in the air right now. Decided to abstain from this particular discussion so I'm no help here. Sorry! Zackmann (Talk to me/What I been doing) 18:50, 18 December 2025 (UTC)
- I couldn't seem to find it... I think it included @Zackmann08. It was about dropping the complexity of handling both foo and mapframe-foo arguments. --Joy (talk) 18:47, 18 December 2025 (UTC)
- Hmm, yes, makes sense that the new default auto caption function should add a note about how the current map logic worked out in each case. I don't know if we can use {{efn}} to be extra clear, does a default {{notelist}} render at the bottom just like the default {{reflist}}? --Joy (talk) 18:50, 18 December 2025 (UTC)
- Yes, but they are all numbered, even if the note was produced by something specifying a letter identifier, such as
{{efn}}. --Redrose64 🌹 (talk) 18:03, 21 December 2025 (UTC)- I tried to test this, but without a notelist present, it didn't show up at all in Template:Infobox mapframe/testcases#With caption.
- Another thing that might be possible could be to render the note in a mouseover text, like {{circa}} or {{lit}} are. --Joy (talk) 17:39, 4 January 2026 (UTC)
- Yes, but they are all numbered, even if the note was produced by something specifying a letter identifier, such as
- @Joy: where is the discussion you've mentioned (above)? — hike395 (talk) 16:02, 18 December 2025 (UTC)
- {{Infobox military memorial}} could show Wikidata coordinates with that little pencil added whenever the coordinates are not supplied locally. It'd be more clear where the map magic comes from. I think (some) people need to get used to things like this. To me, most of these maps are "the sky is blue". It'd take a lot of "assume bad faith" for me to think otherwise. Ponor (talk) 15:11, 18 December 2025 (UTC)
- I don't understand why this is a problem?
Thumbnail bug when using geomask.
[edit]Using a geomask causes an incorrect static thumbnail image to be displayed as for example the "Geomask examples" section in the documentation. Is someone working on this problem and how can I sign up to be notified when it is fixed? Zoocat56 (talk) 20:30, 6 January 2026 (UTC)
- See T305121 and mw:Help_talk:Extension:Kartographer/2024#Thumbmail maps with geomasks for a basic reason as to why. Regs, The Equalizer (talk) 21:00, 6 January 2026 (UTC)
- Thanks for the info from which I take away that for this template if you set
geomask, then to avoid the bug you need to also setzoomandframe-coordinates. Zoocat56 (talk) 21:50, 8 January 2026 (UTC) - Do you know if there's a way to set the frame-coordinates automatically from wikidata? otherwise it's still not convenient to use on a template
- thanks, JSeke (talk) 04:00, 12 January 2026 (UTC)
- Thanks for the info from which I take away that for this template if you set
This template/module may not be following the Wikidata infobox RFC
[edit]Please see this discussion, where I observed a case in which this template/module appeared to be failing to follow the Wikidata infobox RFC's requirement that only sourced data be imported into infoboxes. – Jonesey95 (talk) 17:58, 27 January 2026 (UTC)