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
Owner

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.

Uses a wrapper div for custom elements so MapLibre rotates the container while the inner SVG can be independently flipped.

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. Uses a wrapper div for custom elements so MapLibre rotates the container while the inner SVG can be independently flipped.
ryan added 1 commit 2026-02-20 21:32:29 +00:00
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
5f358fb155
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.
ryan merged commit 15fda48844 into main 2026-02-20 21:33:27 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ryan/via#15