﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
22695	MAPCSS, Note on: icon-rotation: way; text-rotation: way; coordinate transformation, documentation	mikeho	team	"Hallo, 

I have some comments on the MAPCSS implementation based on my experience of displaying railway signals:

0- Preliminary remark:

Direction is given in degrees in the world coordinate system: 0° - north, 90° - east, 180° - south, 270° - west.  
In the usual coordinate system, the x-axis is oriented from west to east, the y-axis from south to north (example JOSM: text-offset-y) or from north to south (example screen, JOSM: icon-offset-y). 

1-  icon-rotation: way
{{{#!mapcss
node[...] {... icon-rotation: way; ...} 
}}}

The icon is rotated along the y-axis. This results in a 90° counter-clockwise rotation of the icon. I haven't found a way to correct this (e.g. icon-rotation: way + 90deg; or icon-rotation: get_angle_of(way) + 90deg; (function 'get_angle_of' does not exist). 

My solution: Currently, corresponding images must be stored for: 0° for normal, +90° rotated for forward, +270° rotated for backward orientation.   

In the documentation corresponding hints are missing, see https://josm.openstreetmap.de/wiki/Help/Styles/MapCSSImplementation 

In the further development of the MAPCSS implementation in JOSM, the mathematical change of the rotation (... way + 90deg ... should be possible) should be taken into account. Addition: The coordinate system should rotate accordingly (not ... icon-rotation: way; ... (y-axis to the right of way), but ... icon-rotation: (way + 90deg); .... here: x-axis right of way)    

2- Coordinate system: icon-rotation: way; 
{{{#!mapcss
node[...] {... icon-rotation: way; ...} 
}}}

The coordinate system rotates with: that's good !

3- Coordinate system: text-rotation: way;
{{{#!mapcss
node[...] {... text-rotation: way; ...} 
}}}

Coordinate system does not rotate with. The result is that text can be moved in the west-east direction, but not relative to the way. With the consequence that text (e.g. value of a button) cannot be placed exactly above the icon.     

I suggest (urgently) to create an additional possibility for positioning the text in the rotated coordinate system, e.g. text-offset-x, text-offset-y or rotated-text-offset-x, rotated-text-offset-y (analogous to icon-offset-x, text-offset-y). 

4- Documentation

Appropriate documentation is welcome, see: https://josm.openstreetmap.de/wiki/Help/Styles/MapCSSImplementation. It helps Newcommer to understand and apply. 

best begrads
mikeho
"	enhancement	new	normal		Core			mapcss, text and icon rotation	gaben
