Module talk:TypeToColor

Request type and icon
I would like to test out an idea related to review images on links to articles and adding access to dynamic map at top of pages,see Washington, D.C./sandbox and User:Traveler100/sandbox-city. Need some simple marker on page and on map (will mark initial map center). Would it be possible to create a marker type for this? Suggest light green with or grey with. --Traveler100 (talk) 08:26, 20 January 2019 (UTC)
 * Do you want it shaped like an X? If so, I'll ping User:Matroc, who has done that. ARR8 (User talk:ARR8 | Special:Contributions/ARR8) 15:57, 20 January 2019 (UTC)
 * Playing with maplinks (kartographer) and a mapframe of the Negev Desert (Israel) would something like that below be close??

Link to Center

 * This  should bring you to the Center of the map which is a point with an x in it..
 * Could probably make a separate test Module to create the maplinks. - As far as the X goes - could probably make it a simpler X? The X can be set to a particular size. The maplinks can be edited after creation. The link pointer with an x in it can be modified to a simple almost invisible spot on the map. -- Good day! Matroc (talk) 22:35, 20 January 2019 (UTC)

Another Mapframe
 {"type": "FeatureCollection", "features":[ {		"type": "Feature", "geometry": { "type":"MultiLineString", "coordinates": [35.144012,31.320703],[35.285433,31.199814,35.285433,31.320703],[35.144012,31.199814]},	"properties":{ "title": "Map Centered on Arad", "description": "", "stroke":"#BFFF00", "stroke-width":6, "stroke-opacity": 1, } }]}

Initial response
This is useful input. Was thinking of something a little smaller regarding the center cross of the map. Actually the map tab icon with small cross shown above would suffice. Really wanted something that does not distract to much and is visibly different from a POI marker. Just needs to be in marker template so that it is the first listing with image in an article. (to control preview images. --Traveler100 (talk) 06:23, 21 January 2019 (UTC)
 * The point type is not a bad option. See Bitola. Is it possible to change the grey numbered box to the map icon? --Traveler100 (talk) 09:10, 21 January 2019 (UTC)


 * The Point with a cross in it seems to be a fair option.
 * The X I drew can be reduced to a much smaller size.
 * Image and other descriptive information can be put within the &lt;maplink&gt;.
 * I think that code changes would be necessary for the templates and Modules involved. Using marker you get numbers though in mapframe/maplink you can do numbers,letters,symbols and blank for the points on a map. To get the Maki symbol in text would require more than I think I could do. I think it was discussed quite a while ago to do it but was dropped. I would not be surprised if the German or Russian wikivoyage people might have done it.
 * Below is an attempt to use the star symbol as a link to the map above. It is a hodgepodge of code and is not really suitable for all except for the adventurous.
 * This was done using div to create the color box.
 * Need the image information for the Maki symbol.
 * Requires knowing which location or index the Point is located in order to create the link.
 * In addition, a maplink was used to create the Point on the mapframe.
 * We definitely need a decent programmer to look at doing this to make all compatible with existing templates etc.

-- Matroc (talk) 04:23, 22 January 2019 (UTC)
 * Maki2-star-18.svg Test &mdash; This was all created manually and links to the star POI on the map at the top of the page.

Request additional colours
I need a few more colours for use in travel topics, specifically diving. I can work around by using something like type=eat for slipways, but that lacks elegance and will be confusing for later editors who will probably want to "correct" it to "listing", which is already used elsewhere for service listings. I do not want to use pale colours like lime amd gold where the contrast between the backround and white number is poor as I have difficulty reading them and they fail WMF accessibility recommendations. Please ping with reply. &bull; &bull; &bull; Peter (Southwood) (talk): 10:40, 20 April 2019 (UTC) The JSON content is not valid GeoJSON+simplestyle Attribute "group" has an invalid value
 * Sure, have you got a list of types and colors you want? ARR8 (User talk:ARR8 | Special:Contributions/ARR8) 17:51, 21 April 2019 (UTC)
 * , I think that just colours is most versatile at this point. Maybe later things may stabilise to the extent that type names would be useful too, but I would want a bit of consensus on that. At this point a darkish orange, teal, and purple would probably be sufficient. In case it is not a default property, the marker template should put a balloon/inverted teardrop pointer on the map for these types. Thanks, &bull; &bull; &bull; Peter (Southwood) (talk): 05:23, 22 April 2019 (UTC)
 * I think defining the types would be better in the long run. If we end up needing to change a color for accessibility or other unforeseen reasons, it would be simpler to change the color code here than to rename the color and have to change every listing across multiple articles, too. If you think consensus is needed, then maybe we should sort that out first (though I can't see much reason to oppose this). In either case, which types were you thinking of using?
 * As for the icon, that's not handled in this module, but maybe some logic could be added to listing to switch the icon if one of these types is specified. ARR8 (User talk:ARR8 | Special:Contributions/ARR8) 15:24, 22 April 2019 (UTC)
 * , If I provide a list of types I assume they can be easily renamed if necessary?
 * On that assumption, list of types follows: launch site, dive centre, dive site, reef dive, wreck dive, muck dive, shore dive, boat dive, offshore dive, drift dive, inland dive, altitude dive, cave dive.
 * It will be unusual for all of these to be used on the same map, but possible.
 * It is unlikely that these types will be used on regular destination pages, so colours used for existing points of interest at destinations can be used again for dive topic points of interest. This could conceivably also happen for other travel topics, but would presumably just be a matter of setting aliases.
 * I am not fussy about what colour is used for any specific dive topic point of interest type, and assume that these could be easily changed if necessary, for example if a consensus decided that the original choice could be improved.
 * I don't follow the comment about the icon switching. The standard coloured and numbered rectangle on the topic page is fine, and the standard upside down teardrop on the map is fine. Other plain geometric shapes with no special meaning would also be fine. Cheers, &bull; &bull; &bull; Peter (Southwood) (talk): 07:33, 23 April 2019 (UTC)
 * Suggested colours from the w:Web colors: Black, Gray, Red, Maroon, Purple, Blue, ForestGreen, Teal, DeepPink, Olive, LimeGreen, DarkOrange, DarkGoldenrod, but feel free to tweak if you think something else will work better in way of contrast between map icons and legibility of white text. Cheers, &bull; &bull; &bull; Peter (Southwood) (talk): 08:00, 23 April 2019 (UTC)
 * That's a lot of types. Do these all need to be differentiated on the map? Don't forget that each PoI will be numbered, and that will aid readers in cross-referencing. Broader types similar in scope to our usual see, do, eat, etc. distinction would probably be optimal.
 * Renaming is not trivial for the same reason colors are not preferred, but changing the color would be very simple. With that in mind, does anything change?
 * Disregard about the icon - I misunderstood your request. ARR8 (User talk:ARR8 | Special:Contributions/ARR8) 21:21, 23 April 2019 (UTC)
 * . Yes, a lot of types. That is why I originally thought that a couple of extra colours would be easier, because there may never be a page where all the types are needed together, and a colour can be used for whatever is needed at the time. There is also a numbering issue. Some destinations have more than 99 dive sites, so the numbering system chokes, and splitting the destination may not be useful for other reasons. Mostly the existing colours are enough, but I have recently has a case where I need two more and don't want to use the low contrast ones available. For the present I could get by with one additional colour type, perhaps Purple, and one additional POI type, launch site, maybe in DarkOrange. This would require occasioanally using colours inconsistently between articles, but I don't know if anyone else would even notice. &bull; &bull; &bull; Peter (Southwood) (talk): 13:04, 24 April 2019 (UTC)
 * ✅ launch site. Purple already exists as a type, so that should work. Anything else needed? As an aside, it seems to me that it would be beneficial for the reader to have a consistent color scheme across the dive articles, but this is, of course, up to you. ARR8 (User talk:ARR8 | Special:Contributions/ARR8) 23:42, 24 April 2019 (UTC)
 * . I don't know yet how often this would be needed. If it turns out to be fairly frequent, or if it turns out to be confusing, we can revisit more types. If only once or twice, it is unlikely to be a problem and may be sufficient. Time will tell. Thanks for your assistance. I will now go and test if it is sufficient. If you hear nothing further, it is probably working well enough not to need fixing, or someone may have thought of a completely different way to deal with the problem. Cheers, &bull; &bull; &bull; Peter (Southwood) (talk): 05:17, 25 April 2019 (UTC)
 * . How do I use type launch site in marker? &bull; &bull; &bull; Peter (Southwood) (talk): 19:38, 25 April 2019 (UTC)
 * Shame on me for not testing. I've changed it to launchsite for compatibility. ARR8 (User talk:ARR8 | Special:Contributions/ARR8) 21:32, 25 April 2019 (UTC)
 * . Still getting problems when launch site used as type in marker. Error message:
 * problems:


 * Maybe I have underestimated the complexity of the changes needed. Type=purple seems to work fine for the inline marker, but does not show on the Mapframe map. It does show up on the full page map when clicked. I see it is listed as a deprecated type. Should I be requesting help at Template:Marker or Template:Mapframe? Cheers, &bull; &bull; &bull; Peter (Southwood) (talk): 12:27, 26 April 2019 (UTC)
 * The new type works for me. Make sure there is no space in the type; see a demonstration of the type here. As for purple, a standard group needs to be specified when using it for it to appear in mapframes. See here. Let me know if there are further difficulties. ARR8 (User talk:ARR8 | Special:Contributions/ARR8) 19:19, 26 April 2019 (UTC)
 * Thanks, it seems to be working for me now. &bull; &bull; &bull; Peter (Southwood) (talk): 05:52, 27 April 2019 (UTC)
 * (I've edited the syntax of Pbsouthwood's message above as the syntax messed with the rest of the page -- SHB2000  (talk &#124; contribs &#124; meta) 10:20, 28 March 2024 (UTC)

Sometimes, additional colors are useful. That's why there is a small set of (physical) color types. But it will become more and more difficult to differentiate points of interest with increasing number of colors. At the German Wikivoyage we introduced only three new types (strictly speaking "groups") and colors for health, nature, and religion. The splitting of see into see, nature and religion helps to use only numbers which are smaller than 100. Additionally, for every new type and color you need a name for the map-controls layer (see variable args.show in Module:Marker). And finally, it is impossible to do this with all other sights and activities which can be imagined.

At German Wikivoyage we expanded the meaning of types. There are now about 600 types (for instance dive center, scuba diving, dive site, canyon, island, reef, and wreck) which will be translated to the color groups like do, see, etc. A marker can have several types (like dive site, reef, wreck), too whereas the first one defines the color. That means that there is only a limited number of colors. But every type is connected with a category like pages with marker type "wreck". Sometimes, Maki icons instead of numbers can be helpful. --RolandUnger (talk) 09:10, 30 March 2024 (UTC)

Protection of modules
Please can an admin protect Module:TypeToColor. This has been targeted by a vandal for the second time. We should also consider applying semi-protection to all modules, as a new user editing one of these is quite likely to be a vandal. AlasdairW (talk) 22:22, 5 March 2024 (UTC)


 * ✅ SHB2000  (talk &#124; contribs &#124; meta) 23:21, 5 March 2024 (UTC)
 * Agreed on semi-protection in the module namespace: while IPs certainly could have useful edits, it's more likely that they won't be. —Justin ( koavf ) ❤T☮C☺M☯ 21:18, 11 March 2024 (UTC)