This library is not production-ready yet. Developers should use it with caution and expect breaking changes.

Targeting Reticle

Military-style targeting brackets with tracking and lock-on capabilities.

Installation

First, make sure you have the base map component installed:

npx shadcn@latest add https://www.terrae.dev/map.json

Then install the targeting reticle component:

npx shadcn@latest add https://www.terrae.dev/targeting-reticle.json

Tracking Animation

The reticle tracks towards a target and locks on when it reaches it. Combine with MapAnimatedPulse to mark the target location. The onLocked callback fires when the target is acquired.

Properties

PropTypeDescription
coordinates[number, number]Starting position [longitude, latitude] for the reticle.
target[number, number]Target position to track towards. When reached, the reticle locks on.
sizenumberOverall size of the reticle in pixels.
bracketLengthnumberLength of the corner bracket lines in pixels.
bracketThicknessnumberStroke width of the bracket lines.
gapnumberGap between the reticle edge and the brackets.
colorstringDefault bracket and crosshair color (blue).
lockedColorstringColor when locked on target (green).
lockedbooleanManually control the lock state.
trackingSpeednumberAnimation speed when tracking (0-1). Higher values are faster.
showCrosshairbooleanShow the center crosshair lines.
showCoordinatesbooleanDisplay GPS coordinates below the reticle in DMS format.
onLocked() => voidCallback fired when the reticle locks onto the target.

Use Cases

Military Drone Operations

Track reconnaissance drones and mark strategic positions on the battlefield

Wildlife Conservation

Monitor endangered species with GPS collars in protected reserves