fix: prevent custom element markers from rendering upside down #15

Merged
ryan merged 1 commits from worktree-custom-markers into main 2026-02-20 21:33:27 +00:00

1 Commits

Author SHA1 Message Date
Ryan Hamamura
5f358fb155 fix: prevent custom element markers from rendering upside down
All checks were successful
CI / Build and Test (push) Successful in 37s
CI / Build and Test (pull_request) Successful in 35s
When a custom Element marker's rotation exceeds ±90°, normalize the
rotation into the upright range and apply scaleX(-1) to the inner
element. This keeps side-view icons (ships, vehicles) right-side up
regardless of heading direction.

Use a wrapper div for custom elements so MapLibre rotates the container
while the inner SVG can be independently flipped.
2026-02-20 11:22:49 -10:00