@tracktor/map 1.6.4 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +723 -78
- package/dist/components/FeatureCollection/FeatureCollection.d.ts +10 -2
- package/dist/components/FeatureCollection/LineLabel.d.ts +7 -0
- package/dist/features/Itinerary/Itinerary.d.ts +10 -27
- package/dist/features/MapView/MapView.d.ts +1 -1
- package/dist/features/NearestPointItinerary/NearestPointItinary.d.ts +2 -9
- package/dist/main.js +473 -464
- package/dist/main.umd.cjs +4 -4
- package/dist/services/Mapbox/findNearestDestination.d.ts +2 -10
- package/dist/services/OSRM/findNearestDestination.d.ts +3 -11
- package/dist/services/core/fetchNearestInChunkFactory.d.ts +9 -5
- package/dist/services/core/interface.d.ts +1 -1
- package/dist/types/MapViewProps.d.ts +89 -156
- package/package.json +1 -1
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { Feature, FeatureCollection } from 'geojson';
|
|
2
|
-
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export interface LineStyle {
|
|
4
|
+
color?: string;
|
|
5
|
+
width?: number;
|
|
6
|
+
opacity?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface RenderFeaturesProps {
|
|
3
9
|
features?: Feature | Feature[] | FeatureCollection;
|
|
10
|
+
lineLabel?: ReactNode;
|
|
11
|
+
lineStyle?: LineStyle;
|
|
4
12
|
}
|
|
5
|
-
declare const RenderFeatures: ({ features }: RenderFeaturesProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
declare const RenderFeatures: ({ features, lineLabel, lineStyle }: RenderFeaturesProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
6
14
|
export default RenderFeatures;
|
|
@@ -1,33 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ItineraryProps = {
|
|
3
|
-
from?: [number, number];
|
|
4
|
-
to?: [number, number];
|
|
5
|
-
profile?: Profile;
|
|
6
|
-
engine?: Engine;
|
|
7
|
-
itineraryLineStyle?: Partial<ItineraryLineStyle>;
|
|
8
|
-
};
|
|
1
|
+
import { ItineraryParams } from '../../types/MapViewProps';
|
|
9
2
|
/**
|
|
10
3
|
* Itinerary Component
|
|
11
4
|
* -------------------
|
|
12
|
-
* Renders a route
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* 1. Fetches the route geometry between `from` and `to` coordinates.
|
|
16
|
-
* 2. Uses either OSRM or Mapbox routing services depending on the `routeService` prop.
|
|
17
|
-
* 3. Displays the resulting route as a line layer via `react-map-gl`.
|
|
18
|
-
*
|
|
19
|
-
* Props:
|
|
20
|
-
* - `from`: starting point [lng, lat].
|
|
21
|
-
* - `to`: destination point [lng, lat].
|
|
22
|
-
* - `profile`: routing mode ("driving", "walking", or "cycling").
|
|
23
|
-
* - `routeService`: which routing engine to use ("OSRM" or "Mapbox").
|
|
24
|
-
* - `itineraryLineStyle`: optional line style overrides (color, opacity, width).
|
|
25
|
-
*
|
|
26
|
-
* Dependencies:
|
|
27
|
-
* - `OSRMRoute`: returns a GeoJSON LineString from OSRM.
|
|
28
|
-
* - `mapboxRoute`: returns a GeoJSON LineString from Mapbox Directions API.
|
|
29
|
-
* - `react-map-gl`: used for rendering the map layers.
|
|
5
|
+
* Renders a route on a map, either:
|
|
6
|
+
* - using a precomputed GeoJSON route (initialRoute), or
|
|
7
|
+
* - by fetching a route from a routing engine (OSRM or Mapbox).
|
|
30
8
|
*
|
|
9
|
+
* Responsibilities:
|
|
10
|
+
* 1. Load the itinerary from props if precomputed (`initialRoute`).
|
|
11
|
+
* 2. Otherwise fetch the route dynamically based on `from` + `to`.
|
|
12
|
+
* 3. Optionally notify parent when a route is computed (`onRouteComputed`).
|
|
13
|
+
* 4. Delegate visual rendering to <RenderFeatures /> for consistency across map features.
|
|
31
14
|
*/
|
|
32
|
-
declare const Itinerary: ({ profile, engine,
|
|
15
|
+
declare const Itinerary: ({ from, to, profile, engine, itineraryLineStyle, initialRoute, onRouteComputed, itineraryLabel }: ItineraryParams) => import("react/jsx-runtime").JSX.Element | null;
|
|
33
16
|
export default Itinerary;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { MapViewProps } from '../../types/MapViewProps.ts';
|
|
3
|
-
declare const _default: import('react').MemoExoticComponent<({ containerStyle, square, loading, height, width, center, zoom, popupMaxWidth, openPopup, openPopupOnHover, markers, fitBounds, fitBoundsPadding, fitBoundDuration, fitBoundsAnimationKey, disableAnimation, mapStyle: baseMapStyle, onMapClick, baseMapView, cooperativeGestures, doubleClickZoom, projection, theme: themeOverride, features,
|
|
3
|
+
declare const _default: import('react').MemoExoticComponent<({ containerStyle, square, loading, height, width, center, zoom, popupMaxWidth, openPopup, openPopupOnHover, markers, fitBounds, fitBoundsPadding, fitBoundDuration, fitBoundsAnimationKey, disableAnimation, mapStyle: baseMapStyle, onMapClick, baseMapView, cooperativeGestures, doubleClickZoom, projection, theme: themeOverride, features, itineraryParams, findNearestMarker, isochrone, }: MapViewProps) => ReactElement>;
|
|
4
4
|
export default _default;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
id: number | string;
|
|
4
|
-
point: [number, number];
|
|
5
|
-
distance: number;
|
|
6
|
-
}
|
|
7
|
-
declare const _default: import('react').MemoExoticComponent<({ origin, maxDistanceMeters, destinations, onNearestFound, profile, engine, }: FindNearestMarkerParams & {
|
|
8
|
-
engine: Engine;
|
|
9
|
-
}) => import("react/jsx-runtime").JSX.Element | null>;
|
|
1
|
+
import { FindNearestMarkerParams } from '../../types/MapViewProps';
|
|
2
|
+
declare const _default: import('react').MemoExoticComponent<({ origin, maxDistanceMeters, destinations, onNearestFound, initialNearestResults, itineraryLineStyle, profile, engine, }: FindNearestMarkerParams) => import("react/jsx-runtime").JSX.Element | null>;
|
|
10
3
|
export default _default;
|