mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-04 01:44:13 +00:00
feat(assistant): hike, walk and route cards with their lines on the map, and "Plan this"
This commit is contained in:
@@ -2,6 +2,7 @@ import type { ViewportPadding } from '../../utils/mapViewport';
|
||||
import { useAssistantMarkerClasses } from './assistantCamera';
|
||||
import { AssistantCameraController } from './AssistantCameraController';
|
||||
import { AssistantGhostLayer } from './AssistantGhostLayer';
|
||||
import { AssistantGhostLineLayer } from './AssistantGhostLineLayer';
|
||||
import { useReportViewLeaflet } from './assistantViewport';
|
||||
import type { AssistantMapProps } from './mapViewContract';
|
||||
|
||||
@@ -15,15 +16,20 @@ interface AssistantMapLeafletProps {
|
||||
|
||||
/**
|
||||
* Everything the assistant does on the Leaflet map, mounted inside the map
|
||||
* container as one child, so MapView only hands its props on: the ghosts,
|
||||
* the camera, the pop and pulse on the real pins, and the part of the map
|
||||
* the assistant is told is on screen.
|
||||
* container as one child, so MapView only hands its props on: the routes
|
||||
* its cards show, the ghosts, the camera, the pop and pulse on the real
|
||||
* pins, and the part of the map the assistant is told is on screen.
|
||||
*/
|
||||
export function AssistantMapLeaflet({ assistant, padding, markerEl }: AssistantMapLeafletProps) {
|
||||
useAssistantMarkerClasses(markerEl, assistant.poppedPlaceIds, assistant.assistantPulsePlaceId);
|
||||
useReportViewLeaflet();
|
||||
return (
|
||||
<>
|
||||
<AssistantGhostLineLayer
|
||||
lines={assistant.assistantRouteLines}
|
||||
onHover={assistant.onAssistantRouteHover}
|
||||
onPoint={assistant.onAssistantRoutePoint}
|
||||
/>
|
||||
<AssistantGhostLayer
|
||||
ghosts={assistant.assistantGhosts}
|
||||
hoveredId={assistant.assistantHoveredId}
|
||||
|
||||
Reference in New Issue
Block a user