I am working on placing tile symbols on a grid and aiming to achieve the following:
- Utilize tile coordinates for symbol placement (e.g.
4,2
instead of85,43
) - Define the vertices of symbols using pixel coordinates (not tile coordinates)
- Rotate symbols around their center without specifying absolute coordinates.
I have solutions for the first two requirements, but I am struggling with the third. Currently, I can rotate the tile at 4,2
by a quarter turn using the following code:
<!-- 10/21 = 0.47619047619 -->
<use x="4" y="2" href="#rooftop-0" class="theme-0" transform="rotate(90 4.476 2.476)" />
However, I find it redundant to specify the tile coordinates twice. Ideally, I would prefer a solution like this:
<use x="4" y="2" href="#rooftop-0" class="theme-0 rotate-1" />
Although defining .rotate-1
in the stylesheet does not seem to affect the rotation. Perhaps adjusting the symbol coordinates or viewBox could help?
Alternatively, manually changing the vertices to achieve different orientations is an option, but not ideal.
Despite the challenges, here is the current state of the project:
Is there a more efficient way to achieve the desired rotation around the symbol's center?