Template talk:Infobox mapframe
Template:Infobox mapframe is permanently protected from editing because 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: 1Auto-archiving period: 12 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 |
---|
|
|
This page has archives. Sections older than 365 days may be automatically archived by Lowercase sigmabot III when more than 5 sections are present. |
Setting mapframe-shape to inverse causes weird problem
[edit]It works properly in preview while editing source but shows straight line in middle of nowhere after publishing. But when clicked on that straight line and going to full screen it shows properly.
Rahilarious (talk) 14:34, 28 July 2023 (UTC)
- Can't really help on the fix of this mapframe element, but there is a workaround
{{Maplink|frame=yes|plain=y|frame-width=270|frame-height=200|frame-align=center|stroke-width=2|zoom=15|type=shape-inverse|fill=#808080|title=LawGarden|id=Q6503350|fill-opacity=0.4|type2=point|id2=Q6503350}}
The Equalizer (talk) 13:19, 7 August 2023 (UTC)- Exactly what I experienced. The backend, maplink works fine but problem occurs when using frontend, mapframe. That's why reporting here. Lot of templates use mapframe just because it is easier, using this workaround means more work for editor.
- Maybe this is the wrong place to report a bug. But I don't know where else to report it. Rahilarious (talk) 17:13, 7 August 2023 (UTC)
- Mentioning it here is correct, it's just a little quiet. Looking at Template:Infobox mapframe/testcases, some of the control examples show the same issue. It ideally wants reporting on Phabricator, see the FAO at the top of this page for how to do this. As said use the code above as a substitute and replace once fixed, it's not likely to be edited too much. The Equalizer (talk) 20:38, 7 August 2023 (UTC)
- This bug is very important. Please do something to solve the problem, more quickly. Thanks, Hooman Mallahzadeh (talk) 13:07, 8 January 2024 (UTC)
- Mentioning it here is correct, it's just a little quiet. Looking at Template:Infobox mapframe/testcases, some of the control examples show the same issue. It ideally wants reporting on Phabricator, see the FAO at the top of this page for how to do this. As said use the code above as a substitute and replace once fixed, it's not likely to be edited too much. The Equalizer (talk) 20:38, 7 August 2023 (UTC)
Does autocaption work?
[edit]Does autocaption
display a caption anywhere? I am looking at {{Infobox waterfall}} at American Falls, for example, and I do not see a caption under the mapframe map. If someone can provide a link to a working example, that would be helpful. – Jonesey95 (talk) 18:13, 4 December 2023 (UTC)
- Is this what you are looking for? Pantheon, Rome
- Which uses
{{Template:Infobox ancient site}}
- Also see https://wiki.riteme.site/wiki/Wikipedia_talk:Mapframe_maps_in_infoboxes, Evad37 set these up if any questions.
- Regards, The Equalizer (talk) 00:07, 6 December 2023 (UTC)
- So it looks like "autocaption" just allows for the use of
|mapframe-caption=
. I had the impression that the "auto" portion of the option implied that a caption would be displayed automatically. I guess not? Thanks for the links. – Jonesey95 (talk) 16:26, 7 December 2023 (UTC)- The 'auto' as I understand it refers to 'Automatic maps in infoboxes'. The 'auto' caption parameter is referred to and passed through separately as the
{{Infobox mapframe}}
template does not have the capability natively (although the related{{Maplink}}
/mapframe modules do and display 'Map' as a default caption). The Equalizer (talk) 21:53, 7 December 2023 (UTC)
- The 'auto' as I understand it refers to 'Automatic maps in infoboxes'. The 'auto' caption parameter is referred to and passed through separately as the
- So it looks like "autocaption" just allows for the use of
Auto-setting of zoom argument
[edit]Hi, is there any way to auto-zoom a map of openstreetmap by comparing that to the area of target object? This way, we do not need to insert "zoom vlaue" in each instance of this template, i.e., it is set automatically by area of target object. Thanks, Hooman Mallahzadeh (talk) 11:56, 27 December 2023 (UTC)
- Use area_km2= or area_mi2=, but a parameter and value is still being provided and the resulting zoom might not be ideal. Regs, The Equalizer (talk) 12:44, 27 December 2023 (UTC)
Marker overlaps the title of cities
[edit]Hi, in these Infobox maps, "frame marker" overlaps "the text of city name", so the city name is not readable.
- https://fa.wikipedia.org/wiki/%D8%A7%D8%B1%D8%AF%DA%A9%D8%A7%D9%86_(%D8%B3%D9%BE%DB%8C%D8%AF%D8%A7%D9%86)
- https://fa.wikipedia.org/wiki/%D8%B1%D8%A7%D9%85%D8%B3%D8%B1
- https://fa.wikipedia.org/wiki/%D8%A8%D9%86%D8%AF%D8%B1_%D9%84%D9%86%DA%AF%D9%87
- https://fa.wikipedia.org/wiki/%DA%A9%D8%A7%D8%B2%D8%B1%D9%88%D9%86
And many other co-occurrences of markers and city names. Is there any way to separate "frame marker" from "city name" so that city name becomes appeared in such maps. Thanks, Hooman Mallahzadeh (talk) 13:23, 9 January 2024 (UTC)
A bug with none marker
[edit]The argument |point=none
does not work and causes a wrong map.
Is there any other way to remove marker from map? Thanks, Hooman Mallahzadeh (talk) 06:45, 13 January 2024 (UTC)
- For the first one use instead:
| image_map1 = {{Infobox mapframe |point = none|zoom=14 |frame-height=300 |frame-coord={{WikidataCoord|display=i}}}}
- Then adjust accordingly for the others.
- Regs, The Equalizer (talk) 12:12, 13 January 2024 (UTC)
A new parameter for "shape-out-fill-opacity"
[edit]Hi, for example in Shiraz article, we have the parameter "shape-fill-opacity" what shades the city. My question is that is there exist any way for shading outside of a city? One solution is using |shape=inverse
, but this solution is not good, because the shape is the same but we want to shade outside of city.
So the same as "shape-fill-opacity" parameter, I propose to create a new parameter for "shape-out-fill-opacity". This way, we have a tool to not shade the city itself but shade outside of that city. Thanks, Hooman Mallahzadeh (talk) 08:38, 26 January 2024 (UTC)
- If you use infobox mapframe you have options to change the inner and outer shading:
| image_map1 = {{infobox mapframe|id=Q6397066|zoom=9|frame-width=250|frame-lat=29.6666|frame-long=52.4999|shape-fill=#ff0000|geomask=Q6397066|title=City map interactive|geomask-fill=#4800FF|geomask-fill-opacity=0.8|point=on|stroke-width=3|stroke-color=#1e7e7e|title2=zones|marker=city}}
- Regards, The Equalizer (talk) 11:52, 26 January 2024 (UTC)
No access to wikidata?
[edit]Is it possible to use this template on a MediaWiki install with no access to wikidata? I attempted to do it by specifying coordinates in the coord parameter but I still get Lua error in Module:Infobox_mapframe at line 185: attempt to index field ‘wikibase’ (a nil value). Redheadkelly (talk) 07:29, 17 February 2024 (UTC)
- You may have an extension missing:
- https://www.mediawiki.org/wiki/Extension:Wikibase_Client The Equalizer (talk) 12:11, 17 February 2024 (UTC)
- Thanks for your reply. I've been busy with other things. I think this extension is to add Wikibase to my install of Mediawiki, which I do not want to do. I'm using Semantic MediaWiki. But I do copy templates & modules from Wikipedia and many of them contain code that queries Wikibase. Sometimes it's easy to rewrite them so that it's not an issue, but sometimes it's not. If this extension gives me the ability to contact the same Wikibase that Wikipedia is using, that's great. But I do see that it does that. Do I have this right? Redheadkelly (talk) 20:58, 14 May 2024 (UTC)
A bug with Zoom parameter
[edit]Hi, If we add zoom parameter to this code
{{Infobox mapframe |shape-fill-opacity=.5|wikidata=yes|id=Q134228|geomask=Q794|frame-height=300 | stroke-width=1 |coord={{Coord|34|S|54E}} |point = none|shape-fill=#ff0000}}
rendered as:
which yields:
{{Infobox mapframe |shape-fill-opacity=.5|wikidata=yes|id=Q134228|geomask=Q794|frame-height=300 | stroke-width=1 |coord={{Coord|34|S|54E}} |point = none|shape-fill=#ff0000|zoom=4}}
rendered as:
The location of map is lost. This bug is only happens when we publish codes and in the preview case it is healthy. Please resolve this bug. Thanks, Hooman Mallahzadeh (talk) 12:41, 25 February 2024 (UTC)
- For one thing, the template {{Coord|34|S|54E}} is malformatted, and I think you want north latitude rather than south. It should be {{Coord|34|N|54|E}}. I've made those changes in your sandbox, but it's still not displaying correctly (though it looks OK in preview). Someone else will have to advise you further. Deor (talk) 14:35, 25 February 2024 (UTC)
- @Deor I found the solution myself. With parameters |frame-lat=29.67|frame-long=52.52, the problem is resolved.
- it is rendered as:
- Correctly. It works well, but it is better to resolve this bug fundamentally. Hooman Mallahzadeh (talk) 14:41, 25 February 2024 (UTC)
- Use |frame-coord= instead as frame-lat/long are deprecated ):
{{Infobox mapframe |shape-fill-opacity=.5|wikidata=yes|id=Q134228|geomask=Q794|frame-height=300 | stroke-width=1 |frame-coord={{Coord|34|N|54|E}} |point = none|shape-fill=#ff0000|zoom=4}}
- The Equalizer (talk) 14:44, 25 February 2024 (UTC)
- @The Equalizer Thanks a lot, it works well. But please try to resolve the bug at base. Hooman Mallahzadeh (talk) 14:46, 25 February 2024 (UTC)
- It was already reported at phab:T305121 so I've added a note. The Equalizer (talk) 15:14, 25 February 2024 (UTC)
- @The Equalizer Thanks a lot, it works well. But please try to resolve the bug at base. Hooman Mallahzadeh (talk) 14:46, 25 February 2024 (UTC)
How to remove sea lands from a map
[edit]Hi, how we can remove sea lands from this map
to only include mainland and exclude sea lands from it? Finally should yield something like this:
Thanks, Hooman Mallahzadeh (talk) 16:25, 16 March 2024 (UTC)
- Only by creation of a new province shape to either:
- OSM (through a brand new shape upload or removal of the island then create a new relation), either would need a new Wikidata entry;
- or as a Commons map file. The Equalizer (talk) 20:47, 16 March 2024 (UTC)
- Can also use inline article Wiki markup code to draw an approximate area. The Equalizer (talk) 20:52, 16 March 2024 (UTC)
How to correct the map of Moscow
[edit]Hi, can any one correct this map by changing OpenMapStreet data? Thanks, Hooman Mallahzadeh (talk) 15:35, 18 March 2024 (UTC)
- Seems the post-2012 boundary is overlain by the old. Give it a few hours. The Equalizer (talk) 17:25, 18 March 2024 (UTC)
Providing coordinates in the article's infobox appears to hide the geomask
[edit]It appears that providing coordinates in the article hides the geomask, even though no geomask parameter was provided. See this version of Scottish Parliament Building (coordinates provided using {{Wikidatacoord}}, no geomask showing) compared to this version (coordinates pulled from Wikidata by the infobox, geomask showing). Is there anyone here who can troubleshoot this? Is {{infobox building}} calling {{infobox mapframe}} incorrectly? – Jonesey95 (talk) 21:42, 1 July 2024 (UTC)
- Hi, you have to set
| mapframe-wikidata = yes
as well when coord is used, as per Template:Infobox building#Mapframe maps. Regs, The Equalizer (talk) 22:58, 1 July 2024 (UTC)- Brilliant. That fixed it. Thanks. – Jonesey95 (talk) 23:27, 1 July 2024 (UTC)
Does mapframe-caption work?
[edit]I tried adding a caption using |mapframe-caption=
but nothing shows up. Volcanoguy 17:31, 12 July 2024 (UTC)
- That doesn't work unless the template is integrated into a parent infobox.
- For now either put some text directly after the template code (which can look a little untidy) or use
{{mapframe}}
instead. The Equalizer (talk) 07:36, 14 July 2024 (UTC)- @The Equalizer: Actually I was using this template in {{infobox mountain}} while trying to use the caption parameter. I tried adding text directly after the template code and it worked, thanks. Volcanoguy 17:31, 14 July 2024 (UTC)
- You are using the embedded parameter in the mountain template to add the mapframe, but it is a bit of a hack to directly add a caption like that. A full integration which creates an automatic map and allows the caption parameter would need the mountain template editing by a template editor - the full way to do this is described here: Module:Infobox mapframe. Regards, The Equalizer (talk) 22:46, 14 July 2024 (UTC)
- @The Equalizer: Actually I was using this template in {{infobox mountain}} while trying to use the caption parameter. I tried adding text directly after the template code and it worked, thanks. Volcanoguy 17:31, 14 July 2024 (UTC)
New bug for masking in preview and full screen modes
[edit]Hi, masking does not work for this code map:
{{Infobox mapframe |shape-fill-opacity=.5|wikidata=yes |zoom=4|frame-height=230 | stroke-width=1 |coord={{WikidataCoord|display=i}}|point = none|shape-fill=#ff0000|geomask=Q794|frame-lat=32|frame-long=54|id =Q132945}}
rendered as:
Iran's map must have been white, but is not in preview mode and after clicking full screen mode. Hooman Mallahzadeh (talk) 15:34, 14 July 2024 (UTC)
Looks fine to me. If I change the mask to Afghanistan (Q889), the white area shows there correctly at preview:
{{Infobox mapframe |shape-fill-opacity=.5|wikidata=yes |zoom=4|frame-height=230 | stroke-width=1 |coord={{WikidataCoord|display=i}}|point = none|shape-fill=#ff0000|geomask=Q889|frame-lat=32|frame-long=54}}
Regards, The Equalizer (talk) 17:11, 14 July 2024 (UTC)
- @The Equalizer It was a temporary bug, and it is now fixed. Thanks. Hooman Mallahzadeh (talk) 04:39, 15 July 2024 (UTC)
Template:Infobox mapframe/doc/templatedata
[edit]Can someone familiar with this template, take a look at Template:Infobox mapframe/doc/templatedata and Template:Infobox mapframe/doc#TemplateData and see if anything from the /templatedata sub-page is still up to date (and if so, copy it to the /doc page)? Gonnym (talk) 11:30, 26 July 2024 (UTC)
implementation issue with infobox mountain
[edit]Please see Template talk:Infobox mountain#mapframe implementation. --Joy (talk) 04:14, 1 October 2024 (UTC)
- Fixed. – Jonesey95 (talk) 18:44, 1 October 2024 (UTC)
- @Jonesey95 thanks!
- For anyone else reading, there's a followup there still about how to format the default zoom, and some Lua error. --Joy (talk) 08:30, 2 October 2024 (UTC)
Use Infobox dim to compute zoom?
[edit]In the sandbox, I changed Module:Infobox mapframe/sandbox at line 216 so that it calls _zoom from Module:Infobox dim to compute the zoom level from an object size. By default, they produce almost the same results (difference in pre-rounded zoom level of about .07, due to slightly different assumptions). The benefit of using Infobox dim._zoom is that it uses the size of the mapframe to compute the zoom. Infobox dim._zoom selects the zoom level so that the object lies fully within the map. If the frame is larger (in pixels), then a higher zoom level is selected.
Any comments or questions about this? — hike395 (talk) 17:54, 7 October 2024 (UTC)
- Implemented —- now in main. Please let me know if you see any problems. — hike395 (talk) 18:31, 16 October 2024 (UTC)
zoom levels for rivers
[edit]Often times the passing of dimensions into the template is beneficial, but I've seen some cases where it's actually worse than the default, like Colbert River, which is zoomed in too much based on dimensions. --Joy (talk) 15:08, 12 November 2024 (UTC)
- Not scientific, but measuring the length of the river as the crow flies using two freely map sources gives a length of at least 15km between source and mouth not even taking into account the meanders, so why 12.6 is stated I don't know, it needs challenging and a citation. Adding that adjusted length into the infobox sets the map to an expected zoom showing the full length of the course. Regs, The Equalizer (talk) 23:26, 12 November 2024 (UTC)
- Makes sense, added a cleanup tag. --Joy (talk) 11:29, 13 November 2024 (UTC)
I had another odd case, Guaviare River was zoomed out by default so you could see half the continent. Is it because of all the meandering? --Joy (talk) 19:12, 29 November 2024 (UTC)
- Similar for Guayamouc River. --Joy (talk) 19:17, 29 November 2024 (UTC)
showing two extra relations in addition to the wikidata-attached main one
[edit]At Talk:Indus River#map frame map, @Fowler&fowler has noticed that the OSM relation for that river does not choose either of the two main headstreams, and therefore our mapframe map shows neither. Is there a syntax to add two more relations to an infobox mapframe map?
Would we be able to e.g. supply a list of two more wikidata Q* items as geomask, or something like that? The geomask example shows a shape that that envelops another shape and there's a shading, which wouldn't seem appropriate in the case of lines, so I'm not sure what to do. --Joy (talk) 23:25, 27 November 2024 (UTC)
- Replied over there explaining the options available. Regs, The Equalizer (talk) 01:23, 29 November 2024 (UTC)
- Thanks. I wasn't aware of this, and I went to check the documentation, but couldn't find anything about it. The template doc still says:
This template only works with single features (points, lines, or shapes); use {{maplink}} if more advanced options, such as displaying multiple features, are required.
- so that seems quite misleading... - Yet the argNumber handling in the module seems to have existed since 2019...? --Joy (talk) 15:45, 29 November 2024 (UTC)
- Thanks. I wasn't aware of this, and I went to check the documentation, but couldn't find anything about it. The template doc still says: