High Command
LibraryTemplatesGet startedPricing
Get Pro · $79

Guide

Browse everythingGetting startedThemingYour data

Site

HomeTemplatesPricingChangelog

Templates 4

Command centerProFleetProCustomer trackingProField servicePro

Ops and shell 9

App shellProOps modelProAttention queueProMorning briefProShift handoverProLane panelProOwn-fleet partsProAgent action barProCustomizable dashboardPro

Map 17

PMTiles basemapPMTiles routeTrip hologramProBasemap styleMap geometryMapLand texture and dot lensProException heatmap and risk contoursProLane arcsProShipment layerOwn fleet layerProFleet map layersCurated place labels and sitesRoute traceEdge chipsProMap key, filters and paddingMap kitPro

Time and trips 11

Time and trip modelsEvent fieldProIn-transit rowsProImpact lineProActivity barProReplay clockTime controlPlayback overlayProTrip timetableProStage rowWeek cursorPro

Figures, charts and tables 14

Sourced valueKey-figure tileFigure groupPart barBand sparklineKPI stripProChart kitPop barWaterfall cascadeMargin chartsPro13-week cash ladderProWork tableProField railProHorizon gridPro

Zones and dispatch 10

Zones modelDispatch modelProGeofence layerGeofence eventsGeofence drawProService ringsDensity heatmapJob queueProAssign dialogProStop listPro

Design system 3

ThemeShared helpersUI primitives

Routing 3

Offline road routerAustin road graphAustin areas

Libraries 2

Fleet coreRoute core
High Command

Map, fleet and ops-console components for React. Built in-house, copied into your app with the shadcn CLI.

Product

  • Library
  • Templates
  • Pricing
  • Changelog

Build

  • Get started
  • Accessibility
  • Trip hologram

Templates

  • Command center
  • Fleet
  • Field service

New pieces by email. A short note when a release lands.

One email per release. Unsubscribe any time.

© 2026 High Command Pro licenseTermsPrivacyRefundsMap data © OpenStreetMap contributors · OpenFreeMap
Library/Map

Map geometry

Great-circle lanes, antimeridian-safe framing, playback tracks, risk contours (marching squares), edge-chip spreading and Fleet map features.

Free · MITLibrary@highcommand/map-geo4 files
See it in context
greatCircle(): the true shortest path, unwrapped across 180°
Framed by wrapBounds: 113.9°E → 97.7°W, across the antimeridianShenzhen → Long Beach playback · day 1 of 14

Installation

$ npx shadcn@latest add @highcommand/map-geo

Copies the source into your project and pulls in what it needs (1 other item). First time? Add the registry to components.json.

API

22 functions
  • nearestSegment(path: LngLat[], p: LngLat): number

    Squared distance in degrees from p to the nearest segment of `path`; returns that segment's index.

  • greatCircle(a: LngLat, b: LngLat, maxSegments?: number): LngLat[]

    Points along the great circle a -> b (inclusive). Longitudes are unwrapped (they may run past ±180) so a trans-Pacific arc is one continuous line, not a stroke across the whole map. Short hops (< ~50 km) stay two points.

  • unwrap(line: LngLat[]): LngLat[]

    Make longitudes continuous along a line (each step < 180 degrees).

  • arcPath(points: LngLat[]): LngLat[]

    A polyline whose every segment is a great-circle arc (unwrapped end to end).

  • legLine(a: LngLat, b: LngLat, roads?: Roads | null | undefined): LngLat[]

    One leg as the map draws it: on its stored road when the company has one, else as a great-circle arc.

  • routeLine(path: readonly LngLat[], roads?: Roads | null | undefined): LngLat[]

    A shipment's planned route as one line, leg by leg (legLine).

  • laneLine(l: Pick<Lane, "from" | "to" | "keys">, roads?: Roads | null | undefined): { line: LngLat[]; road: boolean; }

    A lane's line: the stored road of the first of its legs that has one (one canonical road per lane), else the arc between its ends.

  • lanesOf(shipments: readonly LaneShipment[]): { lanes: Lane[]; byShipment: Map<string, string[]>; }

    Lanes: every leg of every shipment's planned path, merged when both ends round to the same 0.1 degree. Volume is the number of shipments on it; colour is its worst status (a lane of only not-moving shipments is neutral).

  • wrapBounds(points: readonly { lat: number; lng: number; }[]): { west: number; east: number; south: number; north: number; } | null

    The smallest longitude window that holds every point (it may cross the antimeridian: west < 180 < east), plus the latitude range. A network from Shenzhen through Long Beach to Rotterdam frames the Pacific and the Americas, not the empty Atlantic view.

  • trackAt(tr: Track | undefined, t: number): { lat: number; lng: number; } | null

    Where a track was at time `t`: between two close samples, the straight line between them; across a gap, the last known point; outside, its first or last sample.

  • roadKeyOf(a: LngLat, b: LngLat): string

    A stored road's key: both endpoints as "lat,lng" rounded to 4 decimals (about 11 m), from>to.

  • densityGrid(pts: ScreenPt[], cols: number, rows: number, cell: number, sigma?: number): Float32Array<ArrayBufferLike>

    A grid of `cols` × `rows` cells of `cell` px: each point adds a Gaussian bump (σ px) weighted by how much needs attention there.

  • isoSegments(g: Float32Array<ArrayBufferLike>, cols: number, rows: number, cell: number, level: number): [number, number, number, number][]

    Marching squares: the iso-line at `level` through the grid, as segments in px ([x1, y1, x2, y2]). Saddles take the centre's side.

  • spreadAlong(want: readonly number[], len: readonly number[], lo: number, hi: number, blocked: readonly Span[]): number[]

    Centres along one side for chips of the given lengths, wanted at `want` (same order), within [lo, hi]: in order along the side, each at least its half-length plus the gap from the one before, and off every blocked span. Where the side runs out, they are packed back from its end. Returns the centres in the input order.

  • edgeChipSize(n: number): { w: number; h: number; }

    A chip's size: an arrow, the count, the padding (command.css .cmd-edge).

  • vehicleFeatures(vehicles: readonly FleetMapVehicle[], selectedVehicle: string | null): Feature[]

    One point per vehicle that has a fix. `c` is the display status, `k` the vehicle kind (the glyph), `h` the heading (degrees; -1 when unknown).

  • routeFeatures(d: { planned_path: readonly LngLat[]; breadcrumb: readonly LngLat[]; stops: readonly FleetMapStop[]; depot?: { lat: number; lng: number; name: string; } | null | undefined; display: StatusColor; }): { ...; }

    The planned path (dashed), the driven breadcrumb (solid) and each stop (numbered) for one route.

  • stopFeatures(stops: readonly FleetMapStop[], depot?: { lat: number; lng: number; name: string; } | null | undefined): Feature[]

    Point features for a route's stops (numbered by sequence, the next open stop flagged `key`, depot returns skipped), plus the depot when given.

  • simplifyPath(pts: readonly LngLat[], tol?: number): LngLat[]

    Douglas-Peucker in degrees: keeps the shape of a line with far fewer points.

  • breadcrumbLine(crumbs: readonly (readonly [number, number, ...number[]])[]): LngLat[]

    The breadcrumb as a line, thinned so a day's pings do not become thousands of vertices.

  • boundsOf(points: readonly LngLat[]): [LngLat, LngLat] | null

    [[west, south], [east, north]] of some points, or null when there are none. A single point gets a small box so the map can still frame it.

  • kindLabel(k: string): string

    Display name for a vehicle kind ("Box truck"); an unknown kind comes back as is.

Dependencies

npm
None beyond React
Builds on
Shared helpers
Used by
MapShipment layerFleet map layers
Pro pieces built on this
Exception heatmap and risk contours ProLane arcs ProEdge chips ProCommand center ProFleet Pro

Install this free piece now; the Pro pieces drop in on top of it, in the same app. Pro is $79 once.

PreviousBasemap styleNext Map

On this page

PreviewInstallationAPIDependencies