Enter and exit events from a live vehicle feed against zones: seeds silently on the first update and for new vehicles or zones, counts vehicles inside each zone.
$ npx shadcn@latest add @highcommand/geofence-eventsCopies the source into your project and pulls in what it needs (1 other item). First time? Add the registry to components.json.
useGeofenceEvents(vehicles: readonly Tracked[], geofences: readonly Geofence[], { limit, onEvents }?: { limit?: number | undefined; onEvents?: ((e: GeofenceEvent[]) => void) | undefined; }): { events: GeofenceEvent[]; counts: Record<...…Enter and exit events from a live vehicle feed: point in polygon on every update, diffed against the last. The first update, vehicles just appeared and zones just added seed silently instead of flooding the feed. Returns the recent events (newest first), the vehicles inside each zone and each vehicle's zones. `onEvents` fires once per new batch (a toast, a webhook).