Zum Inhalt springen

Modul:Marker utilities/Groups

Aus Wikivoyage
Dokumentation für das Modul Marker utilities/Groups[Ansicht] [Bearbeiten] [Versionsgeschichte] [Aktualisieren]

Usage

This module supplies a table with the properties of the {{Marker}}/{{vCard}} groups like color, translation and the adapted translation without special characters for the use on Kartographer maps.

Versionsbezeichnung auf Wikidata: 2024-07-08 Ok!

Meaning of the sub-keys

  • color: hexadecimal color value including # sign,
  • alias: alias for keys like mask, do, see, etc. for internationalization,
  • is: type of data set: system only for internal use, color represents a color instead of a logical key name. Don’t change this sub-key.
  • label: group name for the vCard/listing editor and the Kartographer-map layers tool. If label is missing alias or the key values are used,
  • withEvents: marks groups where events belong to

Don’t change the names of the keys like mask, do, see, etc.

Enter the map, label or alias name to the showAll parameter in this and Mapshape utilities/i18n modules, namely the value of the first sub-key used in that succession.

Group overview

Karte
Map of group colors

White numbers

1 error 1 area 1 buy 1 do 1 drink 1 eat 1 go 1 health 1 nature 1 other 1 populated 1 see 1 sleep 1 view 1 purple 1 red

Black numbers

1 religion 1 cosmos 1 gold 1 lime 1 mediumaquamarine 1 orange 1 plum 1 silver

In Module:Marker utilities, the background color value for the type error (magenta, #FF00FF) serves as the relative luminance threshold (0.2848) which is greater than the value of about 0.211 as proposed by Github user Makizushi. But the color estimation at the Wikimedia’s map server seems to be different from that of Makizushi.

Verwendung in anderen Modulen

Dieses Modul ist notwendig für die Ausführung folgender Module. Bei Anpassungen sollte die Funktionstüchtigkeit der folgenden Module geprüft werden. Benutze dazu auch diese Tracking-Kategorie um Fehler zu finden, die sich dann auf Artikel auswirken:

References

  • Relative luminance, Web Content Accessibility Guidelines (WCAG) 2.0, W3.org. The minimum contrast ratio ( (L-lighter + 0.05) / (L-darker + 0.05) ) should be at least 4.5:1
  • Makizushi’s code for markers. It seems that the relative luminance threshold of about 0.211 differs from that of Kartotherian’s definition. The pushpin’s text color is estimated at the Wikimedia’s map server and not by Makizushi’s script.
  • Kartotherian
Hinweise
--[[
	Returning an array with group properties.
	Please use only quotation marks instead of apostrophs for JSON export.
	Please do not specify empty strings: let the parameter undefined.

	Dependencies:
	- MediaWiki:ListingInfo.js, makiIcons array
--]]

return {
	-- administration
	moduleInterface = {
		suite  = "Marker utilities",
		sub    = "groups",
		serial = "2024-07-08",
		item   = 65445315
	},

	-- Default mapframe/maplink show parameter
	-- also to set in MediaWiki:MapTools.js: defaultShow
	showAll = "Maske,Track,Aktivität,Anderes,Anreise,Ausgehen,Aussicht,Besiedelt," ..
		"Fehler,Gebiet,Gesundheit,Kaufen,Küche,Natur,Religion,Sehenswert,Unterkunft," ..
		"aquamarinblau,cosmos,gold,hellgrün,orange,pflaumenblau,rot,silber,violett",

	groups = {
		["error"]   = { color = "#FF00FF", is = "system", label = "Fehler", alias = "magenta" },
		mask        = { color = "#FF00FF", is = "system", label = "Maske" },
		track       = { color = "#FF00FF", is = "system", label = "Track" },

		area        = { color = "#800000", label = "Gebiet", default = "region", alias = "maroon" },
		buy         = { color = "#008080", label = "Kaufen", default = "shop", alias = "teal" },
		["do"]      = { color = "#808080", label = "Aktivität", default = "sports", alias = "grey", withEvents = "1" },
		drink       = { color = "#2F4F4F", label = "Ausgehen", default = "bar", alias = "darkslategray" },
		eat         = { color = "#D2691E", label = "Küche", default = "restaurant", alias = "chocolate" },
		go          = { color = "#A52A2A", label = "Anreise", default = "station", alias = "brown" },
		health      = { color = "#DC143C", label = "Gesundheit", default = "hospital", alias = "crimson" },
		nature      = { color = "#228B22", label = "Natur", default = "landscape", alias = "forestgreen" },
		other       = { color = "#808000", label = "Anderes", default = "office", alias = "olive" },
		populated   = { color = "#0000FF", label = "Besiedelt", default = "town", alias = "blue" },
		religion    = { color = "#DAA520", label = "Religion", default = "church", alias = "goldenrod" },
		see         = { color = "#4682B4", label = "Sehenswert", default = "monument", alias = "steelblue" },
		sleep       = { color = "#000080", label = "Unterkunft", default = "hotel", alias = "navy" },
		view        = { color = "#4169E1", label = "Aussicht", default = "viewpoint", alias = "royalblue" },

		-- please do not use colors already used for additional groups listed above

		cosmos      = { color = "#FFCFCF", is = "color", label = "cosmos" }, -- instead of former type target, FFCCCC
		gold        = { color = "#FFD700", is = "color", label = "gold" },
		lime        = { color = "#BFFF00", is = "color", label = "hellgrün" },
		mediumaquamarine = { color = "#66CDAA", is = "color", label = "aquamarinblau" },
		orange      = { color = "#FFA500", is = "color", label = "orange" },
		plum        = { color = "#DDA0DD", is = "color", label = "pflaumenblau" },
		purple      = { color = "#800080", is = "color", label = "violett" },
		red         = { color = "#FF0000", is = "color", label = "rot" },
		silver      = { color = "#C0C0C0", is = "color", label = "silber" }
	}
}