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: 30 days |
| 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 |
|---|
"mapframe-custom" parameter
[edit]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)
Examples
| ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||
- {{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=yesand 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)
- Good idea, thanks! – Scyrme (talk) 16:23, 25 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)
- That version of the sandbox is outdated and uses {{Infobox military conflict}} rather than invoking Module:Infobox military conflict using
- I made an edit in
- 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)
- @Zackmann08: No ideas on how to get
- 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
- {{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)
ALT?
[edit]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)
a case of being zoomed in too much by default
[edit]In the last few weeks I seem to have observed a few cases of excessive zoom that I couldn't easily explain. For example, Orehovica, Međimurje County has an insane zoom, despite having a specified area of 21.6 km2 and population 2,720. What could be causing that? --Joy (talk) 09:55, 7 May 2026 (UTC)
- Okučani is also zoomed in to 20m despite area 159.6 km2 and population 2,323. In that case, I checked Wikidata and the relation ID [1] is linked, which renders a boundary shape on OSM, but that doesn't have a backlink to Wikidata. I'll see if adding it fixes it. --Joy (talk) 13:57, 8 May 2026 (UTC)
- The P402 parameter tells mapframe to expect a polygon but unless the Wikidata linking is from the OSM end it causes this extreme zoom in. It was a manual add but unsure if the editor knows this. I updated OSM for Orehovica. Regs, The Equalizer (talk) 17:52, 10 May 2026 (UTC)
- This didn't used to happen, we should change the logic, because chasing down every one of those pairs is going to be near impossible, we don't have the tools for that. --Joy (talk) 18:35, 10 May 2026 (UTC)
- There are DB queries that can be done at both WD for P402, and at OSM for the WD tag, then compare for missing entries.
- The problem of course with P402 is that it doesn't truly validate a shape is available to Wiki. If a WD number is added to a OSM way or polygon the daily diffs pull to Wikimaps track those and a bot/WD admin adds the P402 entry. However, if a manual P402 entry is made in WD it has to be also done by the editor at OSM, those bots/admins are not syncing up OSM and I think this is when these misses occur. The same editor manually added both your example Croat communities in both WD and OSM, clearly WD has to be created first and it appears they forgot to add the number to OSM on some.
- Maybe the focus should be on coordinates than polygon since not every place is incorporated/bounded. Also, the issue is mitigated by adding
mapframe-wikidata = nowhich seems to set it mostly to zoom level 11 and confirms a WD entry is influencing the view. Regs, The Equalizer (talk) 00:27, 11 May 2026 (UTC)- Yes, but that's what I'm saying - if we don't actually have a database report available for triage, if it's just in the realm of possibility as opposed to actionable, then we're putting the cart before the horse, so we should probably not do that.
- I'm not sure where the actual failure happens, though. https://en.wikipedia.org/wiki/Module:Infobox_mapframe#L-229 says we try to get d:Property:P6592, but there is no such property at d:Q73123 already, yet we didn't seem to follow the logic of Module:Infobox dim there (otherwise surely it would have seen the population and area data). --Joy (talk) 07:49, 11 May 2026 (UTC)
- This didn't used to happen, we should change the logic, because chasing down every one of those pairs is going to be near impossible, we don't have the tools for that. --Joy (talk) 18:35, 10 May 2026 (UTC)
- The P402 parameter tells mapframe to expect a polygon but unless the Wikidata linking is from the OSM end it causes this extreme zoom in. It was a manual add but unsure if the editor knows this. I updated OSM for Orehovica. Regs, The Equalizer (talk) 17:52, 10 May 2026 (UTC)
