Skip to content

Draw marker labels into tiles as text, add vertical labels - #21

Merged
wf9a5m75 merged 1 commit into
developfrom
feat/tile-labels
Nov 5, 2026
Merged

wf9a5m75 merged 1 commit into
developfrom
feat/tile-labels

Conversation

@wf9a5m75

@wf9a5m75 wf9a5m75 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Port of the iOS tile-label work.

  • Labels on tiled markers are drawn as text after all bodies, so a body never covers a label.
  • labelWritingMode ("vertical-rl") on ColorDefaultIcon / ImageIcon for vertical labels; ImageIcon gains label params.
  • Declutter: a labelled marker wins its cell; ties between labelled markers go by world key.
  • Query extent covers each labelled icon's overhang (recorded at creation, max scale per zoom, sample-state fallback), so a label reaching in from the next tile is not cut at a seam.
  • OverlayCollector now listens to states written straight into its flow. Markers(list) wrote there without registering listeners, so in-place changes (e.g. an icon swapped to relabel) never reached the controller.

New types are @InternalMapConductorApi; api/android-sdk-core.api updated.

Verified on Pixel 5a with the street-tree sample (MapLibre).

…in-place changes from Markers(list)

Same design as ios-sdk-core#23.

- Tiles draw the body (dot, pin) as a shared bitmap and the label text after
  all bodies, so relabelling many markers no longer bakes a bitmap per text
  and position. Bodies are shared between icons differing only in label. A
  labelled marker wins its declutter cell; among labelled ones the world
  position decides, so neighbouring tiles agree.
- ImageIcon gains the label options ColorDefaultIcon has, plus copy(). The
  pin and ImageIcon share one layout computation (IconLabelLayout).
- labelWritingMode (CSS writing-mode: horizontal-tb, vertical-rl): vertical
  text stacks one glyph per em with OpenType 'vert', so the long-vowel mark
  turns and small kana sit as in vertical type.
- Labelled icons record their overhang when created, and tiles search by it,
  so a label reaching in from the next tile is not cut right after a relabel.
- OverlayCollector listens to states written straight into its flow. Since
  the switch to states reporting their own changes, Markers(list) wrote its
  list there without listening, and an in-place change to such a marker (an
  icon swapped to relabel a street tree) never reached the controller.
@wf9a5m75
wf9a5m75 merged commit 59287d8 into develop Nov 5, 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