Ir al contenido

Módulo:Marker utilities/Groups

De Wikiviajes, la guía libre de viajes
Icono de documentación de módulo Documentación del módulo[ver] [editar] [historial] [purgar]

Uso

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.

Version check

Designación de la versión en 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

Mapa
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.

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
Esta documentación está transcluida desde Módulo:Marker utilities/Groups/doc.
Los editores pueden experimentar en la zona de pruebas (crear) y en los casos de prueba (crear) del módulo.
Por favor, añade las categorías en la subpágina de documentación. Subpáginas de este módulo.

--[[
	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 = "máscara,sendero,área,beber,comer,comprar,dormir,error," ..
		"habitadas,hacer,ir,naturaleza,otro,religión,salud,ver,vista," .. 
		"aguamarina,ciruela,cosmos,oro,lima,naranja,violeta,plata,rojo",

	groups = {
		["error"]   = { color = "#FF00FF", is = "system", alias = { "error", "magenta" } },
		mask        = { color = "#FF00FF", is = "system", alias = "máscara" },
		track       = { color = "#FF00FF", is = "system", alias = "sendero" },

		area        = { color = "#800000", alias = { "área", "granate", "maroon" }, default = "region" },
		buy         = { color = "#008080", alias = { "comprar", "verde_azulado", "teal" }, default = "shop" },
		["do"]      = { color = "#808080", alias = { "hacer", "gris", "grey" }, default = "sports", withEvents = "1" },
		drink       = { color = "#000000", alias = { "beber", "negro", "black" }, default = "bar" },
		eat         = { color = "#D2691E", alias = { "comer", "chocolate" }, default = "restaurant" },
		go          = { color = "#A52A2A", alias = { "ir", "marrón", "brown" }, default = "station" },
		health      = { color = "#DC143C", alias = { "salud", "crimson" }, default = "hospital" },
		nature      = { color = "#228B22", alias = { "naturaleza", "forestgreen" }, default = "landscape" },
		other       = { color = "#808000", alias = { "otro", "verde_bosque", "olive" }, default = "office" },
		populated   = { color = "#0000FF", alias = { "habitadas", "azul", "blue" }, default = "town" },
		religion    = { color = "#DAA520", alias = { "religión", "goldenrod" }, default = "church" },
		see         = { color = "#4682B4", alias = { "ver", "azul_acero", "steelblue" }, default = "monument" },
		sleep       = { color = "#000080", alias = { "dormir", "azul_marino", "navy" }, default = "hotel" },
		view        = { color = "#4169E1", alias = { "vista", "azul_francia", "royalblue" }, default = "viewpoint" },

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

		cosmos      = { color = "#FFCFCF", is = "color", alias = "cosmos" }, -- instead of former type target, FFCCCC
		gold        = { color = "#FFD700", is = "color", alias = "oro" },
		lime        = { color = "#BFFF00", is = "color", alias = "lima" },
		mediumaquamarine = { color = "#66CDAA", is = "color", alias = "aguamarina" },
		orange      = { color = "#FFA500", is = "color", alias = "naranja" },
		plum        = { color = "#DDA0DD", is = "color", alias = "ciruela" },
		purple      = { color = "#800080", is = "color", alias = "violeta" },
		red         = { color = "#FF0000", is = "color", alias = "rojo" },
		silver      = { color = "#C0C0C0", is = "color", alias = "plata" }
	}
}