Skip to content

feat: center map and dynamic radius - #65

Merged
codeflight1 merged 1 commit into
mainfrom
centerMap
Aug 2, 2026
Merged

feat: center map and dynamic radius#65
codeflight1 merged 1 commit into
mainfrom
centerMap

Conversation

@ConnorNeed

Copy link
Copy Markdown
Member

This pull request enhances the BreadcrumbTrail component to improve the visualization and accuracy of breadcrumb data on the map. The main updates include displaying the GPS covariance as a red accuracy circle, showing altitude and accuracy information, and adding a re-center functionality. These changes provide users with more precise location context and better map interaction.

Breadcrumb accuracy visualization:

  • The Breadcrumb type now includes covarianceRadius (derived from GPS covariance data) and optional altitude, both extracted from incoming /fix messages. [1] [2] [3]
  • A red Circle is rendered around the latest fix to visualize location accuracy (2σ radius) on the map.

User interface improvements:

  • The info panel now displays the latest fix's altitude and accuracy (covariance radius) in meters.
  • A new "Re-center" button is added, allowing users to quickly center the map on the latest fix; the map also auto-recenters on the first fix received. [1] [2] [3] [4]
  • Minor UI tweaks, such as spacing between the "Clear" and "Re-center" buttons.

These enhancements make the breadcrumb trail more informative and interactive for users monitoring live GPS data.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enhances the BreadcrumbTrail map overlay to provide better context for live GPS fixes by visualizing accuracy, surfacing additional fix metadata, and improving map navigation via re-centering.

Changes:

  • Derives and stores a covarianceRadius (2σ) and optional altitude from incoming /gps/fix messages.
  • Renders a red accuracy Circle around the latest fix and displays altitude/accuracy in the info panel.
  • Adds initial auto-recenter on first fix and a user-triggered “Re-center” button.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/components/panels/MapView.tsx Minor export formatting cleanup.
src/components/BreadCrumbTrail.tsx Adds covariance-derived accuracy radius, accuracy circle rendering, altitude/accuracy display, and re-centering behavior.
Suppressed comments (2)

src/components/BreadCrumbTrail.tsx:8

  • leaflet is imported as L but never used in this file, which will typically fail lint/TS checks and increases bundle size. Remove the unused import (or use it if needed).
import ROSLIB from 'roslib';
import L from 'leaflet'

src/components/BreadCrumbTrail.tsx:74

  • clearBreadcrumbs clears state but does not reset hasRecenteredRef, so after clicking Clear the next “first fix” will not auto-recenter even though the UI is effectively starting over. Reset the ref when clearing so the initial auto-recenter behavior remains consistent.
  const clearBreadcrumbs = () => {
    setBreadcrumbs([]);
    setLastFix(null);
  };

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ConnorNeed
ConnorNeed requested a review from codeflight1 August 2, 2026 17:19
@codeflight1
codeflight1 merged commit d8a68b3 into main Aug 2, 2026
2 checks passed
@codeflight1
codeflight1 deleted the centerMap branch August 2, 2026 19:21
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.

3 participants