/*
OpenRailwayMap Style File for JOSM
OpenRailwayMap - Copyright (C) 2023 user: mikeho
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it under certain conditions.
See https://wiki.openstreetmap.org/wiki/OpenRailwayMap for details.

Format details: https://josm.openstreetmap.de/wiki/Help/Styles/MapCSSImplementation
                https://wiki.openstreetmap.org/wiki/MapCSS/0.2
*/

meta {
	title:       "JOSM - Maxspeed as Text - 19.02.2023 - Version 1.0";
	version:     "1.0";
	description: "Style to display the maxspeed as Text on a OSM-Way.";
	author:      "mikeho";
	watch-modified: true;
}

canvas {
	default-points: true;
	default-lines:  true;
}

way|z17-["railway"="rail"] { set is_rail; }

way[ is_prop_set("is_rail", "default") ]::layer_speed_for { 
	text-offset-y:		6;
	font-size: 			18;

	text: 				concat("Vmax", 	
								has_tag_key("maxspeed")  		 ? concat(": "     , tag("maxspeed")         , " ") : "", 
								has_tag_key("maxspeed:forward")  ? concat("-forw: ", tag("maxspeed:forward" ), " ") : "", 
								has_tag_key("maxspeed:backward") ? concat("-back: ", tag("maxspeed:backward")) : ""
							);

	text-position:  	line;
	text-color:			#F44; 	text-halo-opacity: 1;
	text-halo-color:  	#202020;	text-halo-radius:  4;
	text-allow-overlap: true; 
}
