Help talk:Extension:Kartographer

Jump to: navigation, 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.

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.

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

Is it possible to use this in a infobox?

Geraki (talkcontribs)
HueMan1 (talkcontribs)

How about in infobox road?

Evad37 (talkcontribs)
HueMan1 (talkcontribs)


{{Infobox road |name=Calabarzon road network |TAG HERE</nowiki>=<mapframe frameless text="Map of the Calabazon Region" width=500 height=500 zoom=8 latitude=14.1 longitude=121.5></mapframe> |country=PHL }}

Evad37 (talkcontribs)
HueMan1 (talkcontribs)

Thanks fellow Wikipedian

Trizek (WMF) (talkcontribs)

Thank you all for sharing your knowledge. :)

Reply to "Infobox friendly?"

Coordinates from Wikidata items (Property:P625)

Geraki (talkcontribs)

Can anyone understand why I do not get a map here?

<mapframe width=500 height=500 zoom=6 longitude=23.6 latitude=38>
  "type": "ExternalData",
  "service": "geoshape",
  "query": "
SELECT ?item ?coord ?Natura_2000_site_ID WHERE {
  ?item wdt:P3425 ?Natura_2000_site_ID.
  ?item wdt:P17 wd:Q41.
  ?item wdt:P625 ?coord.

In fact, not only the map fails, but also the interface! (no links to external maps etc.)

Geraki (talkcontribs)

I now understand this is a similar question to Help_talk:Extension:Kartographer/Archive_1#Wikidata_coordinates. Is there any way to include points where the coordinates are stored straight in Property:P625 in Wikidata? I find it strange that we can display maps with polygons called from OSM (through Wikidata), but not with points called straight from Wikidata items (at least there are no instructions on this).

Evad37 (talkcontribs)
Reply to "Coordinates from Wikidata items (Property:P625)"
AWossink (talkcontribs)

Would it be possible to display rectified maps from c:Commons:Wikimaps on top of a basemap drawn from OSM?

Abbe98 (talkcontribs)
AWossink (talkcontribs)

Ok. I knew about the extensions you're showing, but I was really hoping that this feature would also be enabled on Wikipedia. Being able to show map layers in an article would be an incredible way to add information. But who knows, maybe it gets implemented at some later point in time?

Reply to "Rectified maps from Wikimaps Warper" (talkcontribs)

How do i disable the automatic category "Pages with maps"? (talkcontribs)

Found it. Clear [[Mediawiki:kartographer-tracking-category]]

Reply to "Disable automatic category"

Map jumps continents between Preview and Save

Mathglot (talkcontribs)

I'm having a problem displaying a map generated by a <mapframe> which links to an OSM map via a wikidata id.

I created a Talk subpage at w:Talk:Anatolia/Maps to use as an illustration of a message I was going to add at the Rfc going on at w:Talk:Anatolia. This subpage has four maps using the Extension. All four maps show images of Anatolia (Turkey), with slightly varying zooms (4 or 5) and different aspect ratios. The first three are all simple, straight <mapframe> type maps, but the fourth one is a <mapframe> which links to an OSM map that has a wikidata property, and points to wikidata's Central Anatolia item. This fourth map is not displaying correctlymost of the timebut sometimes it does.

The first three always display correctly. However the fourth one which links to a Central Anatolia map created at w:OpenStreetMap (here) and is linked through the OSM wikidata property Q155526, and links to "Cenral Anatolia Region" as d:Q155526 is acting flakey.

The first three maps all look fine, both in Preview, and after Saving. However, two funny things are going on with the fourth map, that links through OSM and Wikidata:

  1. I usually have to hit "Preview" button twice or more, in order to visualize it. The first time, I usually just get a gray rectangle for the fourth one (the other three above it are always fine).
  2. After I hit "Publish", the fourth map displays, but it's no longer of Anatolia region (Turkey) anymore, instead, it shows a section of northern Africa centered on Algeria, and the containing box is twice as tall as it was.

If you look at the 4th map by viewing the page w:Talk:Anatolia/Maps, that's probably what you will see now, i.e. Algeria. But if you edit the page, and hit the "Show Preview" button a sufficient number of times, it will probably show Algeria several times in a row in Preview, and then at some point it will jump back to showing a map that looks just like the top one of Anatolia, except that the central portion will be shaded, matching the OSM map showing Central Anatolia shaded. (The last time I tried this, I had to give up and Cancel out once, then try again and "Preview" seven times before it "jumped" back to Anatolia, and showing the shaded border created by the OSM map.)

What is going on here? Why is it jumping back to Antatolia in Preview, but only rarely, and why, when I save the page, does it always show Algeria? (Please {{Ping}} me upon reply.) ~~~~ (hand stamped: May 12, 2018, 09:00 (UTC) )

Evad37 (talkcontribs)

@Mathglot: The saved page displaying differently to the previewed page (when the preview works) is probably phab:T193455 -- automatic zoom and centering only works on page preview.

Evad37 (talkcontribs)
Mathglot (talkcontribs)

@Evad37: Thanks. So, if I explicitly add the lat/long and zoom level in the <mapframe> tag, it should work? In that case, can someone please change the documentation, as the page shows examples which exclude everything in the <mapframe> except text and zoom. See "State of Colorado" examples at Help:Extension:Kartographer section "Markers".

Mathglot (talkcontribs)

Yep, I tried it, and that fixed it. Must be phab:T193455 as you said. Thanks again.

Mathglot (talkcontribs)

That's strange, I could've sworn that all the floated maps (w:Talk:Anatolia/Maps) were draggable and zoomable, but now they're not, unless you full-screen them first. Am I imagining that they were before?

Evad37 (talkcontribs)

@Mathglot: I think it's only in previews that non-full-screen maps are draggable and zoomable.

Mathglot (talkcontribs)

Very possibly that's what I remember; thanks. I can see this has a learning curve and takes some getting used to. But still, great product, looking forward to using it more and getting to know it; I'm sure as time goes on, various issues will be ironed out.

Reply to "Map jumps continents between Preview and Save"

Should your language change its map language fallbacks?

JMatazzoni (WMF) (talkcontribs)

Since we launched map internationalization earlier this week, a number of users have asked about the map language-fallback schemes and how communities can change their fallbacks (e.g., this exchange).

In response, I added a post today to the Map Improvements project page that goes into detail about map language fallbacks. It explains how to request a change and gives an example of why some less widely translated languages, at least, might want to consider adding to their fallbacks.

I’m sure there are many angles on this question we haven’t considered yet. If you have thoughts or questions, please share them on the project talk page. We’re listening.

Reply to "Should your language change its map language fallbacks?"

Map internationalization launched everywhere—and embedded maps now live on 276 Wikipedias

JMatazzoni (WMF) (talkcontribs)

As of today, interactive (Kartographer) maps no longer display in the language of the territory mapped; instead, you’ll read them in the content language of the wiki where they appear—or in the language their authors specify (subject to availability of multilingual data). In addition, mapframe, the feature that automatically embeds dynamic maps right on a wiki page, is now live on most Wikipedias that lacked the feature. (Not included in the mapframe launch are nine Wikipedias that use the stricter version of Flagged Revisions).

If you you’re new to mapframe, this Kartographer help page shows how to get started putting dynamic maps on your pages.  If you’d like to read more about map internationalization: this Special Update explains the feature and its limitations; this post and this one describe the uses of the new parameter, lang=”xx”, which  lets you specify a map’s language. And here are some example maps, to illustrate the new capabilities.

These features could not have been created without the generous programming contributions and advice of map-loving volunteers, including Yurik, framawiki, Naveenpf, TheDJ, Milu92, Atsirlin, Evad37, Pigsonthewing, Mike Peel, eranroz, Gareth and Abbe98. My apologies to anyone I’ve missed.

The Collaboration team's Map Improvements 2018 project wraps up at the end of June, so please give internationalized maps and mapframe a try soon and give us your feedback on the project talk page. We’re listening.

Atsirlin (talkcontribs)

@JMatazzoni (WMF), cool! Is there a way to define the lang= parameter globally for all maps shown on one page, instead of writing it every time in every maplink call? --Atsirlin (talk) 09:04, 10 May 2018 (UTC)

Roan Kattouw (WMF) (talkcontribs)

There isn't, because the lang parameter defaults to the page language. Could you tell me what your use case is, though? It sounds like maybe page language should be (or is) different in that situation.

Mooeypoo (talkcontribs)

@atsirlin Thanks for the comment. The quick answer is "No, but" ;) There's no real easy way of doing this right now, but there might be mitigating circumstances we can work around depending on your use case.

Can you explain more about your need? What is this for? Is this for a page that has translations, or general article? If you give us more details, we might be able to see how to help better.


[edit] What Roan said ;)

Atsirlin (talkcontribs)

@Roan Kattouw (WMF), @Mooeypoo, at Wikivoyage we have one mapframe in the beginning of the article followed by multiple maplinks for individual objects (places of interest). Take this page as an example. The map icon at the beginning of the page is a mapframe set to lang=en, so it shows English street names, which is good. Then the red boxes 1-5 are individual objects defined by the maplink. If I click on them, I still see the map in Chinese, because the lang parameter has not been defined (and no Russian labels are available). My question is: how can I define lang= for all these maplinks (on a given page) globally? I don't really want to write lange=en every time, because a typical Wikivoyage article has between 30 and 100+ such maplinks.

PS. Another solution I can think of is changing language fallback scheme for a given wiki. In other words, define that Russian Wikivoyage will always choose the languages in the following sequence: language given by the lang= parameter --> Russian (language of the wiki) --> English --> local. This should solve most if not all issues we have. --Atsirlin (talk) 19:42, 10 May 2018 (UTC)

Roan Kattouw (WMF) (talkcontribs)

Right now we don't have a way to define fallbacks on a per-wiki basis, only on a per-language basis. So we can set the fallback for Russian to English, but there are two problems with that. One is that this would affect all other Russian-language wikis, not just Russian Wikivoyage.

The other is that some place name labels in OpenStreetMap have a "local" name but no Russian name, even if the local name is in Russian. In that situation our software thinks there is no Russian name, and it might display an English name for a place in Russia. There's a proposal to fix that in the OSM data, but that will be a slow process and the OSM community hasn't yet agreed on how to handle it, so for now we've been telling people to fix these cases one by one as they spot them. Because of this issue, we are being careful with fallbacks in the meantime, because we don't want to show English names for places in Russia to Russian-speaking users.

So we can add a fallback to English if there is community consensus for it, but we want people to be aware of the issue with English names, and to be ready to fix those in OSM. Then there's the issue that this affects all wikis that speak the same language, which we haven't given much thought to yet. @CKoerner (WMF), what are your thoughts on that?

Atsirlin (talkcontribs)

@Roan Kattouw (WMF), thanks for your response! Yes, I understand the problem. What about the first part of my question? Equally difficult?

Reply to "Map internationalization launched everywhere—and embedded maps now live on 276 Wikipedias"

Pass template parameters to maplink and mapframe?

Geraki (talkcontribs)

It seems that<mapframe width="300" height="300" zoom="12" latitude="{{{lat|0}}}" longitude="{{{long|0}}}" text="{{{text|}}}" /> is not possible.

Allowing template parameters in maplink and mapframe parameters and json content will make it easier for editors to include them in templates.

Using Module:Mapframe is creating complexity with many nested templates, not really liked in many small projects as it reduces the bus factor.

Atsirlin (talkcontribs)

Use {{#tag:maplink and a list of parameters, each preceded by | (and without quotation marks). Example here. --Atsirlin (talk) 07:20, 7 May 2018 (UTC)

Geraki (talkcontribs)


Matroc (talkcontribs)

This method above does work well. To go another step further I use the {{#tag:mapframe or {{#tag:maplink in a single template that calls a Module with list of parameters - the template applies default values for this Module and the Module provides some checking and other defaults returning code needed for a Mapframe or Maplink. This particular module can also draw different shapes (such as circles, pointers, arrows, triangles, stars etc.) and place them on a map. The parameters allow for the user to be able to provide many of the arguments such as line thickness - color - maki icon names for points etc. for Kartographer. One can find a Wikidata ID and an article exists in the wiki you are working on that has the inormation you are looking for - that particular ID can be looked up and used as well. Best wishes...

Geraki (talkcontribs)

OK, I tried but I failed: how do I pass json data to the tag?


I think I did what I saw in the modules.

Reply to "Pass template parameters to maplink and mapframe?"
GerardM (talkcontribs)

Hoi, is it possible to use Wikidata labels for different languages ?

Abbe98 (talkcontribs)
GerardM (talkcontribs)

Could this query be adopted so that you can enter a date and get the governors of that year / date.. The data is there, I know because I put the data there : Governors for both States and Territories :) Thanks

Reply to "Using Wikidata labels"