Template talk:Graph:Street map with marks

Jump to navigation Jump to search

About this board

RobinLeicester (talkcontribs)

Is there any chance that the Maplink 2018 improvements to internationalised names could find their way on to this system as well? To have the new default of 'language of the wiki', even without all the additional versions, would be a huge improvement over the current version for pretty much everyone. (If retaining the current 'osm-intl' it probably could be renamed as osm-local to match the mapframe usage). The no-labels 'osm' style has also been heavily requested and I have found useful, so to end up with all three would be great.

Yurik (talkcontribs)
Yurik (talkcontribs)

P.S. @RobinLeicester I would suggest filing a Phabricator ticket for this (and add alink to the code) - much more likely it would be acted on.

Reply to "Internationalized names"
RobinLeicester (talkcontribs)

Yurik, thanks for sorting out the no-labels style. Will it automatically migrate to en:wiki at some point? Another feature that would transform the mapswould be if they could be given an extra layer which defines some wikilink areas above the marks. I guess this might be possible with <imagemap>, but that requires an image name, which can't be done outside the graph template. Is there some way this might be achieved? (When the election dust settles...). Thanks.

Yurik (talkcontribs)

migration = copy/paste the content of the template without any changes from mediawiki :) The overlay clickability ... might require code change for the <imagemap>, or we could use the graph's capability of click handling, but that would require the graph to be generated in SVG (there is a phab ticket for that).

Yurik (talkcontribs)

P.S. Copied.

RobinLeicester (talkcontribs)

Thanks for sorting the no labels option. That is great. The maps are already doing great things. A clickable facility would be great. (To my mind one that avoids the clunky 'play video' style launch phase would be much preferred).

Reply to "marks with a hyperlink"
RobinLeicester (talkcontribs)

Six months ago Nilfanian raised the problem of labels on the base map, and suggested that a version with no labels at all would be helpful. The problem of non-alphabetic script on en: articles was one particular problem mentioned. Arbitrary mention of obscure places at lower zoom levels is another issue, as is the bug that chops up some names in zoom=9. These are all being cited as specific reasons to not use the map on en:wikipedia (eg at WikiProject UK geography). Is there any hope of an option to turn off place names, so that editors can then use the individual marks/labels to put in the ones appropriate to the article in question. (There are of course lots of other contexts - especially at higher zoom levels - where the existing labels are a great help).

Yurik (talkcontribs)

Hi, technically the map without labels was created around half a year ago (try it) , but I am not sure it got exposed via the <mapframe/maplink> tags. For the street map template, I just added it as a template parameter, but it turns out there is a bug preventing the "osm" value for the style parameter, which I will try to fix tonight, and it should be deployed next week.
P.S. I am running for the WMF board, please support and vote next week :)
P.P.S. Tracking issue phab:T164046. Partial fix is already in place, needs to be submitted and deployed.

RobinLeicester (talkcontribs)

The base map zoom=9 label problem resolution is much appreciated. (Is it me, or are there now more place names? In busy areas is looks rather full. If I was creating a wishlist I might suggest the names could be smaller!

Looking at this graph source code, I notice that in the line with the style instruction, all the other elements have the quote mark after the '=' whereas the style has it after the '{{{style}}}'. Could that be where the problem lies? (With no knowledge of the routines this is calling, I am just stabbing in the dark though). Thanks.

Yurik (talkcontribs)

The map labels work is being done at the moment by Paul, and I think there has been an announcement about it somewhere. Due to deployment freeze this week, I think it hasn't been updated yet on the servers, so might be another week until it is fully done.

Yurik (talkcontribs)

Done - see the 3rd example. Note that "save preview" mode will not work for the next few days, until the servers are updated. The saved page should work fine.

Reply to "Need for a no-labels option"
RobinLeicester (talkcontribs)

The External Dataset features look like a great way forward, whether by a more generally editable use of wikidata, or the really useful looking table in Commons. They would massively reduce the clutter that maps introduce into an article edit page. Is there a way of using the same dataset (eg a commons Data table) within <maplink>? In the Template:OSM Location Map I can automatically make use of manually inserted marks into both the graph: template and a <mapframe> link. to do the same with a table would be fantastic.

Yurik (talkcontribs)

You can use Map Data -- and reference it as External Data from the <mapframe>/<maplink>. Is that what you are looking for?

RobinLeicester (talkcontribs)

If I have understood it right, the Map Data can be used by <maplink> but not by Graph:Street map with marks, while Graph: can use the table data which is no use to <maplink>. What I am looking for is some way of using the accessible, curatable, table data on both types of map. eg, can the table data be used to generate Map Data in some automated or semi-automated way?

Yurik (talkcontribs)

This is not exactly correct. The *.map and *.tab pages in Data namespace on Commons can be used by the <graph> tag (Graph extension). Only the *.map pages can be used by the <maplink> & <mapframe> tags (Kartographer extension). The <graph> tags are Vega-based graphs, and Vega allows you to load and draw many different types of data. The "Graph:..." prefix is simply a convention for the templates that use <graph> tag. More specifically, the "Graph:Street map with marks" template (graph) was initially designed with a very specific goal - draw the street map + a few manual elements on top of it. If there is a specific need for a different graph, anyone could create a different template, and use the <graph> tag to draw a completely different image. The Vega syntax inside the <graph> tag is a very powerful, but a bit complex syntax to express such visualizations. I could try to help with getting started, but I simply cannot implement every possible graph required :)

RobinLeicester (talkcontribs)

Thanks for the helpful explanation. The table option in "Graph:Street map with marks" has already achieved my hopes for that - so that already looks great. What I was hoping for was some way of using the data from the same table to put locator points into a maplink tag (or, when it arrives at en:, a <mapframe>). My guess is that there could be a Lua routine to extract the data from a table of the sort you demonstrated, and turn it into a maplink-ready GeoJSON map file, with the marks simply shown as wikivoyage-style points (If I am using the right terminology). Unfortunately I have no idea about how to achieve that. I was only asking in the hope that it may be on someone's radar.

RobinLeicester (talkcontribs)

Further to the above, with a bit of lateral thinking, it has occurred to me that both the tab and map data could be generated by a wikipedia template using the same input as OSM Location Map, which would avoid having to worry about lua etc at this stage. Not ideal as it makes subsequent edits more tricky, but would at least provide a starting point, to see how things develop. I will have a go at implementing that and let you know how I get on.

In the mean time, the phrase about 'raw graph data' that appears at the bottom of the maps with tables will not really make sense on a map. Is there any chance of a switch to turn that off. For OSM Location map I would much rather have it under my control, so it could just say '[Data table]' or some such thing, alongside my '[Full Screen]' option, to keep the map as tidy as possible.

And I'm guessing much harder to implement ... is there any chance of having both the table and manual data, so that a general table of data can be set up for use on lots of different articles, and then the specific marks added in for each one manually as appropriate? I am guessing not,

Thanks for such a great set of tools.

197.218.82.125 (talkcontribs)

Lua can access anything data in the commons Data namespace, so it is entirely possible to construct a mapframe and graph using the same data. The only missing piece here is probably the ability to generate files using lua, and then just about anything imaginable (even files that don't exist on commons) could be placed in a map or graph or page.

https://phabricator.wikimedia.org/T66460 https://phabricator.wikimedia.org/T120489

Yurik (talkcontribs)

@RobinLeicester You could already do this with Lua - by simply loading the table by calling mw.ext.data.get(...) and generating the custom mapframe/maplink tag with any kind of content.

197.218.91.204 (talkcontribs)

While it is true that it can be done with lua, currently it is done in a rather hacky manner using stuff like {{tag: . So one has to either accept that it will never get much usage in lua, or long term a proper library like Wikibase (https://www.mediawiki.org/wiki/Extension:Wikibase_Client/Lua) needs to be created for it.

The inherent complexity of graph, the fact that relatively simple graphs such as pie chart or force directed graphs aren't even available in the visualEditor (https://phabricator.wikimedia.org/T100357, https://phabricator.wikimedia.org/T100359), in addition to the issue of needing to arbitrarily concatenate graph json using strings makes it harder to be adopted in articles or lua modules.

So either lua needs libraries or visualeditor graph editing tool would need to be improved to make use of the new dataset software, or both.

RobinLeicester (talkcontribs)

Yurik, I have now produced a template 'en:template:OSM Location map from table' that both generates and then displays .tab and .map files using the OSM Location map parameters. It is pretty geeky to use, so is unlikely to be a mainstream solution, but does provide another way of generating external data for now.

The lack of features on .map files compared to locally supplied <mapframe> results is quite a draw-back though. With .map, I failed to get wikilinks and images to resolve, and the markers can't be numbered, which makes for a much weaker result, unless I am missing something. Is this still in progress? (I have put a comparison between a data:file and 'inline' maplink at en:User:RobinLeicester/sandbox . There is also an example of an 'OSM Location Map from table', which works pretty well. (If only it could have local content as well). But you will see how intrusive the 'raw graph data' line is.

Yurik (talkcontribs)

Yes, it's a big todo - Phab:T155216 (and should be relatively easy to fix)

Reply to "Dataset possibilites"
Geraki (talkcontribs)

FYI, I have used this graph template in the "Infobox building" in elwiki and now we have some dozens of articles displaying locator maps with this. It works great!

Yurik (talkcontribs)
Reply to "Used in infoboxes"
RobinLeicester (talkcontribs)

Is there any way of being able to include OSM external data directly into Graph:Street map with marks in the way you can with <nowiki><maplink>. Being able to show a particular administrative boundary, highway etc would be really valuable. Thanks.

Yurik (talkcontribs)
Reply to "ExternalData"
RobinLeicester (talkcontribs)

I have written a template called OSM Location map on en:wikipedia to put this template map into a frame, and do various other useful bits and pieces. At present it allows 10 markers to be shown, and is designed specifically for manual use, rather than the wikidata facilities you also provide. I am aware that there are probably parallel developments going on, which is fine if this gets supplanted, but it seemed like a good chance to find out how these maps might start being used. I have taken the chance to include a <maplink> link so that users can both see the static page map as optimised by an editor and link through to a more interactive one.

One strange bug I have come across is that when previewing a page under development, the labels all look very nice, with a fine-lined font, and with lots of colour options. But when changes are saved, all the labels become a clunky font instead, and most colours switch to black (or sometimes to the shape color. There are examples on the doc page for template:OSM Location map, or see . I get the same problem when calling the Graph: template direct - the labels - especially small font sizes - look far better in preview than for real.

Yurik (talkcontribs)

Fonts is an old problem we haven't solved yet - Phab:T127683. Also, graphs will soon get an automatic frame - Phab:T147768. Lastly, I really hope we will get <mapframe> to support most of these usecases eventually, so we can have the best of both worlds.

Reply to "template front end"
Nilfanion (talkcontribs)

Can there be an option to override the default OSM label (in the local language of the area shown), with either another language or to supress them entirely?

On WM projects, the local language of the project (eg English on en.wp or German on de.wp) would be the ideal default. The OSM-default labels are borderline useless for English users when the only text is "المملكة العربية السعودية" or "上海市"

Yurik (talkcontribs)

@Nilfanion, this is one of the biggest asks at the moment - T112948. Not exactly sure yet when we can get it resolved, but we will try to figure something out soon.

Reply to "Language of labels"

Drawing the boundaries of a given Wikidata item

2
T.seppelt (talkcontribs)

Hi,

is it possible to draw a map showing the boundaries of a country (like Germany, based on the Wikidata ID Q183 as parameter) plus the position of a city etc.? How does painting shapes with Wikidata / OSM data work?

Thanks!

Yurik (talkcontribs)
Reply to "Drawing the boundaries of a given Wikidata item"
Theklan (talkcontribs)

Is there any way to change all the points from a red dot to, let's say, an airport symbol?

Yurik (talkcontribs)

Hi, I just updated the docs with some more info. For an airport, you can use some icon image from Commons.

Theklan (talkcontribs)

It's not clear where to change it for all the icons at the same time. For example, if I want all the red dots to be an airport symbol, but it loads automatically from Wikidata... I can't put shape = foo in the top part and make it work.

Yurik (talkcontribs)

@Theklan when you are using wdqs= parameter, the SPARQL's output should include those fields. So if sparql has "img" field with the image URL, it will get used. The same way you can have a "color" field which will change default red color to some other, possibly different for each dot.

Theklan (talkcontribs)

Could it be possible to document an example of a SPARQL query in which all the dots are a, let's say, airport symbol?

Reply to "Changing all the dots color"