Module talk:TypeToColor

From Wikivoyage
Jump to navigation Jump to search

Request type and icon[edit]

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)[reply]

Do you want it shaped like an X? If so, I'll ping User:Matroc, who has done that. ARR8 (talk | contribs) 15:57, 20 January 2019 (UTC)[reply]
Playing with maplinks (kartographer) and a mapframe of the Negev Desert (Israel) would something like that below be close??

Map[edit]

Cities[edit]

  • 1 Be'er Sheva. the Biblical city of Abraham and de facto capital of the Negev Beersheba (Q41843) on Wikidata Beersheba on Wikipedia
  • 2 Arad. modern town on the edge of the Negev and convenient starting point for trips to the Judaean Desert and the Dead Sea Arad (Q152473) on Wikidata Arad, Israel on Wikipedia

Link to Center[edit]

  • 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)[reply]

Another Mapframe[edit]

Map

Initial response[edit]

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)[reply]

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)[reply]

  • 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 <maplink>.
  • 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.
  1. This was done using div to create the color box.
  2. Need the image information for the Maki symbol.
  3. Requires knowing which location or index the Point is located in order to create the link.
  4. 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.
  • Test — This was all created manually and links to the star POI on the map at the top of the page.

-- Matroc (talk) 04:23, 22 January 2019 (UTC)[reply]

Request additional colours[edit]

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. • • • Peter (Southwood) (talk): 10:40, 20 April 2019 (UTC)[reply]

@Pbsouthwood: Sure, have you got a list of types and colors you want? ARR8 (talk | contribs) 17:51, 21 April 2019 (UTC)[reply]
@ARR8:, 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, • • • Peter (Southwood) (talk): 05:23, 22 April 2019 (UTC)[reply]
@Pbsouthwood: 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 (talk | contribs) 15:24, 22 April 2019 (UTC)[reply]
@ARR8:, 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, • • • Peter (Southwood) (talk): 07:33, 23 April 2019 (UTC)[reply]
Suggested colours from the w:Web colors#X11 color names: 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, • • • Peter (Southwood) (talk): 08:00, 23 April 2019 (UTC)[reply]
@Pbsouthwood: 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 (talk | contribs) 21:21, 23 April 2019 (UTC)[reply]
@ARR8:. 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. • • • Peter (Southwood) (talk): 13:04, 24 April 2019 (UTC)[reply]
@Pbsouthwood: Yes Added |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 (talk | contribs) 23:42, 24 April 2019 (UTC)[reply]
@ARR8:. 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, • • • Peter (Southwood) (talk): 05:17, 25 April 2019 (UTC)[reply]
@ARR8:. How do I use type launch site in {{marker}}? • • • Peter (Southwood) (talk): 19:38, 25 April 2019 (UTC)[reply]
@Pbsouthwood: Shame on me for not testing. I've changed it to |type=launchsite for compatibility. ARR8 (talk | contribs) 21:32, 25 April 2019 (UTC)[reply]
@ARR8:. Still getting problems when launch site used as type in {{marker}}. Error message:
<maplink> problems:
The JSON content is not valid GeoJSON+simplestyle
Attribute "group" has an invalid value
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, • • • Peter (Southwood) (talk): 12:27, 26 April 2019 (UTC)[reply]
@Pbsouthwood: The new type works for me. Make sure there is no space in the type; see a demonstration of the type here. As for |type=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 (talk | contribs) 19:19, 26 April 2019 (UTC)[reply]
Thanks @ARR8:, it seems to be working for me now. • • • Peter (Southwood) (talk): 05:52, 27 April 2019 (UTC)[reply]
(I've edited the syntax of Pbsouthwood's message above as the syntax messed with the rest of the page --SHB2000 (talk | contribs | meta) 10:20, 28 March 2024 (UTC)[reply]

Protection of modules[edit]

Swept in from the pub

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)[reply]

Yes Done SHB2000 (talk | contribs | meta) 23:21, 5 March 2024 (UTC)[reply]
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)TCM 21:18, 11 March 2024 (UTC)[reply]