![]() | 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. |
|
![]() | 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 |
---|
Please adjust this template to use |coordinates=
instead of individual latitude and longitude parameters, per this RFC. See also Wikipedia:Coordinates in infoboxes. – Jonesey95 (talk) 12:53, 1 January 2019 (UTC)
|frame-coordinates=
, for consistency with frame parameters using the frame- prefix). - Evad37 [talk] 13:24, 1 January 2019 (UTC)
If frame latitude and longitude are not set by parameters, then coordinates in |coord= will be used (if set), or coordinates will be retrieved from Wikidata (if available, for either the item specified in |id= parameter or for the page the template is placed on). Module:Mapframe already takes the parameter
|coord=
. It looks like coordinates are already supported by the upstream templates. – Jonesey95 (talk) 14:13, 1 January 2019 (UTC)
|coord=
parameter is for adding a point feature to be shown on the map, and so won't work here where we just want to adjust the initial placement of the map (not add another point). - Evad37 [talk] 14:41, 1 January 2019 (UTC)
If frame latitude and longitude are not set by parameters, then coordinates in |coord= will be used (if set)? That looks pretty clear to me. Perhaps that documentation is not quite correct. – Jonesey95 (talk) 14:47, 1 January 2019 (UTC)
|coord=
is to add a point feature to the map. Frame coordinates can be automatically determined from that point, but if a user wants a different, custom frame coordinates (WITHOUT adding a new point feature), they have to be specified in |frame-lat=
or |frame-long=
, or now |frame-coord=
since I've updated Module:Mapframe (or aliases of these parameters). - Evad37 [talk] 15:34, 1 January 2019 (UTC)|coordinates=
. – Jonesey95 (talk) 14:30, 1 January 2019 (UTC)
<mapframe>
maps seems like it would reduce confusion – i.e. wouldn't a user expect that a plain |coordinates=
parameter to be for the point displayed on the map (as in other infobox coordinate templates), rather than where the map centre point is located? - Evad37 [talk] 15:04, 1 January 2019 (UTC)
Here are some examples (you can move them to another page if you want).
For a standard location map, the coords passed in define the marker shown on the map, e.g.
((Location map|Australia Melbourne |coordinates=((coord|37|48|38.5|S|144|57|56.5|E)) ))
For ((infobox mapframe)), the coords passed in are for the centre point of the map frame, and the coords for the marker (37°48'38.5"S, 144°57'56.5"E) come from Wikidata
((infobox mapframe|id=Q7270550|frame-coord=((Coord|38|0|S|144|52|E))|zoom=8))
For a ((maplink)) map, you get to define both the coords for both the marker and the (initial) centre point of the map frame, e.g.
((maplink|frame=yes|plain=yes|type=point|coord=((coord|37|48|38.5|S|144|57|56.5|E))|frame-coord=((Coord|38|0|S|144|52|E))|zoom=8))
For both ((maplink)) and ((infobox mapframe)), if you don't specify coordinates for the frame, then the centre point of the map frame will be determined automatically:
((maplink|frame=yes|plain=yes|type=point|coord=((coord|37|48|38.5|S|144|57|56.5|E))|zoom=8)) ((infobox mapframe|id=Q7270550|zoom=8))
- Evad37 [talk] 17:56, 1 January 2019 (UTC)
|coordinates=
/|coord=
should not be used for the alignment or display of the frame, which is probably what you have been trying to tell me. I think |frame-coordinates=
should be used for alignment/display, and I think it would be good to deprecate and remove frame-lat/frame-long. If it is ever supported, |coordinates=
should be used to override the wikidata values for the latitude and longitude of the point being displayed.Is there a parameter that allows us to disable the display of the OSM relation borders even though the said relation ID is saved in the Wikidata item? This will allow us to avoid displaying inaccurate/erroneous relation borders. —Sanglahi86 (talk) 06:34, 4 February 2019 (UTC)
OSM relation ID
statement, but strangely shows a large border covering the entire Cebu province:
I do not know which is causing it, but later discovered that the borders of the Cebu City relation in OSM should be for (and is currently a duplicate of) Cebu province. I am not familiar with the intricacies of OSM relations, and I might break something if I merely delete the Cebu City relation. Could you kindly look into this? Thanks. —Sanglahi86 (talk) 23:05, 4 February 2019 (UTC)
Hello. I've added mapframe to ((Infobox power station)), but one of our WikiProject members has raised a valid point. I want to know if it is possible to set the zoom level to country-level (maybe based on P17 or a local parameter, or both), instead of a static number which its usefulness varies greatly depending on which country the article/item relates to.
Also, in addition to the above, another concern is that the mapframe does not clearly distinguish countries for more zoomed out items, as opposed to the older static location maps which show neighbouring countries in a slightly different shade (example). Is it possible to create an option where the mapframe could either change shade or show a border (for the country of subject, not subject itself)? — Preceding unsigned comment added by Rehman (talk • contribs) 08:27, 20 March 2019 (UTC)
|location_map_zoom=
insufficient for the zoom level? I don't think it would be possible to set "country" level automatically without new Lua code, as well as special handling for exclaves like French Guiana and former countries. (Most other infoboxes with mapframes also use default zoom levels around 13 or 14, whereas ((Infobox power station)) uses a default of 5.)location_map_zoom
is definitely useful when we need to set the zoom of a particular article. The default zoom is set per the consensus of WikiProject Energy, and hence of course can be changed as needed. As per the concern raised (which I linked above), two reasons for not using mapframe are:
|geomask=
to specify a wikidata item directly (i.e. a Q-number), or via a property (i.e. a P-number, like P17
for country – this requires the wikidata item for the page to actually have that property specified, but P17 is already very widely used in my experience). Frame coordinates are determined automatically (unless specified by parameter). Zoom level will be determined automatically if the geomask item has an area (P2046) specified (in square kilometers or square miles). - Evad37 [talk] 14:12, 21 March 2019 (UTC)
((Infobox power station/sandbox))
). Your views for/against the below points are welcome:
geomask=
work with zoom
? It seems like the geomask gets disabled when a manual zoom is stated.Thanks for the feedback Rehman.
|geomask-stroke-width=
and |geomask-stroke-color=
(or |geomask-stroke-colour=
) can also be used to override the default values.|geomask=
to that item instead of P17.- Evad37 [talk] 00:46, 23 March 2019 (UTC)
Sorry - I'm too stupid to get this to work on Nostrana (restaurant), which now has a coord. Would someone please make it so, so that I can see what I'm missing. thx. --Tagishsimon (talk) 10:58, 5 April 2019 (UTC)
Please help, to get the region boundary displayed. Arjunaraoc (talk) 12:20, 27 April 2019 (UTC)
Since this module is used in Infobox settlement, which is one of the most widely used templates and which has a default width of 250px, this template should also have a default width of 250px (instead of 270px). Can someone make this change please? Thanks. -- P 1 9 9 ✉ 00:58, 4 May 2019 (UTC)
Arjunaraoc (talk) 02:56, 13 June 2019 (UTC)
Template:Infobox mapframe/doc currently says that an OpenStreetMap relation ID (P402) needs to be specified on Wikidata in order for an outline of a feature to be displayed, as opposed to just a marker for a coordinate location. From what I can tell, however, Wikidata items need to be linked from their corresponding OpenStreetMap pages to generate an outline, not the other way around. Plenty of items I've come across—such as Northgate Park (Q65554696)—are able to generate outline maps without an OSM relation ID. Is the documentation outdated or am I just missing something? – Lord Bolingbroke (talk) 16:25, 31 July 2019 (UTC)
Hello. I'm trying to use mapframe in an infobox, to highlight entire rivers.
But previewing the sandbox on the article does not show anything. What am I missing? Thanks for any help, Rehman 11:05, 9 March 2020 (UTC)
Somehow the outline is not shown on the dynamic map in the article for Saloma Link bridge. I added the Wikidata tags in OSM. Used to work in other instances without a problem, e.g. for the Bicycle Snake. Any ideas what went wrong? Thanks!--Renek78 (talk) 02:18, 15 March 2020 (UTC)
You are invited to join the discussion at Wikipedia:Requests for comment/Mapframe maps in infoboxes. Evad37 [talk] 03:25, 24 June 2020 (UTC)
@Evad37 and Jonesey95: if you check this version of St. Paul Union Pacific Vertical-lift Rail Bridge you will see a Failed to serialize data. error. I was able to trace this to |id=L332
in the infobox, which is the bridge id, not the qid. as a temporary work around, I prefixed the id with <nowiki>...</nowiki>
here, but there are actually over 500 pages in the temporary tracking category, Category:Pages using infobox bridge with id. I am not sure why St. Paul Union Pacific Vertical-lift Rail Bridge was the only one that was showing up in Category:Pages with script errors. I would think it would be a good idea to be able to disable the automatic use of |id=
in Module:Infobox mapframe if some parameter were set? Frietjes (talk) 15:20, 20 July 2020 (UTC)
mapframe
. |id=
and |qid=
should be deprecated. Infoboxes sometimes use those parameters for their own purposes. – Jonesey95 (talk) 21:01, 23 January 2023 (UTC)for some reason, I had to do this to fix the map frame script error? I tried using those coordinates in a direct call to infobox mapframe here, and they work, so no idea what is going on here. Frietjes (talk) 16:21, 20 July 2020 (UTC)
Currently the fill color for shape or shape-inverse is too dark I think - the map is hardly readable under the fill. I guess the default (at least for standard Maplink template) fill color is black and opacity is 0.5 which results in very dark fill. Many infoboxes are locked for editing and use the this template's default settings. I propose to make the fill lighter - maybe black with 0.25 opacity or even 0.125 opacity?--Kozuch (talk) 11:09, 30 August 2020 (UTC)
The default zoom of Template:Infobox building is supposed to be 13, but when I used it here the zoom was so large I had to change it manually to 14 which was fine. — Martin (MSGJ · talk) 22:13, 13 November 2020 (UTC)
Mapframe was embedded in ((infobox station)) a few months back and I've been invoking it at GB stations following a template merge. But intermittently I get just a pale blue panel instead of a map. I see this on Android, Chrome OS and Windows (Chrome and Firefox). Is there a significant issue or is it a transient? I can't provide a reliable test case because sometimes it is evident and sometimes not, but Milton Keynes Central is as good an example as any (and right now it works as it should, so try High Wycombe which doesn't). --John Maynard Friedman (talk) 11:56, 18 November 2020 (UTC)
I have created new docpage Template:Infobox mapframe/doc/parameters/doc to document the ../parameter list. You might be interested to follow it. -DePiep (talk) 16:34, 29 November 2020 (UTC)
(reposting in part from VPT, where I was unable to get an answer) When I go to Heritage Plaza and look at the Infobox mapframe OpenStreetMap snippet, the city is labeled "Hjuston". I don't know where that errant label lives. The same problem is visible at Spirit of the Confederacy, a nearby sculpture. I have looked at the OpenStreetMap web site and at the Wikidata entry for "Houston", and have come up empty-handed. – Jonesey95 (talk) 15:34, 15 March 2021 (UTC)
I have recently added the OSM maps to the 350 suburbs of Perth (see Category:Suburbs of Perth, Western Australia) after making the necessary links on OSM first where still required (some had already been done earlier by somebody else). This worked very well, except on the 8 suburbs of the City of Bayswater (see Category:Suburbs in the City of Bayswater), where I just end up with the blue screen on the map in edit prefiew and no proper map. Everything on OSM seems ok, as far as I can tell. I'm unable to establish what causes the issue with just those 8 suburbs of one city. Personally, I don't think the issue is on Wikipedia as I have substituted a different "local_map_id =" on the Bayswater, Western Australia article (the one for Hillman, Western Australia) and it displayed the Hillman map correctly. From past experience, raising such on issue on OSM went absolutely nowhere, so I'm wondering if anybody here has any suggestion on how to fix this, wherever the issue lays? Calistemon (talk) 08:24, 22 October 2021 (UTC)
Hello, pinging @Evad37: who developed Infobox mapframe. Can anyone answer as to why early implementation of mapframe in infoboxes, as seen in this diff here, allows for automatic shapes and points? I cannot get "((#invoke:Infobox mapframe|auto))" to automatically or even manually display shapes, like was the case at Greater Columbus Convention Center. ɱ (talk) 14:38, 24 April 2022 (UTC)
Hi! I would like to show the position of a dam in the same map as the shape of the reservoir it creates. These are usually in different Wikidata items. Could there be an option like |shape=Q1625606
to specify an additional qid (similar to the geomask option)? — Martin (MSGJ · talk) 06:53, 29 July 2022 (UTC)
The zoom parameter is always set to 1 (zoomed all the way out) when using |switch=auto
. Is there any way to fix it? Xeror (talk) 22:29, 18 September 2022 (UTC)
Hello, I recently made a edit that another user found weird. I added a maplink map of Newark, New Jersey to the corresponding Wikipedia pages info box as can be seen here. Their issue with the edit was with the fact that the title (in this case Newark) only can pop up when you click somewhere that is not Newark. While using another shape type would fix this, I think that shape inverse is the best way to show these areas and would like to keep using it for infoboxes. Is there anyway to fix this issue using the code this template already has, or if not could someone pass the word to a editor that can fix the issue for good in the code of the template. The disagreement can be found on my talk page second from the bottom. Monkeylol (talk) 13:47, 30 November 2022 (UTC)
I see that this template has pixel-based specifications for width and height, but MOS recommends allowing images to scale based on readers' thumbnail preferences. How can we use something like |upright=
to tell this map how large to be? One specific use case is at Template:Infobox bridge/testcases, where we have set the sandbox template to display the main infobox image at |upright=1
, which scales up the image and widens the infobox for readers with thumbnail preferences set to 300px or higher, but the mapframe map currently stays the same width because it is specified at |mapframe-frame-width=250
. I looked through this template's documentation but did not find "upright" anywhere. – Jonesey95 (talk) 04:47, 10 January 2023 (UTC)
![]() | This edit request to Module:Infobox mapframe has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Is there a way to add a functionality of this template to do what Lisbon map looks now: recursively show larger area and automatically zoom and center? I currently do it manually. Xeror (talk) 05:43, 5 April 2023 (UTC)
|switcher=auto
option, the following changes are desired:
type
should be set to shape
. For more zoomed out ones, it should be set to point
.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)
((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)
![]() | This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Diff:Hi, by default, in the case that coordinate of a place is entered inside the Infobox of an article, then incorrectly red colored area indicator of that place is not shown in the map of that Infobox. For example, if we place coordinates of National Zoo of Malaysia inside its Infobox, the rendered map would be:
Code | Rendered Infobox |
---|---|
![]() |
![]() |
While if we place that coordinates outside of the Infobox (at the top), then the red colored area indicator would appear in the map, correctly. Like this:
Code | Rendered Infobox |
---|---|
![]() |
![]() |
You can test this coding scenario in the article National Zoo of Malaysia to clarify this default bug. So please change the default scenario for mapframe-wikidata parameter
With the parameter |mapframe-wikidata = yes
the Infobox area indicators appears, but we are talking about default scenario. If the bottom code by default does show the area indicators, then the top code by default should show them too, or the inverse default scenario should be applied.
I think in 99% of cases these red line area indicators are necessary, so the default value of mapframe-wikidata should be |mapframe-wikidata = yes
, but the user could change this parameter to no
for 1% of cases. Hooman Mallahzadeh (talk) 05:01, 9 September 2023 (UTC)
|mapframe-wikidata
is wrong! It is now |mapframe-wikidata=no
, and this is not the expected default behavior! Do you agree?|mapframe-wikidata=true
, but changing the default setting of that parameter should be part of a larger conversation if it's something you're wanting to pursue. For clarity, I have no idea whether or not it's desirable or "better", but I personally don't expect it.User:Jonesey95, do you have any insight as to whether this behaviour is related to those three links above? Folly Mox (talk) 16:26, 10 September 2023 (UTC)
|coord=
. It has nothing to do with their placement within the article (i.e. top or bottom) or with the page preview problems. I refer the OP once again to the documentation, which explains that if |coord=
is used in the infobox, the shape is not displayed unless |wikidata=yes
is also used. – Jonesey95 (talk) 04:36, 11 September 2023 (UTC)
mapframe-wikidata
? Hooman Mallahzadeh (talk) 07:03, 15 September 2023 (UTC)
|wikidata=no
, which appears to work the same as |wikidata=yes
. It appears that any value of |wikidata=
enables the red outline or track, which should probably not happen. – Jonesey95 (talk) 13:26, 15 September 2023 (UTC)
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)
((Template:Infobox ancient site))
|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)
((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)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)
Hi, in these Infobox maps, "frame marker" overlaps "the text of city name", so the city name is not readable.
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)
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)
| image_map1 = ((Infobox mapframe |point = none|zoom=14 |frame-height=300 |frame-coord=((WikidataCoord|display=i))))
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)
| 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))
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)
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)
((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))
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)
Hi, can any one correct this map by changing OpenMapStreet data?
Thanks, Hooman Mallahzadeh (talk) 15:35, 18 March 2024 (UTC)