Skip to content

Label street trees on the web and keep label sides across pans - #40

Merged
wf9a5m75 merged 2 commits into
developfrom
feat/street-tree-labels
Nov 6, 2026
Merged

wf9a5m75 merged 2 commits into
developfrom
feat/street-tree-labels

Conversation

@wf9a5m75

@wf9a5m75 wf9a5m75 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Port of the android-sdk / ios-sdk street-tree labels to examples/basic.

Changes

  • From zoom 16, each visible tree is labelled with its species. streetTreeLabels.ts chooses one side per road: vertical text above/below a horizontal road, horizontal text left/right of a vertical one.
  • A road keeps its previous side while that side still places at least 2/3 as many labels as the best side, so panning no longer flips labels.
  • Labels are chosen again whenever the camera stops (onCameraMoveEnd). On first load, when the map reports no visible region, a box around the centre is used instead.
  • ?camera=lat,lng,zoom opens the page at a given spot.

Depends on

Both are merged; js-sdk-core and react-for-here now point at their merge commits (c7fb94d).

Verification

Headless Chrome, DPR 2: labels appear from zoom 16, keep their side across pans, and are the same size on MapLibre, Google Maps, OpenLayers, Leaflet, deck.gl, Longdo, Mapbox, TomTom, MapTiler, Mappls and HERE.

Port of the android-sdk / ios-sdk street-tree labels. From zoom 16 each
visible tree is labelled with its species, placed by a per-road chooser
(vertical text above/below the road, horizontal left/right). Each road keeps
its previous side while it still places at least two thirds as many labels
as the best side, so panning no longer flips labels. Labels are chosen again
whenever the camera stops; on the first load, where web maps report no
visible region, a box around the centre stands in. `?camera=lat,lng,zoom`
opens the page at a given spot.
js-sdk-core#23 adds labelWritingMode and draws tile labels separately;
react-for-here#10 fixes the half-size marker tiles on HERE.
@wf9a5m75
wf9a5m75 marked this pull request as ready for review November 6, 2026 16:45
@wf9a5m75
wf9a5m75 merged commit 163bbed into develop Nov 6, 2026
5 checks passed
@wf9a5m75
wf9a5m75 deleted the feat/street-tree-labels branch November 6, 2026 16:49
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