Jump to content

Template talk:Infobox mapframe

From Calamity Wiki

Template:Permanently protected Template:Talkheader

Template:Faq

Template:Archives

mapframe-wikidata implicitly on, instead of off?

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
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)

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 (P402) nor (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 (P402) nor (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.
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)
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)
BTW, I just found meta:Community Wishlist/W419 Improve license compliance and attribution of embedded maps. That goes hand in hand with this issue. --Joy (talk) 13:55, 6 February 2026 (UTC)

"mapframe-custom" parameter

How is |mapframe-custom= intended to work? I can't get it to display anything even when following the instructions at Template:Infobox mapframe/doc/parameters and setting |mapframe=yes. I've tried giving |mapframe-custom= a template that uses < mapframe >, using < mapframe > code directly, providing an image, and just putting some random text in just to see if it displays. Every time, it's just blank. There's not even an empty frame; it just generates nothing. Does another parameter have to be set for it to display a custom mapframe? – Scyrme (talk) 14:08, 19 April 2026 (UTC)

@Scyrme: can you link to a diff where you have tried or setup a case in your sandbox? Happy to help you try to make it work... Zackmann (Talk to me/What I been doing) 16:38, 19 April 2026 (UTC)
Added examples below inside the collapsible box below. If you edit the source you can see what I attempted. I'm probably missing something obvious. – Scyrme (talk) 17:15, 19 April 2026 (UTC)
{{Infobox mapframe}} is ment to be used within an Infobox so your above examples really don't work. Can you show an actual article where you are trying to do this? --Zackmann (Talk to me/What I been doing) 20:26, 19 April 2026 (UTC)
Yes, I know that, but the examples shown in the documentation show {{Infobox mapframe}} can at least generate maps outside that context. The template doesn't need to be nested inside an infobox to function. Unhelpfully, none of the examples demonstrate the use of |mapframe-custom=.
Regardless, when I tried these in the context of {{Infobox military conflict}} I had the same result. These attempts were prompted by me investigating if it were possible to use |mapframe-custom= to hold {{2026 Iran war map}} (which uses mapframe code to generate a map), so that the |image= parameter of {{Infobox military conflict}} as used by {{2026 Iran war infobox}} could be freed up for something else as this was requested on the Talk page. I don't have diffs to link to; I experimented in an editing preview and didn't publish the experiments. You can paste |mapframe=yes and any one these examples of |mapframe-custom= into {{2026 Iran war infobox/sandbox}} and confirm it produces nothing. – Scyrme (talk) 20:38, 19 April 2026 (UTC)
@Zackmann08: No ideas on how to get |mapframe-custom= working? – Scyrme (talk) 06:50, 23 April 2026 (UTC)
As @Zackmann08 says custom needs to work on a template that accepts the parameter, mapframe isn't one of those. Custom works as intended with the military conflict template. I updated one of your examples above to demonstrate. It works fine on the war template sandbox page too. Regs, The Equalizer (talk) 23:37, 23 April 2026 (UTC)
Thank-you! It appears it displays only when coordinates are provided, even if those coordinates aren't used (for the mapframe; they're still displayed). – Scyrme (talk) 10:49, 24 April 2026 (UTC)
It appears it also doesn't work when invoking a module to generate the infobox (#invoke:Infobox military conflict|main), which means it doesn't work with {{2026 Iran war infobox}}.
@The Equalizer: Any idea on why this is and if there's a way around it? – Scyrme (talk) 11:12, 24 April 2026 (UTC)
I made an edit in {{2026 Iran war infobox/sandbox}}. I can then use {{2026 Iran war infobox/sandbox}}. The infobox is pulled in, the image is maintained with the map at the end. Is this what you are expecting. The Equalizer (talk) 18:08, 24 April 2026 (UTC)
That version of the sandbox is outdated and uses {{Infobox military conflict}} rather than invoking Module:Infobox military conflict using #invoke:Infobox military conflict|main. The live templates invokes the module to reduce its post-expand exclusion size as the main article, 2026 Iran war, is close to the limit. If you copy in the source from the live version into the sandbox and try the change you made it doesn't seem to work. – Scyrme (talk) 18:16, 24 April 2026 (UTC)
Gotcha. The implementation of mapframe with military conflict is through the template, not directly coded to the module. I have however repurposed one of the sandbox module fields to produce the expected output - can you check the page sizing again. Regs, The Equalizer (talk) 19:11, 24 April 2026 (UTC)
Good idea, thanks! – Scyrme (talk) 16:23, 25 April 2026 (UTC)
@Scyrme While the layout I recommended with moving the map and freeing up the image parameter is good, I did a mock up of the page using it but found it has hardly improved the page size. The infobox only uses some 200kb+ so it's overwhelmingly down to the article content which is simply too much and probably has multiple template transclusions going on (probably the sheer number of refs). Other than breaking out sections or really getting granular with the templates, I think there is little that can be done with the infobox to help it. Regs, The Equalizer (talk) 02:20, 26 April 2026 (UTC)

ALT?

How do I generate the ALT text for a mapframe? I'm working on the infobox in Big Duck. RoySmith (talk) 11:55, 20 April 2026 (UTC)

There is no mouse over text function for mapframes in the way there is for static images and WP:MOSALT. Regs, The Equalizer (talk) 07:38, 23 April 2026 (UTC)
Surely the caption provides the desired function? 𝕁𝕄𝔽 (talk) 13:12, 23 April 2026 (UTC)
Yeah, probably. Just exploring the possibilities. RoySmith (talk) 13:26, 23 April 2026 (UTC)