view_map polyline renderer #42

Open
opened 2026-08-31 17:14:52 +02:00 by robert · 0 comments
robert commented 2026-08-31 17:14:52 +02:00 (Migrated from git.butzei.de)

Goal

Draw the map frame on the watch.

Acceptance criteria

  • Route polyline drawn with graphics_draw_line / gpath
  • Fixed position arrow at screen centre, rotated by MAP_HEADING
  • Upcoming cue markers drawn on the route
  • North indicator and a scale bar
  • Clear stale-frame indication when updates stop arriving
  • Rendering stays within the frame budget - measured, not assumed

Files

  • watchapp/src/c/view_map.c
  • watchapp/src/c/view_map.h

Notes

No basemap in v1. The route line plus the turn view is what actually matters while riding.

Update — 2026-08-31: round-native on gabbro

A heading-up centred map suits a circular display better than a rectangular one, so this should be a
proper round variant rather than a rectangle inset into the circle:

  • Round variant fills the circular viewport, with the position arrow at the exact centre
  • Scale bar and north indicator placed on the arc rather than in a corner that does not exist
  • Clipping to the circle handled via gbitmap_get_data_row_info(), not a bounding rectangle

Update — 2026-09-02: the watch projects

view_map receives route geometry in a metric frame and projects it itself (D39). This is the change
that makes zoom and re-centre instant and keeps the map alive through a dropout.

  • Project anchor-relative decimetre offsets to screen pixels: translate, scale, rotate
  • Rotation via sin_lookup() / cos_lookup() — integer only, no floating point
  • Heading-up rotation is now free, driven by MAP_HEADING
  • Scale bar computed on the watch from the current zoom; MAP_SCALE_M no longer exists
  • The map keeps drawing during a Bluetooth dropout, from the slice already in memory, with the
    rider position marked stale rather than the view freezing
  • Projection is host-testable under #68: pure integer functions over plain data, no SDK calls
## Goal Draw the map frame on the watch. ## Acceptance criteria - [ ] Route polyline drawn with `graphics_draw_line` / `gpath` - [ ] Fixed position arrow at screen centre, rotated by `MAP_HEADING` - [ ] Upcoming cue markers drawn on the route - [ ] North indicator and a scale bar - [ ] Clear stale-frame indication when updates stop arriving - [ ] Rendering stays within the frame budget - measured, not assumed ## Files - `watchapp/src/c/view_map.c` - `watchapp/src/c/view_map.h` ## Notes No basemap in v1. The route line plus the turn view is what actually matters while riding. ## Update — 2026-08-31: round-native on gabbro A heading-up centred map suits a circular display better than a rectangular one, so this should be a proper round variant rather than a rectangle inset into the circle: - [ ] Round variant fills the circular viewport, with the position arrow at the exact centre - [ ] Scale bar and north indicator placed on the arc rather than in a corner that does not exist - [ ] Clipping to the circle handled via `gbitmap_get_data_row_info()`, not a bounding rectangle ## Update — 2026-09-02: the watch projects `view_map` receives route geometry in a metric frame and projects it itself (D39). This is the change that makes zoom and re-centre instant and keeps the map alive through a dropout. - [ ] Project anchor-relative decimetre offsets to screen pixels: translate, scale, rotate - [ ] Rotation via `sin_lookup()` / `cos_lookup()` — integer only, no floating point - [ ] Heading-up rotation is now free, driven by `MAP_HEADING` - [ ] Scale bar computed **on the watch** from the current zoom; `MAP_SCALE_M` no longer exists - [ ] The map keeps drawing during a Bluetooth dropout, from the slice already in memory, with the rider position marked stale rather than the view freezing - [ ] Projection is **host-testable** under #68: pure integer functions over plain data, no SDK calls
Sign in to join this conversation.
No description provided.