- @trails-cool/types: Route, Activity, Waypoint, RouteVersion, RouteMetadata - @trails-cool/gpx: GPX parser (XML→waypoints/tracks/elevation) and generator with round-trip test, haversine distance, elevation gain/loss computation - @trails-cool/map: MapView (Leaflet + OSM/OpenTopoMap/CyclOSM layer switcher), RouteLayer (GeoJSON polyline rendering) - @trails-cool/ui: Button (primary/secondary/ghost), Input (with label/error), Card components with Tailwind styling - @trails-cool/i18n: react-i18next config with English + German translations, browser language detection, fallback to English All 13 unit tests pass. Both apps build successfully. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
18 lines
408 B
TypeScript
18 lines
408 B
TypeScript
import { GeoJSON } from "react-leaflet";
|
|
import type { GeoJsonObject } from "geojson";
|
|
|
|
export interface RouteLayerProps {
|
|
data: GeoJsonObject;
|
|
color?: string;
|
|
weight?: number;
|
|
}
|
|
|
|
export function RouteLayer({ data, color = "#2563eb", weight = 4 }: RouteLayerProps) {
|
|
return (
|
|
<GeoJSON
|
|
key={JSON.stringify(data)}
|
|
data={data}
|
|
style={{ color, weight, opacity: 0.8 }}
|
|
/>
|
|
);
|
|
}
|