Skip to content

map-server: interactive annotations (markers, routes, areas, circles)#505

Open
ochafik wants to merge 31 commits intomainfrom
ochafik/map-interact
Open

map-server: interactive annotations (markers, routes, areas, circles)#505
ochafik wants to merge 31 commits intomainfrom
ochafik/map-interact

Conversation

@ochafik
Copy link
Contributor

@ochafik ochafik commented Feb 26, 2026

Summary

Adds full interactivity and rich annotation support to the CesiumJS map server:

  • Unified annotation system — discriminated union (oneOf in JSON Schema) supporting marker, route (polyline), area (polygon), and circle (ellipse) annotation types
  • Interact toolnavigate, add, update, remove actions via command queue with 200ms batching
  • Streaming supportontoolinputpartial progressively renders annotations as the model streams them (skipping last potentially-truncated item)
  • Geocode tool — multi-query OpenStreetMap Nominatim search with rate limiting
  • show-map — accepts initial annotations, supports bounding box or center+radius viewport modes
  • Persistence — annotations and camera state saved to localStorage, restored on revisit
  • Copy/export — toolbar button copies all annotations as Markdown table + GeoJSON (multi-mime clipboard)
  • Canvas label billboards — DPR-aware rendered labels with rounded-rect backgrounds, anchored per annotation type
  • Fullscreen — keyboard shortcuts (Escape, Ctrl/Cmd+Enter) and toolbar button
  • Model context updates — debounced camera position + screenshot sent to model on navigation

Annotation types

Type Cesium Entity Key Fields
marker Point + label billboard lat, lon, label, color
route Polyline (clamped to ground) points[], width, dashed, color
area Polygon (fill + outline) points[], color, fillColor
circle Ellipse lat, lon, radiusKm, color, fillColor

JSON Schema

Uses z.discriminatedUnion("type", [...]) which produces proper oneOf with const discriminator values. Separate full schemas (for add) and update schemas (partial fields, for update).

Test plan

  • show-map with no annotations → globe loads at default/bbox location
  • show-map with mixed annotations → markers, routes, areas, circles render correctly
  • interact add/update/remove → annotations appear/change/disappear
  • Navigate action → camera flies to new bounding box
  • Geocode with multiple queries → results returned with coordinates and bounding boxes
  • Annotations persist across page reloads (localStorage)
  • Copy button → clipboard contains Markdown + GeoJSON
  • Streaming (ontoolinputpartial) → annotations render progressively
  • Fullscreen toggle works via button and keyboard shortcuts

🤖 Generated with Claude Code

Loading
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