Help talk:Extension:Kartographer

Jump to navigation Jump to search

About this board

Welcome to the Maps discussion. This is a place to provide overall maps feedback.

Previous discussion was archived at Help talk:Extension:Kartographer/Archive 0 and Help talk:Extension:Kartographer/Archive 1.

Did something just change with the zoom levels?

Summary by Mike Peel


Mike Peel (talkcontribs)

It seems that zoom level 15 is no longer the highest zoom level on Commons - did something change?

TheDJ (talkcontribs)

link ?

Mike Peel (talkcontribs)
MSantos (WMF) (talkcontribs)
Ederporto (talkcontribs)

Hello, everybody,

I'm trying to discover what is going on with mapframe maps on this article: Lista de governadores das unidades federativas do Brasil (2015–2019). It's blank, no matter what I try to do to solve. The query is correct, it returns the right amount of items (27 states). Some time ago one person changed the P31 of all states of Brasil on Wikidata, but it was reverted to the original P31, I'm not sure if has influence or not. Can anyone give me some light on that? Thanks!

Matroc (talkcontribs)

I don't do queries but I would hazard a guess that you are not getting the OpenStreetMap coordinates to create the shapes... I am sure someone will provide an answer - best wishes - ~~~~ (talkcontribs)

This is because there is an error with the query, two governors from the same place, Alagoas, Q40885. Even before that the query wasn't correct, it contained a newline before the "select". There might be other errors.

Reply to "Broken maps based on queries"
Matroc (talkcontribs)

Can one just get the actual coordinates of a mapshape from OSM via Wikidata and only that as text (nothing else)? The basic reason is that I have been comparing several hundred positions against various mapshapes (polyons) to see if those positions are within or outside that shape in order to make some selections as POIs. It would make things a bit easier than having to create that information by hand. Thanks... -- ~~~~

Arlo Barnes (talkcontribs)

This is definitely the kind of query Overpass (a popular way to access the OSM API) can handle, but I am not sure how Overpass and Wikidata could be linked.

Matroc (talkcontribs)

Thank you for your response! -- I was originally thinking of the possibility of using a Lua module to access Wikidata/OSM and retrieve it that way... I do remember some time ago downloading by hand from OSM but forgot how I did it lol. It just seemed a nice idea to be able to do something like that. Some OSM entries have a Wikidata ID which links it to Wikidata. On Wikivoyage we use Kartographer which accesses Wikidata's matching OSM (an external process of sorts) and used to create shapes, rail lines etc. on a map. Again -- thank you for your response - I will take a look at Overpass - Best wishes. -- ~~~~

Reply to "OSM mapshape"

Links in titles and descriptions made by SPARQL queries are red

Dipsacus fullonum (talkcontribs)
CKoerner (WMF) (talkcontribs)
Dipsacus fullonum (talkcontribs)
Reply to "Links in titles and descriptions made by SPARQL queries are red"
Jts1882 (talkcontribs)

The description says the " code will insert a simple interactive map ... with the ability to maximize it by either double-clicking the map or clicking the icon in the right corner". I find that the map maximizes on a single click. I see this behaviour for the examples on this help page and on the English language wiki.

However, if you edit the pages and use show preview the maps behave as described, with the single click gaining focus and allowing the map to be used interactively within the page. The correct behaviour is also seen on the test2 wiki.

Evad37 (talkcontribs)
Reply to "Map maximizing on single click?"

Bug(?): Embedded map preview within an article does not render

NeoGeneric (talkcontribs)


The map preview within a page will sometimes show a blank white box. The full screen button and bottom-right attribution text is still visible. The map renders correctly when the user opens the full screen mode.

How to reproduce

No idea on what causes this, but it will sometimes appear after making an edit to the page that contains the map. The problem persists across different browsers and machines, suggesting it may be a bug on the wiki-side.


Make an edit that breaks the Kartographer map (such as delete a parenthesis), then revert. This normally clears the problem. Purging the page doesn't fix:

Issue: Transcluded maps will go blank when changing the content of <mapframe>

NeoGeneric (talkcontribs)


When using the <mapframe> tag in a template, any changes made to the map data (i.e. data within the <mapframe>...</mapframe> tags) will cause any transcluded instances of the map to go blank. While the map can still be viewed when clicked on, the small preview window is blank.

How to reproduce:

  • Create a template page (such as a template sandbox ) that contains the <mapframe> tag. (e.g. The San Francisco museums example at Help:Extension:Kartographer#<mapframe>_usage
  • Create a page that transcludes the template with this map
  • Make an edit to the content of the <mapframe> tag (e.g. change marker-size from "large" to "medium")
  • Reload the page that transcludes the template, the map will now appear blank on this page.
CKoerner (WMF) (talkcontribs)

That doesn't sound right, but I'm afraid I can't reproduce. Here's an example on English Wikipedia using the Template:Mapframe. I think this might be something where it can take a few minutes to generate a thumbnail. Do you have an example I can see on-wiki somewhere?

NeoGeneric (talkcontribs)
NeoGeneric (talkcontribs)

The thumbnail has since appeared without any intervention. So as you suggested, it appears to just be a delay in rendering the thumbnail. My mistake!

WikedKentaur (talkcontribs)
YjM (talkcontribs)

@JMatazzoni (WMF): Ping, because it is a very desired thing, to draw rivers in the map. We this thoroughly in the Czech Wikipedia. It seems like Kartographer can render only a limited subset of relations, is that true? Apart from rivers, we had a hard time add e.g. relations of type=site into the mapframe. Thanks for your reply!

JMatazzoni (WMF) (talkcontribs)

There is another question about rivers here, which may shed light on your problem.

Meanwhile I'll email our map styles expert, @Pnorman, who doesn't appear to have a user page on Mediawiki. Stand by.

Pnorman (talkcontribs)

Currently geoline and geoshapes only supports multipolygon, route, and boundary relations. The new style work will bring along a change to the database schema which will add support for other relation types. task T156433 is tracking this.

YjM (talkcontribs)

@JMatazzoni (WMF) Great! Thanks for your quick answer, I have informed our local community about it. (talkcontribs)

@Pnorman I see the task has been declined. Is there still some hope for rivers to be rendered?

Pnorman (talkcontribs)

I'm not under contract anymore to work on WMF maps stuff, so I suggest you move discussions to a phab ticket. It's up to WMF management if they do any work, so you may need to approach them, or if they are constrained by a strategic direction that doesn't include maps, have the community escalate the issue to the executive level.

Reply to "River doesn't render correctly"
Daylen (talkcontribs)

@JMatazzoni (WMF) It looks like Kartographer is going to be pulled from enwiki infoboxes, as vandals have discovered that they can bypass page protections by vandalizing the information on OpenStreetMap. As OpenStreetMap is not a sister projects, admins are having to create new accounts on the service and learn how it works in order to fix these incidents. For example, on the Empire State Building map, it was changed to show the words “Jewtropolis” over Manhattan and the phrase “INSIDE JOB” over lower Manhattan. More details are shared on the Village Pump discussion.

Evad37 (talkcontribs)

This has been reported on Phrabricator phab:T201772. Maps were temporarily disabled from Infobox building, but that was undone after Module:Mapframe had a hack added to prevent maps with coords around Manhattan from displaying.

Reply to "Vandalism on OpenStreetMap"

How would an infobox add support for this extension

Summary by Daylen

On the English Wikipedia, there is w:en:Template:Infobox mapframe which automatically fetches coordinates from Wikidata, and shapes/lines from OSM if available.

Daylen (talkcontribs)

The English Wikipedia building infobox template ( does not currently support kartographer maps. What changes need to be done in order for the maps to load without an error message, seen below.

Lua error in Module:Location_map at line 501: "?'\"`UNIQ--maplink-00000004-QINU`\"'?" is not a valid name for a location map definition.


  1. [C]: in function "error"
  2. Module:Location_map:18: in function "getMapParams"
  3. Module:Location_map:501: in function "chunk"
  4. mw.lua:511: ?
  5. [C]: ?
  6. [C]: in function "getExpandedArgument"
  7. mw.lua:169: ?
  8. Module:Infobox:373: in function "preprocessArgs"
  9. Module:Infobox:420: in function "chunk"
  10. mw.lua:511: ?
  11. [C]: ?
JMatazzoni (WMF) (talkcontribs)

Hi @Daylen. I can't answer your question, but I can give you some examples of info boxes that use mapframe maps.


If you get it working, please show what you came up with!

Evad37 (talkcontribs)
JMatazzoni (WMF) (talkcontribs)

Thanks @Evad37. The function looks like it is working well in these templates. Do you know why English Wikipedia hasn't adopted mapframe more enthusiastically? At present has fewer than 2,000 mapframe maps—compared to tens of thousands on some other wikis (and more than 160k on . Is it, for example, because users developed more effective workarounds prior to our recent mapframe release? Or a lack of information? Or is there something else that is causing deployment there to go slowly?

Daylen (talkcontribs)

@JMatazzoni (WMF) My insights from editing on the English Wikipedia for a few years is that seems to move more cautiously compared to other Wikimedia projects. I would mostly attribute this to a more established community of editors who are fine with the status-quo. You could say the same thing about Flow talk pages, Wikidata infoboxes, and VisualEditor. All are examples of technologies that hadn't made default. At the moment, these maps are opt-in only, as they still have some major flaws (like not being app accessible). Once these changes have been addressed, it will likely be changed to opt-out. Until that time, it is being rolled out on an article by article basis.

Evad37 (talkcontribs)

@JMatazzoni (WMF): I think a part of it has been the lack of any obvious way to easily add maps en-masse to articles (at least prior to {{Infobobox mapframe}} existing). You can't just go round with AWB and quickly/easily add <mapframe>...</mapframe> tags -- there might not be any data on Wikidata or any linked features on OSM; plus coordinates and zoom have to be specified for each use, otherwise the static thumbnail map just shows northern Africa and southern Europe (and/or a very low zoom level) when the page is saved (phab:T193455). Of course, it doesn't help that there are whole classes of articles where OSM data just can't be used (phab:T156433), and even for cases where it can be used, you may have to wait 24 or so hours for any new/updated OSM data to show up (phab:T137939).

{{Infobobox mapframe}} fixes some of this, enough to be used in an automated way just by looking at the transcluding page's Wikidata item... but it is relatively new and will take time to become more widely used. Particularly in widely-used and protected templates, where non-trivial changes require discussion. As more and more templates start using {{infobobox mapframe}}, the number of mapframe maps should increase quite a bit. Particularly if used in more of an "opt-out" rather than "opt-in" way.

Plus there's the restriction on Commons only accepting public domain/CC0 geoJSON data (phab:T179440) (though there is a workaround for CC-BY-SA compatible geoJSON, as that can be stored as wikitext and transcluded).

Another reason for the slow adoption would be a lack of any urgency, as existing image-based map alternatives work are basically "good enough", and have widespread usage across many infoboxes.

And finally, maybe just a lack of coordination between editors interested in maps, with such editors perhaps more interested in their own few favourite articles/topic areas rather than spreading mapframes across the site as a whole.

Geraki (talkcontribs)
Daylen (talkcontribs)

@Geraki The English Wikipedia doesn't use Wikidata for infobox data. That is why (I would assume) all the extra code is required on enwiki.

Evad37 (talkcontribs)

@Geraki: That is an option, but there are benefits to using {{infobox mapframe}}. This template will also show shapes and lines, if they are defined on OSM, and can hide the marker image in such cases (since it isn't really appropriate for e.g. roads which don't exist at a single point). It can also automatically calculate an appropriate zoom level if given a length or area. And it allows for a more standardised mapframe experience between infoboxes by specifying default frame width, height, and colours. Plus it is easier for less technically-capable editors to use, since they don't have to know the exact JSON/syntax for the tags, since its just a template that takes parameters.

@Daylen: That's not actually correct, there's plenty of infoboxes at w:en:Category:Templates using data from Wikidata; see also the various RfC conclusions. As I explained above and on w:en:Template talk:Infobox building, it does fetch coordinates from Wikidata.

Daylen (talkcontribs)

I was referring to the fact that the elwiki link included above used Wikidata exclusively for the infobox. As such, extra code is required on enwiki, due to consensus against using Wikidata as the automatic provider of all infobox data, from a Village Pump discussion.

Geraki (talkcontribs)

@Daylen I am sorry for my post not being clear: If you check the code you will see that the use of Wikidata is not mandatory. It is used only if there are no local parameters set. {{infobox building|latidude=40|longitude=23}} would use these values instead of Wikidata. In fact if you remove the WD feature the code would be more simple.

@Evad37 I don't dispute that {{infobox mapframe}} has a lot of features. The question was how to display maps using another infobox (building), in this case not with bad results since a building is not the same with road (it is ok to display it with a pushpin). Editors who use it don't have to deal with any tag syntax. Eventually, something like infobox mapframe will come in place, but it needs things to settle and a lot of study (Wikidata modules have differences across Wikipedias).

Reply to "How would an infobox add support for this extension"