@maplibre/maplibre-react-native 11.0.0-alpha.16 → 11.0.0-alpha.17
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/android/src/main/java/org/maplibre/reactnative/components/camera/MLRNCameraManager.kt +3 -5
- package/android/src/main/java/org/maplibre/reactnative/components/location/LocationComponentManager.kt +154 -0
- package/android/src/main/java/org/maplibre/reactnative/components/location/MLRNNativeUserLocation.kt +70 -0
- package/android/src/main/java/org/maplibre/reactnative/components/location/MLRNNativeUserLocationManager.kt +50 -0
- package/android/src/main/java/org/maplibre/reactnative/modules/MLRNLocationModule.kt +20 -4
- package/ios/components/camera/MLRNCameraComponentView.h +0 -8
- package/ios/components/map-view/MLRNMapView.m +1 -1
- package/ios/components/map-view/MLRNMapViewComponentView.h +0 -5
- package/ios/components/user-location/MLRNNativeUserLocation.h +1 -1
- package/ios/components/user-location/MLRNNativeUserLocation.m +6 -5
- package/ios/components/user-location/MLRNNativeUserLocationComponentView.h +10 -0
- package/ios/components/user-location/MLRNNativeUserLocationComponentView.mm +51 -0
- package/ios/modules/location/MLRNLocation.m +17 -14
- package/ios/modules/logging/MLRNLogging.h +0 -5
- package/lib/commonjs/components/annotations/Annotation.js +2 -1
- package/lib/commonjs/components/annotations/Annotation.js.map +1 -1
- package/lib/commonjs/components/sources/ShapeSource.js +1 -0
- package/lib/commonjs/components/sources/ShapeSource.js.map +1 -1
- package/lib/commonjs/components/user-location/NativeUserLocation.js +3 -4
- package/lib/commonjs/components/user-location/NativeUserLocation.js.map +1 -1
- package/lib/commonjs/components/user-location/UserLocation.js +22 -132
- package/lib/commonjs/components/user-location/UserLocation.js.map +1 -1
- package/lib/commonjs/components/user-location/UserLocationNativeComponent.ts +19 -0
- package/lib/commonjs/components/user-location/UserLocationPuck.js +34 -22
- package/lib/commonjs/components/user-location/UserLocationPuck.js.map +1 -1
- package/lib/commonjs/components/user-location/UserLocationPuckHeading.js +3 -2
- package/lib/commonjs/components/user-location/UserLocationPuckHeading.js.map +1 -1
- package/lib/commonjs/hooks/useCurrentPosition.js +34 -0
- package/lib/commonjs/hooks/useCurrentPosition.js.map +1 -0
- package/lib/commonjs/index.js +12 -11
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils/animated/Animated.js +1 -7
- package/lib/commonjs/utils/animated/Animated.js.map +1 -1
- package/lib/module/components/annotations/Annotation.js +3 -2
- package/lib/module/components/annotations/Annotation.js.map +1 -1
- package/lib/module/components/sources/ShapeSource.js +1 -0
- package/lib/module/components/sources/ShapeSource.js.map +1 -1
- package/lib/module/components/user-location/NativeUserLocation.js +2 -4
- package/lib/module/components/user-location/NativeUserLocation.js.map +1 -1
- package/lib/module/components/user-location/UserLocation.js +22 -132
- package/lib/module/components/user-location/UserLocation.js.map +1 -1
- package/lib/module/components/user-location/UserLocationNativeComponent.ts +19 -0
- package/lib/module/components/user-location/UserLocationPuck.js +34 -22
- package/lib/module/components/user-location/UserLocationPuck.js.map +1 -1
- package/lib/module/components/user-location/UserLocationPuckHeading.js +3 -2
- package/lib/module/components/user-location/UserLocationPuckHeading.js.map +1 -1
- package/lib/module/hooks/useCurrentPosition.js +30 -0
- package/lib/module/hooks/useCurrentPosition.js.map +1 -0
- package/lib/module/index.js +3 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/animated/Animated.js +0 -6
- package/lib/module/utils/animated/Animated.js.map +1 -1
- package/lib/typescript/commonjs/src/components/annotations/Annotation.d.ts +3 -2
- package/lib/typescript/commonjs/src/components/annotations/Annotation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/sources/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/user-location/NativeUserLocation.d.ts +12 -13
- package/lib/typescript/commonjs/src/components/user-location/NativeUserLocation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/user-location/UserLocation.d.ts +13 -53
- package/lib/typescript/commonjs/src/components/user-location/UserLocation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/user-location/UserLocationNativeComponent.d.ts +8 -0
- package/lib/typescript/commonjs/src/components/user-location/UserLocationNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/user-location/UserLocationPuck.d.ts +2 -1
- package/lib/typescript/commonjs/src/components/user-location/UserLocationPuck.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/user-location/UserLocationPuckHeading.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useCurrentPosition.d.ts +18 -0
- package/lib/typescript/commonjs/src/hooks/useCurrentPosition.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +3 -3
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/location/LocationManager.d.ts +3 -3
- package/lib/typescript/commonjs/src/modules/location/LocationManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/location/NativeLocationModule.d.ts +3 -3
- package/lib/typescript/commonjs/src/modules/location/NativeLocationModule.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/Animated.d.ts +1 -13
- package/lib/typescript/commonjs/src/utils/animated/Animated.d.ts.map +1 -1
- package/lib/typescript/module/src/components/annotations/Annotation.d.ts +3 -2
- package/lib/typescript/module/src/components/annotations/Annotation.d.ts.map +1 -1
- package/lib/typescript/module/src/components/sources/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/module/src/components/user-location/NativeUserLocation.d.ts +12 -13
- package/lib/typescript/module/src/components/user-location/NativeUserLocation.d.ts.map +1 -1
- package/lib/typescript/module/src/components/user-location/UserLocation.d.ts +13 -53
- package/lib/typescript/module/src/components/user-location/UserLocation.d.ts.map +1 -1
- package/lib/typescript/module/src/components/user-location/UserLocationNativeComponent.d.ts +8 -0
- package/lib/typescript/module/src/components/user-location/UserLocationNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/components/user-location/UserLocationPuck.d.ts +2 -1
- package/lib/typescript/module/src/components/user-location/UserLocationPuck.d.ts.map +1 -1
- package/lib/typescript/module/src/components/user-location/UserLocationPuckHeading.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useCurrentPosition.d.ts +18 -0
- package/lib/typescript/module/src/hooks/useCurrentPosition.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +3 -3
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/location/LocationManager.d.ts +3 -3
- package/lib/typescript/module/src/modules/location/LocationManager.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/location/NativeLocationModule.d.ts +3 -3
- package/lib/typescript/module/src/modules/location/NativeLocationModule.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/Animated.d.ts +1 -13
- package/lib/typescript/module/src/utils/animated/Animated.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/components/annotations/Annotation.tsx +7 -5
- package/src/components/sources/ShapeSource.tsx +1 -0
- package/src/components/user-location/NativeUserLocation.tsx +15 -19
- package/src/components/user-location/UserLocation.tsx +65 -249
- package/src/components/user-location/UserLocationNativeComponent.ts +19 -0
- package/src/components/user-location/UserLocationPuck.tsx +47 -28
- package/src/components/user-location/UserLocationPuckHeading.tsx +2 -1
- package/src/hooks/useCurrentPosition.ts +53 -0
- package/src/index.ts +5 -6
- package/src/modules/location/LocationManager.ts +3 -3
- package/src/modules/location/NativeLocationModule.ts +3 -3
- package/src/utils/animated/Animated.ts +1 -28
- package/android/src/main/java/org/maplibre/reactnative/components/location/LocationComponentManager.java +0 -165
- package/android/src/main/java/org/maplibre/reactnative/components/location/MLRNNativeUserLocation.java +0 -76
- package/android/src/main/java/org/maplibre/reactnative/components/location/MLRNNativeUserLocationManager.java +0 -40
- package/ios/components/user-location/MLRNNativeUserLocationManager.h +0 -5
- package/ios/components/user-location/MLRNNativeUserLocationManager.m +0 -21
- package/lib/commonjs/modules/location/requestAndroidLocationPermissions.js +0 -14
- package/lib/commonjs/modules/location/requestAndroidLocationPermissions.js.map +0 -1
- package/lib/module/modules/location/requestAndroidLocationPermissions.js +0 -11
- package/lib/module/modules/location/requestAndroidLocationPermissions.js.map +0 -1
- package/lib/typescript/commonjs/src/modules/location/requestAndroidLocationPermissions.d.ts +0 -5
- package/lib/typescript/commonjs/src/modules/location/requestAndroidLocationPermissions.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/location/requestAndroidLocationPermissions.d.ts +0 -5
- package/lib/typescript/module/src/modules/location/requestAndroidLocationPermissions.d.ts.map +0 -1
- package/src/modules/location/requestAndroidLocationPermissions.ts +0 -8
|
@@ -1,152 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { NativeUserLocation } from "./NativeUserLocation.js";
|
|
3
|
+
import { memo, useMemo } from "react";
|
|
5
4
|
import { UserLocationPuck } from "./UserLocationPuck.js";
|
|
6
|
-
import {
|
|
5
|
+
import { useCurrentPosition } from "../../hooks/useCurrentPosition.js";
|
|
7
6
|
import { Annotation } from "../annotations/Annotation.js";
|
|
8
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
const
|
|
10
|
-
export let UserLocationRenderMode = /*#__PURE__*/function (UserLocationRenderMode) {
|
|
11
|
-
UserLocationRenderMode["Native"] = "native";
|
|
12
|
-
UserLocationRenderMode["Normal"] = "normal";
|
|
13
|
-
return UserLocationRenderMode;
|
|
14
|
-
}({});
|
|
15
|
-
export const UserLocation = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(({
|
|
8
|
+
export const UserLocation = /*#__PURE__*/memo(({
|
|
16
9
|
animated = true,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
minDisplacement
|
|
20
|
-
renderMode = "normal",
|
|
21
|
-
androidRenderMode,
|
|
22
|
-
androidPreferredFramesPerSecond,
|
|
10
|
+
accuracy = false,
|
|
11
|
+
heading = false,
|
|
12
|
+
minDisplacement,
|
|
23
13
|
children,
|
|
24
|
-
onUpdate,
|
|
25
14
|
onPress
|
|
26
|
-
}
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
const [userLocationState, setUserLocationState] = useState({
|
|
30
|
-
shouldShowUserLocation: false
|
|
15
|
+
}) => {
|
|
16
|
+
const currentPosition = useCurrentPosition({
|
|
17
|
+
minDisplacement
|
|
31
18
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
* Notice, that listening will start automatically when
|
|
37
|
-
* either `onUpdate` or `visible` are set
|
|
38
|
-
*
|
|
39
|
-
* @async
|
|
40
|
-
* @param {{running: boolean}} running - Object with key `running` and `boolean` value
|
|
41
|
-
* @return {Promise<void>}
|
|
42
|
-
*/
|
|
43
|
-
setLocationManager,
|
|
44
|
-
/**
|
|
45
|
-
*
|
|
46
|
-
* If LocationManager should be running
|
|
47
|
-
*
|
|
48
|
-
* @return {boolean}
|
|
49
|
-
*/
|
|
50
|
-
needsLocationManagerRunning,
|
|
51
|
-
_onLocationUpdate
|
|
52
|
-
}));
|
|
53
|
-
useEffect(() => {
|
|
54
|
-
_isMounted.current = true;
|
|
55
|
-
setLocationManager({
|
|
56
|
-
running: needsLocationManagerRunning()
|
|
57
|
-
}).then(() => {
|
|
58
|
-
if (renderMode === UserLocationRenderMode.Native) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
LocationManager.setMinDisplacement(minDisplacement);
|
|
62
|
-
});
|
|
63
|
-
return () => {
|
|
64
|
-
_isMounted.current = false;
|
|
65
|
-
setLocationManager({
|
|
66
|
-
running: false
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
70
|
-
}, []);
|
|
71
|
-
useEffect(() => {
|
|
72
|
-
LocationManager.setMinDisplacement(minDisplacement);
|
|
73
|
-
}, [minDisplacement]);
|
|
74
|
-
useEffect(() => {
|
|
75
|
-
if (!_isMounted.current) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
setLocationManager({
|
|
79
|
-
running: needsLocationManagerRunning()
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
async function setLocationManager({
|
|
83
|
-
running
|
|
84
|
-
}) {
|
|
85
|
-
if (locationManagerRunning.current !== running) {
|
|
86
|
-
locationManagerRunning.current = running;
|
|
87
|
-
if (running) {
|
|
88
|
-
LocationManager.addListener(_onLocationUpdate);
|
|
89
|
-
const location = await LocationManager.getCurrentPosition();
|
|
90
|
-
_onLocationUpdate(location);
|
|
91
|
-
} else {
|
|
92
|
-
LocationManager.removeListener(_onLocationUpdate);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
function needsLocationManagerRunning() {
|
|
97
|
-
return !!(!!onUpdate || renderMode === UserLocationRenderMode.Normal && visible);
|
|
98
|
-
}
|
|
99
|
-
function _onLocationUpdate(location) {
|
|
100
|
-
if (!_isMounted.current || !location) {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
let coordinates;
|
|
104
|
-
let heading;
|
|
105
|
-
if (location && location.coords) {
|
|
106
|
-
const {
|
|
107
|
-
longitude,
|
|
108
|
-
latitude
|
|
109
|
-
} = location.coords;
|
|
110
|
-
heading = location.coords.heading;
|
|
111
|
-
coordinates = [longitude, latitude];
|
|
112
|
-
}
|
|
113
|
-
setUserLocationState({
|
|
114
|
-
...userLocationState,
|
|
115
|
-
coordinates,
|
|
116
|
-
heading
|
|
117
|
-
});
|
|
118
|
-
if (onUpdate) {
|
|
119
|
-
onUpdate(location);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
if (!visible) {
|
|
123
|
-
return null;
|
|
124
|
-
}
|
|
125
|
-
if (renderMode === UserLocationRenderMode.Native) {
|
|
126
|
-
const props = {
|
|
127
|
-
androidRenderMode,
|
|
128
|
-
iosShowsUserHeadingIndicator: showsUserHeadingIndicator,
|
|
129
|
-
androidPreferredFramesPerSecond
|
|
130
|
-
};
|
|
131
|
-
return /*#__PURE__*/_jsx(NativeUserLocation, {
|
|
132
|
-
...props
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
if (!userLocationState.coordinates) {
|
|
19
|
+
const coordinates = useMemo(() => {
|
|
20
|
+
return currentPosition?.coords ? [currentPosition.coords.longitude, currentPosition.coords.latitude] : undefined;
|
|
21
|
+
}, [currentPosition?.coords]);
|
|
22
|
+
if (!coordinates || !currentPosition) {
|
|
136
23
|
return null;
|
|
137
24
|
}
|
|
138
25
|
return /*#__PURE__*/_jsx(Annotation, {
|
|
139
26
|
animated: animated,
|
|
140
|
-
id:
|
|
27
|
+
id: "mlrn-user-location",
|
|
28
|
+
testID: "mlrn-user-location",
|
|
141
29
|
onPress: onPress,
|
|
142
|
-
coordinates:
|
|
30
|
+
coordinates: coordinates,
|
|
143
31
|
style: {
|
|
144
|
-
iconRotate:
|
|
32
|
+
iconRotate: currentPosition.coords.heading ?? undefined
|
|
145
33
|
},
|
|
146
34
|
children: children || /*#__PURE__*/_jsx(UserLocationPuck, {
|
|
147
|
-
|
|
148
|
-
|
|
35
|
+
testID: "mlrn-user-location-puck",
|
|
36
|
+
sourceID: "mlrn-user-location",
|
|
37
|
+
accuracy: accuracy ? currentPosition.coords.accuracy : undefined,
|
|
38
|
+
heading: heading ? currentPosition.coords.heading ?? undefined : undefined
|
|
149
39
|
})
|
|
150
40
|
});
|
|
151
|
-
})
|
|
41
|
+
});
|
|
152
42
|
//# sourceMappingURL=UserLocation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["memo","useMemo","UserLocationPuck","useCurrentPosition","Annotation","jsx","_jsx","UserLocation","animated","accuracy","heading","minDisplacement","children","onPress","currentPosition","coordinates","coords","longitude","latitude","undefined","id","testID","style","iconRotate","sourceID"],"sourceRoot":"../../../../src","sources":["components/user-location/UserLocation.tsx"],"mappings":";;AAAA,SAASA,IAAI,EAAkBC,OAAO,QAAQ,OAAO;AAErD,SAASC,gBAAgB,QAAQ,uBAAoB;AACrD,SAASC,kBAAkB,QAAQ,mCAAgC;AACnE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
|
1
|
+
import {
|
|
2
|
+
codegenNativeComponent,
|
|
3
|
+
type CodegenTypes,
|
|
4
|
+
type HostComponent,
|
|
5
|
+
type ViewProps,
|
|
6
|
+
} from "react-native";
|
|
7
|
+
|
|
8
|
+
export interface NativeProps extends ViewProps {
|
|
9
|
+
mode?: CodegenTypes.WithDefault<"default" | "heading" | "course", "default">;
|
|
10
|
+
|
|
11
|
+
androidPreferredFramesPerSecond?: CodegenTypes.WithDefault<
|
|
12
|
+
CodegenTypes.Int32,
|
|
13
|
+
-1
|
|
14
|
+
>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default codegenNativeComponent<NativeProps>(
|
|
18
|
+
"MLRNNativeUserLocation",
|
|
19
|
+
) as HostComponent<NativeProps>;
|
|
@@ -6,11 +6,14 @@ import { CircleLayer } from "../layers/CircleLayer.js";
|
|
|
6
6
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
7
|
const blue = "#33B5E5";
|
|
8
8
|
const layerStyles = {
|
|
9
|
-
|
|
10
|
-
circleRadius: 15,
|
|
9
|
+
accuracy: {
|
|
11
10
|
circleColor: blue,
|
|
12
11
|
circleOpacity: 0.2,
|
|
13
|
-
circlePitchAlignment: "map"
|
|
12
|
+
circlePitchAlignment: "map",
|
|
13
|
+
circleRadiusTransition: {
|
|
14
|
+
duration: 300,
|
|
15
|
+
delay: 0
|
|
16
|
+
}
|
|
14
17
|
},
|
|
15
18
|
white: {
|
|
16
19
|
circleRadius: 9,
|
|
@@ -25,24 +28,33 @@ const layerStyles = {
|
|
|
25
28
|
};
|
|
26
29
|
export const UserLocationPuck = /*#__PURE__*/memo(({
|
|
27
30
|
sourceID,
|
|
31
|
+
accuracy,
|
|
28
32
|
heading
|
|
29
|
-
}) =>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
33
|
+
}) => {
|
|
34
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
35
|
+
children: [typeof accuracy === "number" && /*#__PURE__*/_jsx(CircleLayer, {
|
|
36
|
+
id: "mlrn-user-location-puck-accuracy",
|
|
37
|
+
testID: "mlrn-user-location-puck-accuracy",
|
|
38
|
+
sourceID: sourceID,
|
|
39
|
+
style: {
|
|
40
|
+
...layerStyles.accuracy,
|
|
41
|
+
circleRadius: ["interpolate", ["exponential", 2], ["zoom"], 0, layerStyles.white.circleRadius, 22, layerStyles.white.circleRadius + accuracy * 100]
|
|
42
|
+
}
|
|
43
|
+
}), /*#__PURE__*/_jsx(CircleLayer, {
|
|
44
|
+
id: "mlrn-user-location-puck-white",
|
|
45
|
+
testID: "mlrn-user-location-puck-white",
|
|
46
|
+
sourceID: sourceID,
|
|
47
|
+
style: layerStyles.white
|
|
48
|
+
}), /*#__PURE__*/_jsx(CircleLayer, {
|
|
49
|
+
id: "mlrn-user-location-puck-blue",
|
|
50
|
+
testID: "mlrn-user-location-puck-blue",
|
|
51
|
+
sourceID: sourceID,
|
|
52
|
+
style: layerStyles.blue
|
|
53
|
+
}), typeof heading === "number" && /*#__PURE__*/_jsx(UserLocationPuckHeading, {
|
|
54
|
+
sourceID: sourceID,
|
|
55
|
+
belowLayerID: "mlrn-user-location-puck-white",
|
|
56
|
+
heading: heading
|
|
57
|
+
})]
|
|
58
|
+
});
|
|
59
|
+
});
|
|
48
60
|
//# sourceMappingURL=UserLocationPuck.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["memo","UserLocationPuckHeading","CircleLayer","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","blue","layerStyles","
|
|
1
|
+
{"version":3,"names":["memo","UserLocationPuckHeading","CircleLayer","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","blue","layerStyles","accuracy","circleColor","circleOpacity","circlePitchAlignment","circleRadiusTransition","duration","delay","white","circleRadius","UserLocationPuck","sourceID","heading","children","id","testID","style","belowLayerID"],"sourceRoot":"../../../../src","sources":["components/user-location/UserLocationPuck.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,OAAO;AAE5B,SAASC,uBAAuB,QAAQ,8BAA2B;AAGnE,SAASC,WAAW,QAAQ,0BAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAEpD,MAAMC,IAAI,GAAG,SAAS;AAEtB,MAAMC,WAAW,GAAG;EAClBC,QAAQ,EAAE;IACRC,WAAW,EAAEH,IAAI;IACjBI,aAAa,EAAE,GAAG;IAClBC,oBAAoB,EAAE,KAAK;IAC3BC,sBAAsB,EAAE;MAAEC,QAAQ,EAAE,GAAG;MAAEC,KAAK,EAAE;IAAE;EACpD,CAAC;EACDC,KAAK,EAAE;IACLC,YAAY,EAAE,CAAC;IACfP,WAAW,EAAE,MAAM;IACnBE,oBAAoB,EAAE;EACxB,CAAC;EACDL,IAAI,EAAE;IACJU,YAAY,EAAE,CAAC;IACfP,WAAW,EAAEH,IAAI;IACjBK,oBAAoB,EAAE;EACxB;AACF,CAAmE;AASnE,OAAO,MAAMM,gBAAgB,gBAAGpB,IAAI,CAClC,CAAC;EAAEqB,QAAQ;EAAEV,QAAQ;EAAEW;AAA+B,CAAC,KAAK;EAC1D,oBACEd,KAAA,CAAAF,SAAA;IAAAiB,QAAA,GACG,OAAOZ,QAAQ,KAAK,QAAQ,iBAC3BP,IAAA,CAACF,WAAW;MACVsB,EAAE,EAAC,kCAAkC;MACrCC,MAAM,EAAC,kCAAkC;MACzCJ,QAAQ,EAAEA,QAAS;MACnBK,KAAK,EAAE;QACL,GAAGhB,WAAW,CAACC,QAAQ;QACvBQ,YAAY,EAAE,CACZ,aAAa,EACb,CAAC,aAAa,EAAE,CAAC,CAAC,EAClB,CAAC,MAAM,CAAC,EACR,CAAC,EACDT,WAAW,CAACQ,KAAK,CAACC,YAAY,EAC9B,EAAE,EACFT,WAAW,CAACQ,KAAK,CAACC,YAAY,GAAGR,QAAQ,GAAG,GAAG;MAEnD;IAAE,CACH,CACF,eACDP,IAAA,CAACF,WAAW;MACVsB,EAAE,EAAC,+BAA+B;MAClCC,MAAM,EAAC,+BAA+B;MACtCJ,QAAQ,EAAEA,QAAS;MACnBK,KAAK,EAAEhB,WAAW,CAACQ;IAAM,CAC1B,CAAC,eACFd,IAAA,CAACF,WAAW;MACVsB,EAAE,EAAC,8BAA8B;MACjCC,MAAM,EAAC,8BAA8B;MACrCJ,QAAQ,EAAEA,QAAS;MACnBK,KAAK,EAAEhB,WAAW,CAACD;IAAK,CACzB,CAAC,EACD,OAAOa,OAAO,KAAK,QAAQ,iBAC1BlB,IAAA,CAACH,uBAAuB;MACtBoB,QAAQ,EAAEA,QAAS;MACnBM,YAAY,EAAC,+BAA+B;MAC5CL,OAAO,EAAEA;IAAQ,CAClB,CACF;EAAA,CACD,CAAC;AAEP,CACF,CAAC","ignoreList":[]}
|
|
@@ -16,11 +16,12 @@ export const UserLocationPuckHeading = /*#__PURE__*/memo(({
|
|
|
16
16
|
heading
|
|
17
17
|
}) => /*#__PURE__*/_jsx(SymbolLayer, {
|
|
18
18
|
id: "mlrn-user-location-puck-heading",
|
|
19
|
+
testID: "mlrn-user-location-puck-heading",
|
|
19
20
|
sourceID: sourceID,
|
|
20
21
|
belowLayerID: belowLayerID,
|
|
21
22
|
style: {
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
...layerStyle,
|
|
24
|
+
iconRotate: heading
|
|
24
25
|
}
|
|
25
26
|
}));
|
|
26
27
|
//# sourceMappingURL=UserLocationPuckHeading.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["memo","headingIcon","SymbolLayer","jsx","_jsx","layerStyle","iconImage","iconAllowOverlap","iconPitchAlignment","iconRotationAlignment","UserLocationPuckHeading","sourceID","belowLayerID","heading","id","style","iconRotate"],"sourceRoot":"../../../../src","sources":["components/user-location/UserLocationPuckHeading.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,OAAO;AAE5B,OAAOC,WAAW,MAAM,0BAA0B;AAGlD,SAASC,WAAW,QAAQ,0BAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEpD,MAAMC,UAA4B,GAAG;EACnCC,SAAS,EAAEL,WAAW;EACtBM,gBAAgB,EAAE,IAAI;EACtBC,kBAAkB,EAAE,KAAK;EACzBC,qBAAqB,EAAE;AACzB,CAAC;AAQD,OAAO,MAAMC,uBAAuB,gBAAGV,IAAI,CACzC,CAAC;EAAEW,QAAQ;EAAEC,YAAY;EAAEC;AAAsC,CAAC,kBAChET,IAAA,CAACF,WAAW;EACVY,EAAE,EAAC,iCAAiC;
|
|
1
|
+
{"version":3,"names":["memo","headingIcon","SymbolLayer","jsx","_jsx","layerStyle","iconImage","iconAllowOverlap","iconPitchAlignment","iconRotationAlignment","UserLocationPuckHeading","sourceID","belowLayerID","heading","id","testID","style","iconRotate"],"sourceRoot":"../../../../src","sources":["components/user-location/UserLocationPuckHeading.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,OAAO;AAE5B,OAAOC,WAAW,MAAM,0BAA0B;AAGlD,SAASC,WAAW,QAAQ,0BAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEpD,MAAMC,UAA4B,GAAG;EACnCC,SAAS,EAAEL,WAAW;EACtBM,gBAAgB,EAAE,IAAI;EACtBC,kBAAkB,EAAE,KAAK;EACzBC,qBAAqB,EAAE;AACzB,CAAC;AAQD,OAAO,MAAMC,uBAAuB,gBAAGV,IAAI,CACzC,CAAC;EAAEW,QAAQ;EAAEC,YAAY;EAAEC;AAAsC,CAAC,kBAChET,IAAA,CAACF,WAAW;EACVY,EAAE,EAAC,iCAAiC;EACpCC,MAAM,EAAC,iCAAiC;EACxCJ,QAAQ,EAAEA,QAAS;EACnBC,YAAY,EAAEA,YAAa;EAC3BI,KAAK,EAAE;IACL,GAAGX,UAAU;IACbY,UAAU,EAAEJ;EACd;AAAE,CACH,CAEL,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useEffect, useState } from "react";
|
|
4
|
+
import { LocationManager } from "../modules/location/LocationManager.js";
|
|
5
|
+
export function useCurrentPosition({
|
|
6
|
+
enabled = true,
|
|
7
|
+
minDisplacement
|
|
8
|
+
} = {}) {
|
|
9
|
+
const [currentPosition, setCurrentPosition] = useState();
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (minDisplacement !== undefined) {
|
|
12
|
+
LocationManager.setMinDisplacement(minDisplacement);
|
|
13
|
+
}
|
|
14
|
+
}, [minDisplacement]);
|
|
15
|
+
const handleUpdate = useCallback(position => {
|
|
16
|
+
setCurrentPosition(position);
|
|
17
|
+
}, []);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (enabled) {
|
|
20
|
+
LocationManager.addListener(handleUpdate);
|
|
21
|
+
}
|
|
22
|
+
return () => {
|
|
23
|
+
if (enabled) {
|
|
24
|
+
LocationManager.removeListener(handleUpdate);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}, [enabled, handleUpdate]);
|
|
28
|
+
return currentPosition;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=useCurrentPosition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useEffect","useState","LocationManager","useCurrentPosition","enabled","minDisplacement","currentPosition","setCurrentPosition","undefined","setMinDisplacement","handleUpdate","position","addListener","removeListener"],"sourceRoot":"../../../src","sources":["hooks/useCurrentPosition.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAExD,SAEEC,eAAe,QACV,wCAAqC;AAkB5C,OAAO,SAASC,kBAAkBA,CAAC;EACjCC,OAAO,GAAG,IAAI;EACdC;AACyB,CAAC,GAAG,CAAC,CAAC,EAAE;EACjC,MAAM,CAACC,eAAe,EAAEC,kBAAkB,CAAC,GAAGN,QAAQ,CAAsB,CAAC;EAE7ED,SAAS,CAAC,MAAM;IACd,IAAIK,eAAe,KAAKG,SAAS,EAAE;MACjCN,eAAe,CAACO,kBAAkB,CAACJ,eAAe,CAAC;IACrD;EACF,CAAC,EAAE,CAACA,eAAe,CAAC,CAAC;EAErB,MAAMK,YAAY,GAAGX,WAAW,CAAEY,QAA6B,IAAK;IAClEJ,kBAAkB,CAACI,QAAQ,CAAC;EAC9B,CAAC,EAAE,EAAE,CAAC;EAENX,SAAS,CAAC,MAAM;IACd,IAAII,OAAO,EAAE;MACXF,eAAe,CAACU,WAAW,CAACF,YAAY,CAAC;IAC3C;IAEA,OAAO,MAAM;MACX,IAAIN,OAAO,EAAE;QACXF,eAAe,CAACW,cAAc,CAACH,YAAY,CAAC;MAC9C;IACF,CAAC;EACH,CAAC,EAAE,CAACN,OAAO,EAAEM,YAAY,CAAC,CAAC;EAE3B,OAAOJ,eAAe;AACxB","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -6,7 +6,9 @@ export { MapView } from "./components/map-view/MapView.js";
|
|
|
6
6
|
export { PointAnnotation } from "./components/annotations/PointAnnotation.js";
|
|
7
7
|
export { Annotation } from "./components/annotations/Annotation.js";
|
|
8
8
|
export { Callout } from "./components/annotations/Callout.js";
|
|
9
|
-
export { UserLocation
|
|
9
|
+
export { UserLocation } from "./components/user-location/UserLocation.js";
|
|
10
|
+
export { NativeUserLocation } from "./components/user-location/NativeUserLocation.js";
|
|
11
|
+
export { useCurrentPosition } from "./hooks/useCurrentPosition.js";
|
|
10
12
|
export { VectorSource } from "./components/sources/VectorSource.js";
|
|
11
13
|
export { ShapeSource } from "./components/sources/ShapeSource.js";
|
|
12
14
|
export { RasterSource } from "./components/sources/RasterSource.js";
|
|
@@ -22,7 +24,6 @@ export { RasterLayer } from "./components/layers/RasterLayer.js";
|
|
|
22
24
|
export { BackgroundLayer } from "./components/layers/BackgroundLayer.js";
|
|
23
25
|
export { MarkerView } from "./components/annotations/MarkerView.js";
|
|
24
26
|
export { LocationManager } from "./modules/location/LocationManager.js";
|
|
25
|
-
export { requestAndroidLocationPermissions } from "./modules/location/requestAndroidLocationPermissions.js";
|
|
26
27
|
export { OfflineManager } from "./modules/offline/OfflineManager.js";
|
|
27
28
|
export { OfflinePack } from "./modules/offline/OfflinePack.js";
|
|
28
29
|
export { OfflineCreatePackOptions } from "./modules/offline/OfflineCreatePackOptions.js";
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Camera","MapView","PointAnnotation","Annotation","Callout","UserLocation","
|
|
1
|
+
{"version":3,"names":["Camera","MapView","PointAnnotation","Annotation","Callout","UserLocation","NativeUserLocation","useCurrentPosition","VectorSource","ShapeSource","RasterSource","ImageSource","Images","FillLayer","FillExtrusionLayer","HeatmapLayer","LineLayer","CircleLayer","SymbolLayer","RasterLayer","BackgroundLayer","MarkerView","LocationManager","OfflineManager","OfflinePack","OfflineCreatePackOptions","SnapshotManager","Animated","Logger"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,cAAc,iBAAc;AAE5B,SAcEA,MAAM,QACD,+BAA4B;AAEnC,SACEC,OAAO,QAIF,kCAA+B;AAEtC,SAASC,eAAe,QAAQ,6CAA0C;AAE1E,SAASC,UAAU,QAAQ,wCAAqC;AAChE,SAASC,OAAO,QAAQ,qCAAkC;AAE1D,SAASC,YAAY,QAAQ,4CAAyC;AACtE,SAASC,kBAAkB,QAAQ,kDAA+C;AAClF,SAASC,kBAAkB,QAAQ,+BAA4B;AAE/D,SAASC,YAAY,QAAQ,sCAAmC;AAChE,SAASC,WAAW,QAAQ,qCAAkC;AAE9D,SAASC,YAAY,QAAQ,sCAAmC;AAChE,SAASC,WAAW,QAAQ,qCAAkC;AAC9D,SAASC,MAAM,QAAQ,wBAAqB;AAC5C,SAASC,SAAS,QAAQ,kCAA+B;AACzD,SAASC,kBAAkB,QAAQ,2CAAwC;AAC3E,SAASC,YAAY,QAAQ,qCAAkC;AAC/D,SAASC,SAAS,QAAQ,kCAA+B;AACzD,SAASC,WAAW,QAAQ,oCAAiC;AAC7D,SAASC,WAAW,QAAQ,oCAAiC;AAC7D,SAASC,WAAW,QAAQ,oCAAiC;AAC7D,SAASC,eAAe,QAAQ,wCAAqC;AACrE,SAASC,UAAU,QAAQ,wCAAqC;AAEhE,SACEC,eAAe,QAEV,uCAAoC;AAE3C,SAASC,cAAc,QAAQ,qCAAkC;AAGjE,SAASC,WAAW,QAAQ,kCAA+B;AAC3D,SAASC,wBAAwB,QAAQ,+CAA4C;AACrF,SAASC,eAAe,QAAQ,uCAAoC;AAoBpE,SAASC,QAAQ,QAAQ,8BAA2B;AACpD,SAASC,MAAM,QAAuB,qBAAkB","ignoreList":[]}
|
|
@@ -32,10 +32,4 @@ export const Animated = {
|
|
|
32
32
|
Shape: AnimatedShape,
|
|
33
33
|
ExtractCoordinateFromArray: AnimatedExtractCoordinateFromArray
|
|
34
34
|
};
|
|
35
|
-
/**
|
|
36
|
-
* Manual typing is required for AnimatedShapeSource because the
|
|
37
|
-
* following error:
|
|
38
|
-
* `Type instantiation is excessively deep and possibly infinite.ts(2589)`
|
|
39
|
-
*/
|
|
40
|
-
export const AnimatedShapeSource = RNAnimated.createAnimatedComponent(ShapeSource);
|
|
41
35
|
//# sourceMappingURL=Animated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Animated","RNAnimated","AnimatedCoordinatesArray","AnimatedExtractCoordinateFromArray","AnimatedRouteCoordinatesArray","AnimatedShape","BackgroundLayer","CircleLayer","FillExtrusionLayer","FillLayer","LineLayer","RasterLayer","SymbolLayer","ImageSource","ShapeSource","createAnimatedComponent","CoordinatesArray","RouteCoordinatesArray","Shape","ExtractCoordinateFromArray"
|
|
1
|
+
{"version":3,"names":["Animated","RNAnimated","AnimatedCoordinatesArray","AnimatedExtractCoordinateFromArray","AnimatedRouteCoordinatesArray","AnimatedShape","BackgroundLayer","CircleLayer","FillExtrusionLayer","FillLayer","LineLayer","RasterLayer","SymbolLayer","ImageSource","ShapeSource","createAnimatedComponent","CoordinatesArray","RouteCoordinatesArray","Shape","ExtractCoordinateFromArray"],"sourceRoot":"../../../../src","sources":["utils/animated/Animated.ts"],"mappings":";;AAAA,SAASA,QAAQ,IAAIC,UAAU,QAAQ,cAAc;AAErD,SAASC,wBAAwB,QAAQ,+BAA4B;AACrE,SAASC,kCAAkC,QAAQ,yCAAsC;AACzF,SAASC,6BAA6B,QAAQ,oCAAiC;AAC/E,SAASC,aAAa,QAAQ,oBAAiB;AAC/C,SAASC,eAAe,QAAQ,4CAAyC;AACzE,SAASC,WAAW,QAAQ,wCAAqC;AACjE,SAASC,kBAAkB,QAAQ,+CAA4C;AAC/E,SAASC,SAAS,QAAQ,sCAAmC;AAC7D,SAASC,SAAS,QAAQ,sCAAmC;AAC7D,SAASC,WAAW,QAAQ,wCAAqC;AACjE,SAASC,WAAW,QAAQ,wCAAqC;AACjE,SAASC,WAAW,QAAQ,yCAAsC;AAClE,SAASC,WAAW,QAAQ,yCAAsC;AAElE,OAAO,MAAMd,QAAQ,GAAG;EACtB;EACAc,WAAW,EAAEb,UAAU,CAACc,uBAAuB,CAACD,WAAW,CAAC;EAC5DD,WAAW,EAAEZ,UAAU,CAACc,uBAAuB,CAACF,WAAW,CAAC;EAE5D;EACAJ,SAAS,EAAER,UAAU,CAACc,uBAAuB,CAACN,SAAS,CAAC;EACxDD,kBAAkB,EAAEP,UAAU,CAACc,uBAAuB,CAACP,kBAAkB,CAAC;EAC1EE,SAAS,EAAET,UAAU,CAACc,uBAAuB,CAACL,SAAS,CAAC;EACxDH,WAAW,EAAEN,UAAU,CAACc,uBAAuB,CAACR,WAAW,CAAC;EAC5DK,WAAW,EAAEX,UAAU,CAACc,uBAAuB,CAACH,WAAW,CAAC;EAC5DD,WAAW,EAAEV,UAAU,CAACc,uBAAuB,CAACJ,WAAW,CAAC;EAC5DL,eAAe,EAAEL,UAAU,CAACc,uBAAuB,CAACT,eAAe,CAAC;EAEpE;EACAU,gBAAgB,EAAEd,wBAAwB;EAC1Ce,qBAAqB,EAAEb,6BAA6B;EACpDc,KAAK,EAAEb,aAAa;EACpBc,0BAA0B,EAAEhB;AAC9B,CAAC","ignoreList":[]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import { type NativeSyntheticEvent } from "react-native";
|
|
3
|
+
import type { BaseProps } from "../../types/BaseProps";
|
|
3
4
|
import { type SymbolLayerStyle } from "../../types/MapLibreRNStyles";
|
|
4
5
|
import { type PressEventWithFeatures } from "../../types/PressEvent";
|
|
5
|
-
interface AnnotationProps {
|
|
6
|
+
interface AnnotationProps extends BaseProps {
|
|
6
7
|
id: string;
|
|
7
8
|
animated?: boolean;
|
|
8
9
|
animationDuration?: number;
|
|
@@ -10,7 +11,7 @@ interface AnnotationProps {
|
|
|
10
11
|
coordinates?: number[];
|
|
11
12
|
onPress?: (event: NativeSyntheticEvent<PressEventWithFeatures>) => void;
|
|
12
13
|
children?: ReactNode;
|
|
13
|
-
style?:
|
|
14
|
+
style?: SymbolLayerStyle;
|
|
14
15
|
icon?: string | number | object;
|
|
15
16
|
}
|
|
16
17
|
interface AnnotationRef {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Annotation.d.ts","sourceRoot":"","sources":["../../../../../../src/components/annotations/Annotation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AACf,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAKrE,UAAU,
|
|
1
|
+
{"version":3,"file":"Annotation.d.ts","sourceRoot":"","sources":["../../../../../../src/components/annotations/Annotation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AACf,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAKrE,UAAU,eAAgB,SAAQ,SAAS;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uBAAuB,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAChD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,sBAAsB,CAAC,KAAK,IAAI,CAAC;IACxE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CACjC;AAoBD,UAAU,aAAa;IACrB,WAAW,EAAE,gBAAgB,GAAG,SAAS,CAAC;CAC3C;AAED,eAAO,MAAM,UAAU,2GA4FtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShapeSource.d.ts","sourceRoot":"","sources":["../../../../../../src/components/sources/ShapeSource.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAGT,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AACf,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,oB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IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,sBAAsB,CAAC,KAAK,IAAI,CAAC;IAExE;;OAEG;IACH,MAAM,CAAC,EAAE;QACP;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QACd;;WAEG;QACH,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAExE,uBAAuB,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnE,gBAAgB,CACd,OAAO,EAAE,OAAO,CAAC,OAAO,EACxB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEtC,kBAAkB,CAChB,OAAO,EAAE,OAAO,CAAC,OAAO,GACvB,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEtC,cAAc,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IAG7C,UAAU,EAAE,sBAAsB,GAAG,IAAI,CAAC;CAC3C;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"ShapeSource.d.ts","sourceRoot":"","sources":["../../../../../../src/components/sources/ShapeSource.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAGT,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AACf,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,oBAAoB,EAE1B,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACtB,MAAM,8BAA8B,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CAAC;QACd;;WAEG;QACH,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAExE,uBAAuB,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnE,gBAAgB,CACd,OAAO,EAAE,OAAO,CAAC,OAAO,EACxB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEtC,kBAAkB,CAChB,OAAO,EAAE,OAAO,CAAC,OAAO,GACvB,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEtC,cAAc,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IAG7C,UAAU,EAAE,sBAAsB,GAAG,IAAI,CAAC;CAC3C;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,wGA8LvB,CAAC"}
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
import type { BaseProps } from "../../types/BaseProps";
|
|
2
|
+
interface NativeUserLocationProps extends BaseProps {
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
+
* Rendering mode
|
|
4
5
|
*
|
|
5
|
-
* -
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
6
|
+
* - "default": Renders only a puck
|
|
7
|
+
* - "heading": Renders a puck with triangle indicating device heading based on compass
|
|
8
|
+
* - "course": Android renders an arrow indicating device heading based on GPS course, iOS behaves like mode="heading"
|
|
8
9
|
*
|
|
9
|
-
* @
|
|
10
|
+
* @default "default"
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
+
mode?: "default" | "heading" | "course";
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
+
* Limit the maximum frames per second for location updates on Android
|
|
14
15
|
*
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Android only. Set max FPS at which location animators can output updates. Use this setting to limit animation rate of the location puck on higher zoom levels to decrease the stress on the device's CPU which can directly improve battery life, without sacrificing UX.
|
|
16
|
+
* Use this setting to limit animation rate of the location puck to decrease the stress on the device's CPU which could improve battery life.
|
|
17
|
+
*
|
|
18
|
+
* @platform android
|
|
20
19
|
*/
|
|
21
20
|
androidPreferredFramesPerSecond?: number;
|
|
22
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeUserLocation.d.ts","sourceRoot":"","sources":["../../../../../../src/components/user-location/NativeUserLocation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NativeUserLocation.d.ts","sourceRoot":"","sources":["../../../../../../src/components/user-location/NativeUserLocation.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,UAAU,uBAAwB,SAAQ,SAAS;IACjD;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;IAExC;;;;;;OAMG;IACH,+BAA+B,CAAC,EAAE,MAAM,CAAC;CAC1C;AAED,eAAO,MAAM,kBAAkB,GAAI,OAAO,uBAAuB,4CAEhE,CAAC"}
|
|
@@ -1,69 +1,29 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
interface UserLocationProps {
|
|
2
|
+
export interface UserLocationProps {
|
|
4
3
|
/**
|
|
5
|
-
*
|
|
4
|
+
* Children to render inside the UserLocation Annotation, e.g. CircleLayer, SymbolLayer
|
|
6
5
|
*/
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Which render mode to use.
|
|
10
|
-
* Can either be `normal` or `native`
|
|
11
|
-
*/
|
|
12
|
-
renderMode?: "normal" | "native";
|
|
13
|
-
/**
|
|
14
|
-
* native/android only render mode
|
|
15
|
-
*
|
|
16
|
-
* - normal: just a circle
|
|
17
|
-
* - compass: triangle with heading
|
|
18
|
-
* - gps: large arrow
|
|
19
|
-
*
|
|
20
|
-
* @platform android
|
|
21
|
-
*/
|
|
22
|
-
androidRenderMode?: "normal" | "compass" | "gps";
|
|
23
|
-
/**
|
|
24
|
-
* Whether location icon is visible
|
|
25
|
-
*/
|
|
26
|
-
visible?: boolean;
|
|
6
|
+
children?: ReactNode;
|
|
27
7
|
/**
|
|
28
|
-
*
|
|
8
|
+
* Whether the UserLocation Annotation is animated between updates
|
|
29
9
|
*/
|
|
30
|
-
|
|
10
|
+
animated?: boolean;
|
|
31
11
|
/**
|
|
32
|
-
*
|
|
12
|
+
* Render a circle which indicates the accuracy of the location
|
|
33
13
|
*/
|
|
34
|
-
|
|
14
|
+
accuracy?: boolean;
|
|
35
15
|
/**
|
|
36
|
-
*
|
|
16
|
+
* Render an arrow which indicates direction the device is pointing relative to north
|
|
37
17
|
*/
|
|
38
|
-
|
|
18
|
+
heading?: boolean;
|
|
39
19
|
/**
|
|
40
|
-
* Minimum
|
|
20
|
+
* Minimum delta in meters for location updates
|
|
41
21
|
*/
|
|
42
22
|
minDisplacement?: number;
|
|
43
23
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* @platform android
|
|
47
|
-
*/
|
|
48
|
-
androidPreferredFramesPerSecond?: number;
|
|
49
|
-
/**
|
|
50
|
-
* Custom location icon of type mapbox-gl-native components
|
|
51
|
-
*
|
|
52
|
-
* NOTE: Forking maintainer does not understand the above comment.
|
|
24
|
+
* Event triggered on pressing the UserLocation Annotation
|
|
53
25
|
*/
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
export declare enum UserLocationRenderMode {
|
|
57
|
-
Native = "native",
|
|
58
|
-
Normal = "normal"
|
|
59
|
-
}
|
|
60
|
-
export interface UserLocationRef {
|
|
61
|
-
setLocationManager: (props: {
|
|
62
|
-
running: boolean;
|
|
63
|
-
}) => Promise<void>;
|
|
64
|
-
needsLocationManagerRunning: () => boolean;
|
|
65
|
-
_onLocationUpdate: (location: GeolocationPosition | undefined) => void;
|
|
26
|
+
onPress?: () => void;
|
|
66
27
|
}
|
|
67
|
-
export declare const UserLocation: import("react").
|
|
68
|
-
export {};
|
|
28
|
+
export declare const UserLocation: import("react").MemoExoticComponent<({ animated, accuracy, heading, minDisplacement, children, onPress, }: UserLocationProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
69
29
|
//# sourceMappingURL=UserLocation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserLocation.d.ts","sourceRoot":"","sources":["../../../../../../src/components/user-location/UserLocation.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"UserLocation.d.ts","sourceRoot":"","sources":["../../../../../../src/components/user-location/UserLocation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAMtD,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,YAAY,6GAQpB,iBAAiB,oDAuCrB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type CodegenTypes, type HostComponent, type ViewProps } from "react-native";
|
|
2
|
+
export interface NativeProps extends ViewProps {
|
|
3
|
+
mode?: CodegenTypes.WithDefault<"default" | "heading" | "course", "default">;
|
|
4
|
+
androidPreferredFramesPerSecond?: CodegenTypes.WithDefault<CodegenTypes.Int32, -1>;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: HostComponent<NativeProps>;
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=UserLocationNativeComponent.d.ts.map
|
package/lib/typescript/commonjs/src/components/user-location/UserLocationNativeComponent.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserLocationNativeComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/components/user-location/UserLocationNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,IAAI,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,SAAS,GAAG,SAAS,GAAG,QAAQ,EAAE,SAAS,CAAC,CAAC;IAE7E,+BAA+B,CAAC,EAAE,YAAY,CAAC,WAAW,CACxD,YAAY,CAAC,KAAK,EAClB,CAAC,CAAC,CACH,CAAC;CACH;wBAII,aAAa,CAAC,WAAW,CAAC;AAF/B,wBAEgC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { BaseProps } from "../../types/BaseProps";
|
|
2
2
|
interface UserLocationPuckProps extends BaseProps {
|
|
3
3
|
sourceID: string;
|
|
4
|
+
accuracy?: number;
|
|
4
5
|
heading?: number;
|
|
5
6
|
belowLayerID?: string;
|
|
6
7
|
}
|
|
7
|
-
export declare const UserLocationPuck: import("react").MemoExoticComponent<({ sourceID, heading }: UserLocationPuckProps) => import("react/jsx-runtime").JSX.Element>;
|
|
8
|
+
export declare const UserLocationPuck: import("react").MemoExoticComponent<({ sourceID, accuracy, heading }: UserLocationPuckProps) => import("react/jsx-runtime").JSX.Element>;
|
|
8
9
|
export {};
|
|
9
10
|
//# sourceMappingURL=UserLocationPuck.d.ts.map
|