@maplibre/maplibre-react-native 10.1.0 → 10.1.2
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/ios/MLRN/CameraStop.h +1 -1
- package/ios/MLRN/CameraStop.m +58 -60
- package/ios/MLRN/CameraUpdateItem.h +2 -1
- package/ios/MLRN/CameraUpdateItem.m +132 -132
- package/ios/MLRN/CameraUpdateQueue.m +43 -47
- package/ios/MLRN/FilterParser.h +1 -1
- package/ios/MLRN/FilterParser.m +5 -6
- package/ios/MLRN/MLRNBackgroundLayer.m +10 -9
- package/ios/MLRN/MLRNBackgroundLayerManager.m +4 -5
- package/ios/MLRN/MLRNCallout.h +1 -1
- package/ios/MLRN/MLRNCallout.m +37 -36
- package/ios/MLRN/MLRNCalloutManager.m +2 -3
- package/ios/MLRN/MLRNCamera.h +1 -1
- package/ios/MLRN/MLRNCamera.m +169 -182
- package/ios/MLRN/MLRNCameraManager.m +4 -6
- package/ios/MLRN/MLRNCircleLayer.m +17 -14
- package/ios/MLRN/MLRNCircleLayerManager.m +4 -5
- package/ios/MLRN/MLRNCustomHeaders.h +2 -2
- package/ios/MLRN/MLRNCustomHeaders.m +63 -63
- package/ios/MLRN/MLRNEvent.h +3 -3
- package/ios/MLRN/MLRNEvent.m +19 -24
- package/ios/MLRN/MLRNEventProtocol.h +1 -1
- package/ios/MLRN/MLRNFillExtrusionLayer.m +18 -14
- package/ios/MLRN/MLRNFillExtrusionLayerManager.m +4 -5
- package/ios/MLRN/MLRNFillLayer.m +16 -14
- package/ios/MLRN/MLRNFillLayerManager.m +4 -5
- package/ios/MLRN/MLRNHeatmapLayer.m +17 -14
- package/ios/MLRN/MLRNHeatmapLayerManager.m +4 -5
- package/ios/MLRN/MLRNImageQueue.h +4 -1
- package/ios/MLRN/MLRNImageQueue.m +29 -32
- package/ios/MLRN/MLRNImageQueueOperation.h +1 -1
- package/ios/MLRN/MLRNImageQueueOperation.m +92 -91
- package/ios/MLRN/MLRNImageSource.m +36 -38
- package/ios/MLRN/MLRNImageSourceManager.m +2 -3
- package/ios/MLRN/MLRNImageUtils.h +3 -3
- package/ios/MLRN/MLRNImageUtils.m +15 -14
- package/ios/MLRN/MLRNImages.h +0 -1
- package/ios/MLRN/MLRNImages.m +89 -91
- package/ios/MLRN/MLRNImagesManager.m +4 -5
- package/ios/MLRN/MLRNLayer.h +9 -11
- package/ios/MLRN/MLRNLayer.m +170 -182
- package/ios/MLRN/MLRNLight.m +21 -23
- package/ios/MLRN/MLRNLightManager.m +2 -3
- package/ios/MLRN/MLRNLineLayer.m +17 -15
- package/ios/MLRN/MLRNLineLayerManager.m +4 -6
- package/ios/MLRN/MLRNLocation.h +1 -1
- package/ios/MLRN/MLRNLocation.m +16 -17
- package/ios/MLRN/MLRNLocationManager.m +109 -124
- package/ios/MLRN/MLRNLocationManagerDelegate.h +3 -3
- package/ios/MLRN/MLRNLocationModule.h +1 -1
- package/ios/MLRN/MLRNLocationModule.m +40 -55
- package/ios/MLRN/MLRNLogging.h +1 -4
- package/ios/MLRN/MLRNLogging.m +84 -89
- package/ios/MLRN/MLRNMapTouchEvent.h +2 -2
- package/ios/MLRN/MLRNMapTouchEvent.m +50 -49
- package/ios/MLRN/MLRNMapView.h +43 -36
- package/ios/MLRN/MLRNMapView.m +409 -440
- package/ios/MLRN/MLRNMapViewManager.m +489 -502
- package/ios/MLRN/MLRNModule.h +1 -1
- package/ios/MLRN/MLRNModule.m +111 -105
- package/ios/MLRN/MLRNNativeUserLocation.m +24 -27
- package/ios/MLRN/MLRNNativeUserLocationManager.m +4 -8
- package/ios/MLRN/MLRNOfflineModule.h +1 -1
- package/ios/MLRN/MLRNOfflineModule.m +416 -421
- package/ios/MLRN/MLRNPointAnnotation.h +2 -2
- package/ios/MLRN/MLRNPointAnnotation.m +154 -175
- package/ios/MLRN/MLRNPointAnnotationManager.m +2 -3
- package/ios/MLRN/MLRNRasterLayer.m +16 -12
- package/ios/MLRN/MLRNRasterLayerManager.m +4 -5
- package/ios/MLRN/MLRNRasterSource.m +21 -17
- package/ios/MLRN/MLRNRasterSourceManager.m +2 -3
- package/ios/MLRN/MLRNShapeSource.h +17 -16
- package/ios/MLRN/MLRNShapeSource.m +94 -102
- package/ios/MLRN/MLRNShapeSourceManager.h +2 -2
- package/ios/MLRN/MLRNShapeSourceManager.m +86 -90
- package/ios/MLRN/MLRNSnapshotModule.h +1 -1
- package/ios/MLRN/MLRNSnapshotModule.m +51 -53
- package/ios/MLRN/MLRNSource.h +12 -12
- package/ios/MLRN/MLRNSource.m +82 -88
- package/ios/MLRN/MLRNStyleValue.h +1 -1
- package/ios/MLRN/MLRNStyleValue.m +128 -128
- package/ios/MLRN/MLRNSymbolLayer.m +17 -13
- package/ios/MLRN/MLRNSymbolLayerManager.m +4 -5
- package/ios/MLRN/MLRNTileSource.h +1 -1
- package/ios/MLRN/MLRNTileSource.m +21 -20
- package/ios/MLRN/MLRNUserLocation.h +1 -1
- package/ios/MLRN/MLRNUserLocation.m +10 -12
- package/ios/MLRN/MLRNUtils.h +18 -11
- package/ios/MLRN/MLRNUtils.m +168 -160
- package/ios/MLRN/MLRNVectorLayer.m +28 -34
- package/ios/MLRN/MLRNVectorSource.h +3 -1
- package/ios/MLRN/MLRNVectorSource.m +14 -11
- package/ios/MLRN/MLRNVectorSourceManager.h +2 -2
- package/ios/MLRN/MLRNVectorSourceManager.m +36 -39
- package/ios/MLRN/ViewManager.h +1 -1
- package/ios/MLRN/ViewManager.m +29 -35
- package/lib/commonjs/components/MarkerView.js +1 -1
- package/lib/commonjs/components/ShapeSource.js +2 -1
- package/lib/commonjs/components/ShapeSource.js.map +1 -1
- package/lib/commonjs/components/UserLocation.js +8 -38
- package/lib/commonjs/components/UserLocation.js.map +1 -1
- package/lib/commonjs/components/UserLocationPuck.js +52 -0
- package/lib/commonjs/components/UserLocationPuck.js.map +1 -0
- package/lib/commonjs/components/{HeadingIndicator.js → UserLocationPuckHeading.js} +12 -9
- package/lib/commonjs/components/UserLocationPuckHeading.js.map +1 -0
- package/lib/commonjs/utils/animated/AbstractAnimatedCoordinates.js +8 -7
- package/lib/commonjs/utils/animated/AbstractAnimatedCoordinates.js.map +1 -1
- package/lib/commonjs/utils/animated/AnimatedExtractCoordinateFromArray.js +1 -2
- package/lib/commonjs/utils/animated/AnimatedExtractCoordinateFromArray.js.map +1 -1
- package/lib/commonjs/utils/animated/AnimatedRouteCoordinatesArray.js +28 -38
- package/lib/commonjs/utils/animated/AnimatedRouteCoordinatesArray.js.map +1 -1
- package/lib/commonjs/utils/animated/AnimatedShape.js +11 -7
- package/lib/commonjs/utils/animated/AnimatedShape.js.map +1 -1
- package/lib/module/components/MarkerView.js +1 -1
- package/lib/module/components/ShapeSource.js +2 -1
- package/lib/module/components/ShapeSource.js.map +1 -1
- package/lib/module/components/UserLocation.js +7 -36
- package/lib/module/components/UserLocation.js.map +1 -1
- package/lib/module/components/UserLocationPuck.js +48 -0
- package/lib/module/components/UserLocationPuck.js.map +1 -0
- package/lib/module/components/{HeadingIndicator.js → UserLocationPuckHeading.js} +11 -7
- package/lib/module/components/UserLocationPuckHeading.js.map +1 -0
- package/lib/module/utils/animated/AbstractAnimatedCoordinates.js +8 -7
- package/lib/module/utils/animated/AbstractAnimatedCoordinates.js.map +1 -1
- package/lib/module/utils/animated/AnimatedExtractCoordinateFromArray.js +1 -3
- package/lib/module/utils/animated/AnimatedExtractCoordinateFromArray.js.map +1 -1
- package/lib/module/utils/animated/AnimatedRouteCoordinatesArray.js +29 -39
- package/lib/module/utils/animated/AnimatedRouteCoordinatesArray.js.map +1 -1
- package/lib/module/utils/animated/AnimatedShape.js +11 -7
- package/lib/module/utils/animated/AnimatedShape.js.map +1 -1
- package/lib/typescript/commonjs/src/components/MarkerView.d.ts +1 -1
- package/lib/typescript/commonjs/src/components/ShapeSource.d.ts +1 -1
- package/lib/typescript/commonjs/src/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/UserLocation.d.ts +0 -1
- package/lib/typescript/commonjs/src/components/UserLocation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/UserLocationPuck.d.ts +9 -0
- package/lib/typescript/commonjs/src/components/UserLocationPuck.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/UserLocationPuckHeading.d.ts +9 -0
- package/lib/typescript/commonjs/src/components/UserLocationPuckHeading.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts +12 -13
- package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +5 -4
- package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts +0 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts +33 -21
- package/lib/typescript/commonjs/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts +8 -5
- package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts.map +1 -1
- package/lib/typescript/module/src/components/MarkerView.d.ts +1 -1
- package/lib/typescript/module/src/components/ShapeSource.d.ts +1 -1
- package/lib/typescript/module/src/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/module/src/components/UserLocation.d.ts +0 -1
- package/lib/typescript/module/src/components/UserLocation.d.ts.map +1 -1
- package/lib/typescript/module/src/components/UserLocationPuck.d.ts +9 -0
- package/lib/typescript/module/src/components/UserLocationPuck.d.ts.map +1 -0
- package/lib/typescript/module/src/components/UserLocationPuckHeading.d.ts +9 -0
- package/lib/typescript/module/src/components/UserLocationPuckHeading.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts +12 -13
- package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +5 -4
- package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts +0 -1
- package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts +33 -21
- package/lib/typescript/module/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts +8 -5
- package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/components/MarkerView.tsx +1 -1
- package/src/components/ShapeSource.tsx +58 -53
- package/src/components/UserLocation.tsx +13 -51
- package/src/components/UserLocationPuck.tsx +62 -0
- package/src/components/UserLocationPuckHeading.tsx +33 -0
- package/src/utils/animated/AbstractAnimatedCoordinates.ts +26 -15
- package/src/utils/animated/AnimatedExtractCoordinateFromArray.ts +10 -6
- package/src/utils/animated/AnimatedRouteCoordinatesArray.ts +63 -51
- package/src/utils/animated/AnimatedShape.ts +22 -13
- package/lib/commonjs/components/HeadingIndicator.js.map +0 -1
- package/lib/module/components/HeadingIndicator.js.map +0 -1
- package/lib/typescript/commonjs/src/components/HeadingIndicator.d.ts +0 -7
- package/lib/typescript/commonjs/src/components/HeadingIndicator.d.ts.map +0 -1
- package/lib/typescript/module/src/components/HeadingIndicator.d.ts +0 -7
- package/lib/typescript/module/src/components/HeadingIndicator.d.ts.map +0 -1
- package/src/components/HeadingIndicator.tsx +0 -26
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserLocationPuck.d.ts","sourceRoot":"","sources":["../../../../../src/components/UserLocationPuck.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAwBpD,UAAU,qBAAsB,SAAQ,SAAS;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,gBAAgB,8DACH,qBAAqB,6CA0B9C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type BaseProps } from "../types/BaseProps";
|
|
2
|
+
interface UserLocationPuckHeadingProps extends BaseProps {
|
|
3
|
+
sourceID: string;
|
|
4
|
+
belowLayerID?: string;
|
|
5
|
+
heading: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const UserLocationPuckHeading: import("react").MemoExoticComponent<({ sourceID, belowLayerID, heading }: UserLocationPuckHeadingProps) => import("react/jsx-runtime").JSX.Element>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=UserLocationPuckHeading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserLocationPuckHeading.d.ts","sourceRoot":"","sources":["../../../../../src/components/UserLocationPuckHeading.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAUpD,UAAU,4BAA6B,SAAQ,SAAS;IACtD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,uBAAuB,4EACI,4BAA4B,6CAWnE,CAAC"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { Animated } from "react-native";
|
|
2
2
|
declare const AnimatedWithChildren: any;
|
|
3
3
|
export type AnimatedCoordinates = [number, number];
|
|
4
|
-
export declare abstract class AbstractAnimatedCoordinates<State> extends AnimatedWithChildren {
|
|
5
|
-
|
|
6
|
-
constructor(coords: AnimatedCoordinates[]);
|
|
4
|
+
export declare abstract class AbstractAnimatedCoordinates<State, ToValue = AnimatedCoordinates[]> extends AnimatedWithChildren {
|
|
5
|
+
constructor(coordinates: AnimatedCoordinates[]);
|
|
7
6
|
/**
|
|
8
7
|
* Subclasses can override to calculate initial state
|
|
9
8
|
*
|
|
10
|
-
* @param {AnimatedCoordinates} coordinatesArray - to value from animate
|
|
11
9
|
* @returns {object} - the state object
|
|
10
|
+
* @param coordinates
|
|
12
11
|
*/
|
|
13
|
-
abstract onInitialState(
|
|
12
|
+
abstract onInitialState(coordinates: AnimatedCoordinates[]): State;
|
|
14
13
|
/**
|
|
15
14
|
* Calculates state based on startingState and progress, returns a new state
|
|
16
15
|
*
|
|
@@ -19,17 +18,17 @@ export declare abstract class AbstractAnimatedCoordinates<State> extends Animate
|
|
|
19
18
|
* @returns {object} next state
|
|
20
19
|
*/
|
|
21
20
|
abstract onCalculate(state: State, progress: number): State;
|
|
22
|
-
animate(progressValue: Animated.Value, progressAnimation: Animated.CompositeAnimation, config:
|
|
23
|
-
toValue:
|
|
21
|
+
animate(progressValue: Animated.Value, progressAnimation: Animated.CompositeAnimation, config: Omit<Animated.TimingAnimationConfig | Animated.SpringAnimationConfig | Animated.DecayAnimationConfig, "toValue"> & {
|
|
22
|
+
toValue: ToValue;
|
|
24
23
|
}): Animated.CompositeAnimation;
|
|
25
|
-
timing(config: Animated.TimingAnimationConfig & {
|
|
26
|
-
toValue:
|
|
24
|
+
timing(config: Omit<Animated.TimingAnimationConfig, "toValue" | "useNativeDriver"> & {
|
|
25
|
+
toValue: ToValue;
|
|
27
26
|
}): Animated.CompositeAnimation;
|
|
28
|
-
spring(config: Animated.SpringAnimationConfig & {
|
|
29
|
-
toValue:
|
|
27
|
+
spring(config: Omit<Animated.SpringAnimationConfig, "toValue"> & {
|
|
28
|
+
toValue: ToValue;
|
|
30
29
|
}): Animated.CompositeAnimation;
|
|
31
|
-
decay(config: Animated.DecayAnimationConfig & {
|
|
32
|
-
toValue:
|
|
30
|
+
decay(config: Omit<Animated.DecayAnimationConfig, "toValue"> & {
|
|
31
|
+
toValue: ToValue;
|
|
33
32
|
}): Animated.CompositeAnimation;
|
|
34
33
|
__getValue(): AnimatedCoordinates[];
|
|
35
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractAnimatedCoordinates.d.ts","sourceRoot":"","sources":["../../../../../../src/utils/animated/AbstractAnimatedCoordinates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"AbstractAnimatedCoordinates.d.ts","sourceRoot":"","sources":["../../../../../../src/utils/animated/AbstractAnimatedCoordinates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,QAAA,MAAM,oBAAoB,KAA0C,CAAC;AAUrE,MAAM,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAMnD,8BAAsB,2BAA2B,CAC/C,KAAK,EACL,OAAO,GAAG,mBAAmB,EAAE,CAC/B,SAAQ,oBAAoB;gBAChB,WAAW,EAAE,mBAAmB,EAAE;IAM9C;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,CAAC,WAAW,EAAE,mBAAmB,EAAE,GAAG,KAAK;IAClE;;;;;;OAMG;IACH,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,GAAG,KAAK;IAE3D,OAAO,CACL,aAAa,EAAE,QAAQ,CAAC,KAAK,EAC7B,iBAAiB,EAAE,QAAQ,CAAC,kBAAkB,EAC9C,MAAM,EAAE,IAAI,CACR,QAAQ,CAAC,qBAAqB,GAC9B,QAAQ,CAAC,qBAAqB,GAC9B,QAAQ,CAAC,oBAAoB,EAC/B,SAAS,CACV,GAAG;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,GACvB,QAAQ,CAAC,kBAAkB;IA0B9B,MAAM,CACJ,MAAM,EAAE,IAAI,CACV,QAAQ,CAAC,qBAAqB,EAC9B,SAAS,GAAG,iBAAiB,CAC9B,GAAG;QACF,OAAO,EAAE,OAAO,CAAC;KAClB,GACA,QAAQ,CAAC,kBAAkB;IAgB9B,MAAM,CACJ,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,SAAS,CAAC,GAAG;QACxD,OAAO,EAAE,OAAO,CAAC;KAClB,GACA,QAAQ,CAAC,kBAAkB;IAa9B,KAAK,CACH,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,SAAS,CAAC,GAAG;QACvD,OAAO,EAAE,OAAO,CAAC;KAClB,GACA,QAAQ,CAAC,kBAAkB;IAY9B,UAAU,IAAI,mBAAmB,EAAE;CAQpC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { AnimatedCoordinates } from "./AbstractAnimatedCoordinates";
|
|
2
|
+
import { AnimatedRouteCoordinatesArray } from "./AnimatedRouteCoordinatesArray";
|
|
1
3
|
declare const AnimatedWithChildren: any;
|
|
2
4
|
export declare class AnimatedExtractCoordinateFromArray extends AnimatedWithChildren {
|
|
3
|
-
|
|
4
|
-
_array: AnimatedExtractCoordinateFromArray;
|
|
5
|
+
_array: AnimatedRouteCoordinatesArray;
|
|
5
6
|
_index: number;
|
|
6
|
-
constructor(array:
|
|
7
|
-
__getValue():
|
|
7
|
+
constructor(array: AnimatedRouteCoordinatesArray, index: number);
|
|
8
|
+
__getValue(): AnimatedCoordinates;
|
|
8
9
|
__attach(): void;
|
|
9
10
|
__detach(): void;
|
|
10
11
|
}
|
package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimatedExtractCoordinateFromArray.d.ts","sourceRoot":"","sources":["../../../../../../src/utils/animated/AnimatedExtractCoordinateFromArray.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnimatedExtractCoordinateFromArray.d.ts","sourceRoot":"","sources":["../../../../../../src/utils/animated/AnimatedExtractCoordinateFromArray.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAGhF,QAAA,MAAM,oBAAoB,KAA0C,CAAC;AAUrE,qBAAa,kCAAmC,SAAQ,oBAAoB;IAC1E,MAAM,EAAE,6BAA6B,CAAC;IAEtC,MAAM,SAAK;gBAEC,KAAK,EAAE,6BAA6B,EAAE,KAAK,EAAE,MAAM;IAM/D,UAAU,IAAI,mBAAmB;IAWjC,QAAQ,IAAI,IAAI;IAIhB,QAAQ,IAAI,IAAI;CAIjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimatedPoint.d.ts","sourceRoot":"","sources":["../../../../../../src/utils/animated/AnimatedPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAIxC,QAAA,MAAM,oBAAoB,KAA0C,CAAC;AAOrE,qBAAa,aAAc,SAAQ,oBAAoB
|
|
1
|
+
{"version":3,"file":"AnimatedPoint.d.ts","sourceRoot":"","sources":["../../../../../../src/utils/animated/AnimatedPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAIxC,QAAA,MAAM,oBAAoB,KAA0C,CAAC;AAOrE,qBAAa,aAAc,SAAQ,oBAAoB;gBACzC,KAAK;;;KAAgB;IAiBjC,QAAQ,CAAC,KAAK;;;KAAgB,GAAG,IAAI;IAKrC,SAAS,CAAC,KAAK;;;KAAgB,GAAG,IAAI;IAKtC,aAAa,IAAI,IAAI;IAKrB,aAAa,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,KAAK,IAAI,GAAG,IAAI;IASxD,WAAW,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,KAAK,IAAI,GAAG,MAAM;IAkBxD,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAMhC,MAAM,CACJ,MAAM,GAAE,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAC,GAAG;QAChD,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC;KACE,GACjC,QAAQ,CAAC,kBAAkB;IAe9B,MAAM,CACJ,MAAM,GAAE,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAC,GAAG;QAChD,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC;KACE,GACjC,QAAQ,CAAC,kBAAkB;IAe9B,UAAU,IAAI,OAAO,CAAC,KAAK;IAO3B,QAAQ,IAAI,IAAI;IAKhB,QAAQ,IAAI,IAAI;CAIjB"}
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
import { type Coord, type Units } from "@turf/helpers";
|
|
2
2
|
import { AbstractAnimatedCoordinates, type AnimatedCoordinates } from "./AbstractAnimatedCoordinates";
|
|
3
|
+
interface AnimatedRouteToValue {
|
|
4
|
+
end: {
|
|
5
|
+
point: Coord | AnimatedCoordinates;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Animate to this length of the coordinates array
|
|
9
|
+
*/
|
|
10
|
+
| {
|
|
11
|
+
along: number;
|
|
12
|
+
units?: Units;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Use `end.units` in conjunction with `end.along` instead
|
|
16
|
+
*/
|
|
17
|
+
units?: Units;
|
|
18
|
+
}
|
|
3
19
|
interface AnimatedRouteState {
|
|
4
20
|
actRoute?: AnimatedCoordinates[];
|
|
5
21
|
fullRoute: AnimatedCoordinates[];
|
|
@@ -7,47 +23,43 @@ interface AnimatedRouteState {
|
|
|
7
23
|
from: number;
|
|
8
24
|
current?: number;
|
|
9
25
|
to: number;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
26
|
+
} & ({
|
|
27
|
+
point?: Coord | AnimatedCoordinates;
|
|
28
|
+
} | {
|
|
29
|
+
along?: number;
|
|
30
|
+
});
|
|
13
31
|
}
|
|
14
|
-
export declare class AnimatedRouteCoordinatesArray extends AbstractAnimatedCoordinates<AnimatedRouteState> {
|
|
32
|
+
export declare class AnimatedRouteCoordinatesArray extends AbstractAnimatedCoordinates<AnimatedRouteState, AnimatedRouteToValue> {
|
|
15
33
|
/**
|
|
16
34
|
* Calculate initial state
|
|
17
35
|
*
|
|
18
|
-
* @param {
|
|
19
|
-
* @returns {
|
|
36
|
+
* @param {AnimatedCoordinates[]} coordinatesArray
|
|
37
|
+
* @returns {AnimatedRouteState}
|
|
20
38
|
*/
|
|
21
39
|
onInitialState(coordinatesArray: AnimatedCoordinates[]): AnimatedRouteState;
|
|
22
40
|
/**
|
|
23
|
-
* Calculate value from state
|
|
41
|
+
* Calculate value from state
|
|
24
42
|
*
|
|
25
|
-
* @param {
|
|
26
|
-
* @returns {
|
|
43
|
+
* @param {AnimatedRouteState} state Previous state
|
|
44
|
+
* @returns {AnimatedCoordinates[]}
|
|
27
45
|
*/
|
|
28
|
-
onGetValue(state: AnimatedRouteState):
|
|
46
|
+
onGetValue(state: AnimatedRouteState): AnimatedCoordinates[];
|
|
29
47
|
/**
|
|
30
48
|
* Calculates state based on startingState and progress, returns a new state
|
|
31
49
|
*
|
|
32
|
-
* @param {
|
|
33
|
-
* @param {number} progress
|
|
34
|
-
* @returns {
|
|
50
|
+
* @param {AnimatedRouteState} state Previous state
|
|
51
|
+
* @param {number} progress Value between 0 and 1
|
|
52
|
+
* @returns {AnimatedRouteState}
|
|
35
53
|
*/
|
|
36
54
|
onCalculate(state: AnimatedRouteState, progress: number): AnimatedRouteState;
|
|
37
55
|
/**
|
|
38
56
|
* Subclasses can override to start a new animation
|
|
39
57
|
*
|
|
58
|
+
* @param {AnimatedRouteState} state
|
|
40
59
|
* @param {*} toValue - to value from animate
|
|
41
|
-
* @param {*} actCoords - the current coordinates array to start from
|
|
42
60
|
* @returns {object} The state
|
|
43
61
|
*/
|
|
44
|
-
onStart(state: AnimatedRouteState, toValue:
|
|
45
|
-
end: {
|
|
46
|
-
point?: Coord;
|
|
47
|
-
along?: number;
|
|
48
|
-
};
|
|
49
|
-
units?: Units;
|
|
50
|
-
}): AnimatedRouteState;
|
|
62
|
+
onStart(state: AnimatedRouteState, toValue: AnimatedRouteToValue): AnimatedRouteState;
|
|
51
63
|
get originalRoute(): AnimatedCoordinates[];
|
|
52
64
|
}
|
|
53
65
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimatedRouteCoordinatesArray.d.ts","sourceRoot":"","sources":["../../../../../../src/utils/animated/AnimatedRouteCoordinatesArray.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"AnimatedRouteCoordinatesArray.d.ts","sourceRoot":"","sources":["../../../../../../src/utils/animated/AnimatedRouteCoordinatesArray.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,KAAK,EAGV,KAAK,KAAK,EACX,MAAM,eAAe,CAAC;AAIvB,OAAO,EACL,2BAA2B,EAC3B,KAAK,mBAAmB,EACzB,MAAM,+BAA+B,CAAC;AAEvC,UAAU,oBAAoB;IAC5B,GAAG,EAGD;QAAE,KAAK,EAAE,KAAK,GAAG,mBAAmB,CAAA;KAAE;IACtC;;OAEG;OACD;QACE,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,KAAK,CAAC;KACf,CAAC;IAEN;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACjC,SAAS,EAAE,mBAAmB,EAAE,CAAC;IACjC,GAAG,EAAE;QACH,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,EAAE,EAAE,MAAM,CAAC;KACZ,GAAG,CAAC;QAAE,KAAK,CAAC,EAAE,KAAK,GAAG,mBAAmB,CAAA;KAAE,GAAG;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpE;AAED,qBAAa,6BAA8B,SAAQ,2BAA2B,CAC5E,kBAAkB,EAClB,oBAAoB,CACrB;IACC;;;;;OAKG;IACH,cAAc,CAAC,gBAAgB,EAAE,mBAAmB,EAAE,GAAG,kBAAkB;IAS3E;;;;;OAKG;IACH,UAAU,CAAC,KAAK,EAAE,kBAAkB,GAAG,mBAAmB,EAAE;IAI5D;;;;;;OAMG;IACH,WAAW,CAAC,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,GAAG,kBAAkB;IAgC5E;;;;;;OAMG;IACH,OAAO,CACL,KAAK,EAAE,kBAAkB,EACzB,OAAO,EAAE,oBAAoB,GAC5B,kBAAkB;IAoCrB,IAAI,aAAa,IAAI,mBAAmB,EAAE,CAEzC;CACF"}
|
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
import { Animated } from "react-native";
|
|
2
|
-
import { AnimatedCoordinatesArray } from "./AnimatedCoordinatesArray";
|
|
2
|
+
import type { AnimatedCoordinatesArray } from "./AnimatedCoordinatesArray";
|
|
3
3
|
import { AnimatedExtractCoordinateFromArray } from "./AnimatedExtractCoordinateFromArray";
|
|
4
4
|
import { AnimatedRouteCoordinatesArray } from "./AnimatedRouteCoordinatesArray";
|
|
5
5
|
declare const AnimatedWithChildren: any;
|
|
6
6
|
type Shape = {
|
|
7
7
|
type: "Point";
|
|
8
|
-
coordinates: AnimatedExtractCoordinateFromArray
|
|
8
|
+
coordinates: AnimatedExtractCoordinateFromArray;
|
|
9
9
|
} | {
|
|
10
10
|
type: "LineString";
|
|
11
|
-
coordinates: AnimatedCoordinatesArray;
|
|
11
|
+
coordinates: AnimatedCoordinatesArray | AnimatedRouteCoordinatesArray;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* AnimatedShape can be used to have animated properties inside the shape property
|
|
15
|
+
*
|
|
16
|
+
* Equivalent of AnimatedStyle for shapes
|
|
17
|
+
* https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Animated/nodes/AnimatedStyle.js
|
|
18
|
+
*
|
|
15
19
|
* @example
|
|
16
20
|
* <AnimatedShapeSource ... shape={new AnimatedShape({type:'LineString', coordinates: animatedCoords})} />
|
|
17
21
|
*/
|
|
18
22
|
export declare class AnimatedShape extends AnimatedWithChildren {
|
|
19
|
-
static [x: string]: any;
|
|
20
23
|
constructor(shape: Shape);
|
|
21
24
|
_walkShapeAndGetValues(value: any): any;
|
|
22
|
-
__getValue():
|
|
25
|
+
__getValue(): GeoJSON.Point | GeoJSON.LineString;
|
|
23
26
|
_walkAndProcess(value: any, cb: (value: Animated.Node) => void): void;
|
|
24
27
|
__attach(): void;
|
|
25
28
|
__detach(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimatedShape.d.ts","sourceRoot":"","sources":["../../../../../../src/utils/animated/AnimatedShape.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"AnimatedShape.d.ts","sourceRoot":"","sources":["../../../../../../src/utils/animated/AnimatedShape.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAGhF,QAAA,MAAM,oBAAoB,KAA0C,CAAC;AAUrE,KAAK,KAAK,GACN;IACE,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,kCAAkC,CAAC;CACjD,GACD;IACE,IAAI,EAAE,YAAY,CAAC;IACnB,WAAW,EAAE,wBAAwB,GAAG,6BAA6B,CAAC;CACvE,CAAC;AAEN;;;;;;;;GAQG;AACH,qBAAa,aAAc,SAAQ,oBAAoB;gBACzC,KAAK,EAAE,KAAK;IAKxB,sBAAsB,CAAC,KAAK,EAAE,GAAG,GAAG,GAAG;IAuBvC,UAAU,IAAI,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,UAAU;IAWhD,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,KAAK,IAAI,GAAG,IAAI;IAarE,QAAQ,IAAI,IAAI;IAIhB,QAAQ,IAAI,IAAI;CAIjB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maplibre/maplibre-react-native",
|
|
3
3
|
"description": "React Native library for creating maps with MapLibre Native for Android & iOS",
|
|
4
|
-
"version": "10.1.
|
|
4
|
+
"version": "10.1.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"provenance": true
|
|
@@ -145,25 +145,25 @@
|
|
|
145
145
|
"devDependencies": {
|
|
146
146
|
"@babel/core": "^7.26.0",
|
|
147
147
|
"@expo/config-plugins": "^9.0.11",
|
|
148
|
-
"@maplibre/maplibre-gl-style-spec": "
|
|
148
|
+
"@maplibre/maplibre-gl-style-spec": "23.1.0",
|
|
149
149
|
"@semantic-release/changelog": "^6.0.3",
|
|
150
150
|
"@semantic-release/git": "^10.0.1",
|
|
151
|
-
"@sinonjs/fake-timers": "^
|
|
152
|
-
"@testing-library/react-native": "^
|
|
151
|
+
"@sinonjs/fake-timers": "^14.0.0",
|
|
152
|
+
"@testing-library/react-native": "^13.0.1",
|
|
153
153
|
"@types/ejs": "^3.1.5",
|
|
154
154
|
"@types/geojson": "^7946.0.14",
|
|
155
155
|
"@types/node": "^22.10.1",
|
|
156
|
-
"@types/react": "^18.3.
|
|
156
|
+
"@types/react": "^18.3.18",
|
|
157
157
|
"documentation": "^14.0.0",
|
|
158
158
|
"ejs": "^3.1.10",
|
|
159
159
|
"eslint": "^8.57.1",
|
|
160
160
|
"eslint-config-universe": "14.0.0",
|
|
161
|
-
"expo-module-scripts": "^4.0.
|
|
161
|
+
"expo-module-scripts": "^4.0.4",
|
|
162
162
|
"jest": "^29.7.0",
|
|
163
|
-
"prettier": "3.
|
|
163
|
+
"prettier": "3.5.3",
|
|
164
164
|
"react": "18.3.1",
|
|
165
165
|
"react-docgen": "^7.1.0",
|
|
166
|
-
"react-native": "0.
|
|
166
|
+
"react-native": "0.76.7",
|
|
167
167
|
"react-native-builder-bob": "^0.34.0",
|
|
168
168
|
"react-test-renderer": "18.3.1",
|
|
169
169
|
"semantic-release": "^24.2.0",
|
|
@@ -50,7 +50,7 @@ interface NativeProps extends ViewProps {
|
|
|
50
50
|
*
|
|
51
51
|
* If you have static view consider using PointAnnotation or SymbolLayer they'll offer much better performance
|
|
52
52
|
* .
|
|
53
|
-
* This is based on [MakerView plugin](https://
|
|
53
|
+
* This is based on [MakerView plugin](https://github.com/maplibre/maplibre-plugins-android/tree/main/plugin-markerview) on Android
|
|
54
54
|
* and PointAnnotation on iOS.
|
|
55
55
|
*/
|
|
56
56
|
export const MarkerView = ({
|
|
@@ -32,7 +32,7 @@ const MLRNModule = NativeModules.MLRNModule;
|
|
|
32
32
|
export const NATIVE_MODULE_NAME = "MLRNShapeSource";
|
|
33
33
|
|
|
34
34
|
interface NativeProps {
|
|
35
|
-
shape?: string;
|
|
35
|
+
shape?: object | string;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
type MLRNShapeSourceRefType = Component<NativeProps> & Readonly<NativeMethods>;
|
|
@@ -164,57 +164,62 @@ export const ShapeSource = memo(
|
|
|
164
164
|
}: ShapeSourceProps,
|
|
165
165
|
ref,
|
|
166
166
|
) => {
|
|
167
|
-
useImperativeHandle(
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
167
|
+
useImperativeHandle(ref, () => ({
|
|
168
|
+
..._nativeRef.current,
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Returns all features from the source that match the query parameters regardless of whether or not the feature is
|
|
172
|
+
* currently rendered on the map.
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* shapeSource.features()
|
|
176
|
+
*
|
|
177
|
+
* @param {Array=} filter - an optional filter statement to filter the returned Features.
|
|
178
|
+
* @return {GeoJSON.FeatureCollection}
|
|
179
|
+
*/
|
|
180
|
+
features,
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Returns the zoom needed to expand the cluster.
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* const zoom = await shapeSource.getClusterExpansionZoom(clusterId);
|
|
187
|
+
*
|
|
188
|
+
* @param {GeoJSON.Feature} feature - The feature cluster to expand.
|
|
189
|
+
* @return {number}
|
|
190
|
+
*/
|
|
191
|
+
getClusterExpansionZoom,
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Returns the FeatureCollection from the cluster.
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* const collection = await shapeSource.getClusterLeaves(clusterId, limit, offset);
|
|
198
|
+
*
|
|
199
|
+
* @param {GeoJSON.Feature} feature - The feature cluster to expand.
|
|
200
|
+
* @param {number} limit - The number of points to return.
|
|
201
|
+
* @param {number} offset - The amount of points to skip (for pagination).
|
|
202
|
+
* @return {GeoJSON.FeatureCollection}
|
|
203
|
+
*/
|
|
204
|
+
getClusterLeaves,
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Returns the FeatureCollection from the cluster (on the next zoom level).
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* const collection = await shapeSource.getClusterChildren(clusterId);
|
|
211
|
+
*
|
|
212
|
+
* @param {GeoJSON.Feature} feature - The feature cluster to expand.
|
|
213
|
+
* @return {GeoJSON.FeatureCollection}
|
|
214
|
+
*/
|
|
215
|
+
getClusterChildren,
|
|
216
|
+
|
|
217
|
+
setNativeProps,
|
|
218
|
+
|
|
219
|
+
onPress,
|
|
220
|
+
|
|
221
|
+
_nativeRef: _nativeRef.current,
|
|
222
|
+
}));
|
|
218
223
|
|
|
219
224
|
const _nativeRef = useRef<MLRNShapeSourceRefType>();
|
|
220
225
|
|
|
@@ -297,7 +302,7 @@ export const ShapeSource = memo(
|
|
|
297
302
|
const shallowProps = Object.assign({}, nativeProps);
|
|
298
303
|
|
|
299
304
|
// Adds support for Animated
|
|
300
|
-
if (shallowProps.shape && typeof shallowProps !== "string") {
|
|
305
|
+
if (shallowProps.shape && typeof shallowProps.shape !== "string") {
|
|
301
306
|
shallowProps.shape = JSON.stringify(shallowProps.shape);
|
|
302
307
|
}
|
|
303
308
|
|
|
@@ -9,60 +9,14 @@ import {
|
|
|
9
9
|
} from "react";
|
|
10
10
|
|
|
11
11
|
import { Annotation } from "./Annotation";
|
|
12
|
-
import { CircleLayer } from "./CircleLayer";
|
|
13
|
-
import { HeadingIndicator } from "./HeadingIndicator";
|
|
14
12
|
import { NativeUserLocation } from "./NativeUserLocation";
|
|
13
|
+
import { UserLocationPuck } from "./UserLocationPuck";
|
|
15
14
|
import {
|
|
16
15
|
type Location,
|
|
17
16
|
LocationManager,
|
|
18
17
|
} from "../modules/location/LocationManager";
|
|
19
|
-
import { type CircleLayerStyle } from "../types/MapLibreRNStyles";
|
|
20
18
|
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
const layerStyles: Record<string, CircleLayerStyle> = {
|
|
24
|
-
pluse: {
|
|
25
|
-
circleRadius: 15,
|
|
26
|
-
circleColor: mapboxBlue,
|
|
27
|
-
circleOpacity: 0.2,
|
|
28
|
-
circlePitchAlignment: "map",
|
|
29
|
-
},
|
|
30
|
-
background: {
|
|
31
|
-
circleRadius: 9,
|
|
32
|
-
circleColor: "#fff",
|
|
33
|
-
circlePitchAlignment: "map",
|
|
34
|
-
},
|
|
35
|
-
foreground: {
|
|
36
|
-
circleRadius: 6,
|
|
37
|
-
circleColor: mapboxBlue,
|
|
38
|
-
circlePitchAlignment: "map",
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const normalIcon = (
|
|
43
|
-
showsUserHeadingIndicator?: boolean,
|
|
44
|
-
heading?: number,
|
|
45
|
-
) => [
|
|
46
|
-
<CircleLayer
|
|
47
|
-
key="mapboxUserLocationPluseCircle"
|
|
48
|
-
id="mapboxUserLocationPluseCircle"
|
|
49
|
-
style={layerStyles.pluse}
|
|
50
|
-
/>,
|
|
51
|
-
<CircleLayer
|
|
52
|
-
key="mapboxUserLocationWhiteCircle"
|
|
53
|
-
id="mapboxUserLocationWhiteCircle"
|
|
54
|
-
style={layerStyles.background}
|
|
55
|
-
/>,
|
|
56
|
-
<CircleLayer
|
|
57
|
-
key="mapboxUserLocationBlueCicle"
|
|
58
|
-
id="mapboxUserLocationBlueCicle"
|
|
59
|
-
aboveLayerID="mapboxUserLocationWhiteCircle"
|
|
60
|
-
style={layerStyles.foreground}
|
|
61
|
-
/>,
|
|
62
|
-
...(showsUserHeadingIndicator && heading
|
|
63
|
-
? [HeadingIndicator({ heading })]
|
|
64
|
-
: []),
|
|
65
|
-
];
|
|
19
|
+
const USER_LOCATION_SOURCE_ID = "mlrn-user-location";
|
|
66
20
|
|
|
67
21
|
interface UserLocationProps {
|
|
68
22
|
/**
|
|
@@ -290,15 +244,23 @@ export const UserLocation = memo(
|
|
|
290
244
|
return (
|
|
291
245
|
<Annotation
|
|
292
246
|
animated={animated}
|
|
293
|
-
id=
|
|
247
|
+
id={USER_LOCATION_SOURCE_ID}
|
|
294
248
|
onPress={onPress}
|
|
295
249
|
coordinates={userLocationState.coordinates}
|
|
296
250
|
style={{
|
|
297
251
|
iconRotate: userLocationState.heading,
|
|
298
252
|
}}
|
|
299
253
|
>
|
|
300
|
-
{children ||
|
|
301
|
-
|
|
254
|
+
{children || (
|
|
255
|
+
<UserLocationPuck
|
|
256
|
+
sourceID={USER_LOCATION_SOURCE_ID}
|
|
257
|
+
heading={
|
|
258
|
+
showsUserHeadingIndicator
|
|
259
|
+
? userLocationState.heading
|
|
260
|
+
: undefined
|
|
261
|
+
}
|
|
262
|
+
/>
|
|
263
|
+
)}
|
|
302
264
|
</Annotation>
|
|
303
265
|
);
|
|
304
266
|
},
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { memo } from "react";
|
|
2
|
+
|
|
3
|
+
import { CircleLayer } from "./CircleLayer";
|
|
4
|
+
import { UserLocationPuckHeading } from "./UserLocationPuckHeading";
|
|
5
|
+
import type { BaseProps } from "../types/BaseProps";
|
|
6
|
+
import type { CircleLayerStyle } from "../types/MapLibreRNStyles";
|
|
7
|
+
|
|
8
|
+
const blue = "#33B5E5";
|
|
9
|
+
|
|
10
|
+
const layerStyles: Record<"pulse" | "white" | "blue", CircleLayerStyle> = {
|
|
11
|
+
pulse: {
|
|
12
|
+
circleRadius: 15,
|
|
13
|
+
circleColor: blue,
|
|
14
|
+
circleOpacity: 0.2,
|
|
15
|
+
circlePitchAlignment: "map",
|
|
16
|
+
},
|
|
17
|
+
white: {
|
|
18
|
+
circleRadius: 9,
|
|
19
|
+
circleColor: "#fff",
|
|
20
|
+
circlePitchAlignment: "map",
|
|
21
|
+
},
|
|
22
|
+
blue: {
|
|
23
|
+
circleRadius: 6,
|
|
24
|
+
circleColor: blue,
|
|
25
|
+
circlePitchAlignment: "map",
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
interface UserLocationPuckProps extends BaseProps {
|
|
30
|
+
sourceID: string;
|
|
31
|
+
heading?: number;
|
|
32
|
+
belowLayerID?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const UserLocationPuck = memo(
|
|
36
|
+
({ sourceID, heading }: UserLocationPuckProps) => (
|
|
37
|
+
<>
|
|
38
|
+
<CircleLayer
|
|
39
|
+
id="mlrn-user-location-puck-pulse"
|
|
40
|
+
sourceID={sourceID}
|
|
41
|
+
style={layerStyles.pulse}
|
|
42
|
+
/>
|
|
43
|
+
<CircleLayer
|
|
44
|
+
id="mlrn-user-location-puck-white"
|
|
45
|
+
sourceID={sourceID}
|
|
46
|
+
style={layerStyles.white}
|
|
47
|
+
/>
|
|
48
|
+
<CircleLayer
|
|
49
|
+
id="mlrn-user-location-puck-blue"
|
|
50
|
+
sourceID={sourceID}
|
|
51
|
+
style={layerStyles.blue}
|
|
52
|
+
/>
|
|
53
|
+
{typeof heading === "number" && (
|
|
54
|
+
<UserLocationPuckHeading
|
|
55
|
+
sourceID={sourceID}
|
|
56
|
+
belowLayerID="mlrn-user-location-puck-white"
|
|
57
|
+
heading={heading}
|
|
58
|
+
/>
|
|
59
|
+
)}
|
|
60
|
+
</>
|
|
61
|
+
),
|
|
62
|
+
);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { memo } from "react";
|
|
2
|
+
|
|
3
|
+
import { SymbolLayer } from "./SymbolLayer";
|
|
4
|
+
import headingIcon from "../assets/heading.png";
|
|
5
|
+
import { type BaseProps } from "../types/BaseProps";
|
|
6
|
+
import type { SymbolLayerStyle } from "../types/MapLibreRNStyles";
|
|
7
|
+
|
|
8
|
+
const layerStyle: SymbolLayerStyle = {
|
|
9
|
+
iconImage: headingIcon,
|
|
10
|
+
iconAllowOverlap: true,
|
|
11
|
+
iconPitchAlignment: "map",
|
|
12
|
+
iconRotationAlignment: "map",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
interface UserLocationPuckHeadingProps extends BaseProps {
|
|
16
|
+
sourceID: string;
|
|
17
|
+
belowLayerID?: string;
|
|
18
|
+
heading: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const UserLocationPuckHeading = memo(
|
|
22
|
+
({ sourceID, belowLayerID, heading }: UserLocationPuckHeadingProps) => (
|
|
23
|
+
<SymbolLayer
|
|
24
|
+
id="mlrn-user-location-puck-heading"
|
|
25
|
+
sourceID={sourceID}
|
|
26
|
+
belowLayerID={belowLayerID}
|
|
27
|
+
style={{
|
|
28
|
+
iconRotate: heading,
|
|
29
|
+
...layerStyle,
|
|
30
|
+
}}
|
|
31
|
+
/>
|
|
32
|
+
),
|
|
33
|
+
);
|