Skip to content

Stack markers by the shared draw order - #20

Merged
wf9a5m75 merged 2 commits into
developfrom
fix/marker-zindex-order
Nov 12, 2026
Merged

wf9a5m75 merged 2 commits into
developfrom
fix/marker-zindex-order

Conversation

@wf9a5m75

Copy link
Copy Markdown
Contributor

Summary

Feed this provider's native marker order from the shared MarkerDrawOrder helper (core PR), so markers stack the same way on every provider:

  1. larger zIndex ?? 0 in front;
  2. equal zIndex → lower on screen in front, re-sorted when the map rotates;
  3. same screen row → left in front. Independent of add order.

Depends on the core fix/marker-zindex-order PR.

Verification

Two overlapping markers with equal zIndex (north/south), plus a zIndex: 1 marker added first vs a null-zIndex marker added last. Rotating 0° → 180° without re-adding brings the north marker to the front; zIndex 1 stays in front at every heading.

Commits

  • Apply marker zIndex through zPriority
  • Re-key annotation zPriority when the map rotates

Annotation views had no zPriority, so MapKit chose the order and
zIndex did nothing. Map MarkerDrawOrder onto zPriority (500 + 5 x key,
zIndex clamped to +-99) and reset it on reused views.
Same-zIndex markers stack lower-on-screen in front. On a heading change
the renderer rewrites zPriority on the visible annotation views; views
created later pick up the current frame.
@wf9a5m75
wf9a5m75 merged commit 789cacd into develop Nov 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant