Template talk:Mapmask

Consensus?
This template overlays a dark mask on a dynamic map, so that the topic is more clearly delineated. This is useful for the town district articles or region articles  of the lowest hierarchy level. Also, the conventional static maps were bounded in this way. Programs are available for the determination of the coordinates and the conversion  for the template Mapmask. - I ask to vote for the use of this template. -- Joachim Mey2008 (talk) 16:29, 20 July 2014 (UTC)
 * Support from me. Adds useful functionality to the dynamic maps. -- Ryan &bull; (talk) &bull; 17:47, 20 July 2014 (UTC)
 * Support. Helps make dynamic maps clearer. -Shaundd (talk) 18:45, 20 July 2014 (UTC)

Wrong mouse cursor symbol
On the area masked the mouse cursor is shown as a pointer cursor instead of a grap cursor. --RolandUnger (talk) 08:17, 25 June 2016 (UTC)

Suggestion

 * There was an issue with a mapmask in that the creator did not close the polygon thus resulting in a distorted mapmask... I would suggest that the processing include taking the first set of coordinates and adding it to the end of the polygon thus closing the loop or check and see if the the 1st set of coordinates is the same as the last set then add if missing... Just a thought -- Matroc (talk) 20:41, 7 November 2016 (UTC)


 * Probably good idea to add some guidance. Some of the Relations OpenStreetMaps are very detailed, and need a lot of simplifying to be appropriate for WV. I've had to give up a few maps based on the result you describe above. --Andrewssi2 (talk) 21:43, 7 November 2016 (UTC)

Help needed
Can someone answer my question at Wikivoyage_talk:How_to_use_dynamic_maps? --Piotrus (talk) 05:59, 14 November 2016 (UTC)

Colored area with Template:Mapmask
Hi all, using Template:Mapshape with a "type=geoshape" draws a colored area defined through its wikidata item from OpenStreetMap. If that does not exist, Template:Mapmask should be used according to How_to_use_dynamic_maps. However, this is only coloring everything except the defined area. The "mask=" parameter in the documentation seems to invert this behaviour ("if set, will show highlight instead of a mask"), however, setting this parameter, doesn't change anything. What am I doing wrong? Thanks for your help, Xsobev (talk) 15:32, 30 July 2018 (UTC)
 * It's a bit hidden/obscure, but you can use the mapshape parameters type=page and wikicommons=commons_map_file.map ... Andree.sk (talk) 17:26, 30 July 2018 (UTC)
 * Thanks for your answer and it's good to keep that in mind. For testing purposes I would like to avoid uploading files to wikicommons. Is the Mapmask template parameter "mask=" broken then? Or am I misunderstanding its purpose? Xsobev (talk) 06:43, 31 July 2018 (UTC)

Website to convert GeoJSON to Mapmask and vice versa
Hello Andree.sk, CKoerner (WMF), Matroc, Shaundd, Alexander, Yurik, Andrewssi2, RolandUnger, Mey2008, Traveler100, ϒpsilon, Whatamidoing (WMF), Selfie City. Sorry to bother you again.

I know that there is already a tool to create a mapmask out of a gpx (gpx2mapmask).
 * But sometimes I found it handy to "reverse engineer" a mapmask back into a GeoJSON.
 * Furthermore I think it is useful to go straight from GeoJSON to mapmask without the additional need to have a gpx file.

Thus I wrote a little tool which can convert GeoJSON to Mapmask and vice versa: Mapmask <=> GeoJSON Converter

I hope some of you find it helpful for your work. --Renek78 (talk) 15:30, 20 August 2018 (UTC)

Update: The tool got a bit more powerful. It is possible now to import a whole district GeoJSON saved on Commons (e.g. for Brussels) and select on a map the district to convert into Mapmask. Please see this video for an explanation: Mapmask ↔ GeoJSON Converter - How to use. --Renek78 (talk) 08:35, 11 October 2018 (UTC)


 * Renek78, this is awesome! Just in case you might be interested, there is an amazing ObservableHQ platform on which you could also implement it without having to do it on github, plus very easy to see how something is done. Just FYI :)  Thanks for doing this! --Yurik (talk) 16:20, 20 August 2018 (UTC)


 * Hey Yurik, thanks for the link. But I only see some fancy projects there. Not sure whether such a cheap javascript tool like mine has a place there... --Renek78 (talk) 09:10, 21 August 2018 (UTC)


 * Renek78, it doesn't have to be :) Take a look at my small encoder/decoder for RISON format. Use the arrows on the left to see the code for each item. You can simply clone it and just add your javascript. --Yurik (talk) 13:08, 21 August 2018 (UTC)


 * Thanks Yurik. I am going to give it a try. Seems like a nice way for others to understand what has been done.--Renek78 (talk) 13:56, 23 August 2018 (UTC)

A way to avoid the dumb mapmasks
Mapmasks to define the boundaries of district articles have one major disadvantage: They are no longer associative with the district overview map. If someone changes the district overview map of Brussels for example, the mapmasks in the respective district maps will not update.

I guess there is a rather simple solution to this problem - at least in theory. Instead of creating dumb mapmasks in the district article why not access the district geometry from the overview GeoJSON in Commons? So in the district article one had to enter:

 

to access the 3rd shape of the file, which would be our notorious Brussels International District. Calling it by the name of the district may also be possible.

This might not be too hard to implement in Kartographer and would help to keep the district maps up-to-date. I wish I could practically support, but don't know enough about Kartographer.--Renek78 (talk) 14:28, 23 August 2018 (UTC)


 * Just made a couple quick edits so the code above comes out right, Renek78. If when I did this I did something wrong, please correct. ---Selfie City (talk | contributions) 16:34, 23 August 2018 (UTC)


 * Thanks! Have to keep this nowiki tag in mind.--Renek78 (talk) 18:21, 23 August 2018 (UTC)


 * Also, I added another } to what you typed, I'm assuming that's what the code was supposed to say. ---Selfie City (talk | contributions) 18:51, 23 August 2018 (UTC)


 * An alternative is to create the district maps in Commons and then aggregate them on the city page like is done with mapshapes from OSM. One of the problems with either method is it doesn't seem like you can alter a Commons map properties from a template in WV so something coloured red in the Commons map will be red at both the city and the district level. To get around that, I've been adapting some code created by our friends at Russian Wikivoyage. A test is at Central Oregon Coast and Oregon Coast -- it's just one map on Commons, but it shows as a mapmask on the bottom-level region (Central Oregon Coast) and a coloured shape on the parent region (Oregon Coast). I haven't drafted documentation for it yet and the parameters should probably be aligned with mapshape, but it seems to work for features that are just one polygon (I haven't tested it on anything else). -Shaundd (talk) 05:51, 24 August 2018 (UTC)