@maplibre/maplibre-react-native 11.0.0-alpha.16 → 11.0.0-alpha.18

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.
Files changed (161) hide show
  1. package/android/src/main/java/org/maplibre/reactnative/MLRNPackage.kt +6 -6
  2. package/android/src/main/java/org/maplibre/reactnative/components/camera/MLRNCameraManager.kt +3 -5
  3. package/android/src/main/java/org/maplibre/reactnative/components/location/LocationComponentManager.kt +154 -0
  4. package/android/src/main/java/org/maplibre/reactnative/components/location/MLRNNativeUserLocation.kt +70 -0
  5. package/android/src/main/java/org/maplibre/reactnative/components/location/MLRNNativeUserLocationManager.kt +50 -0
  6. package/android/src/main/java/org/maplibre/reactnative/modules/MLRNLocationModule.kt +20 -4
  7. package/android/src/main/java/org/maplibre/reactnative/modules/MLRNLogModule.kt +99 -0
  8. package/ios/components/camera/MLRNCameraComponentView.h +0 -8
  9. package/ios/components/map-view/MLRNMapView.m +1 -1
  10. package/ios/components/map-view/MLRNMapViewComponentView.h +0 -5
  11. package/ios/components/user-location/MLRNNativeUserLocation.h +1 -1
  12. package/ios/components/user-location/MLRNNativeUserLocation.m +6 -5
  13. package/ios/components/user-location/MLRNNativeUserLocationComponentView.h +10 -0
  14. package/ios/components/user-location/MLRNNativeUserLocationComponentView.mm +51 -0
  15. package/ios/modules/location/MLRNLocation.m +17 -14
  16. package/ios/modules/logging/MLRNLogModule.h +10 -0
  17. package/ios/modules/logging/MLRNLogModule.mm +39 -0
  18. package/ios/modules/logging/MLRNLogging.h +15 -7
  19. package/ios/modules/logging/MLRNLogging.m +22 -55
  20. package/lib/commonjs/components/annotations/Annotation.js +2 -1
  21. package/lib/commonjs/components/annotations/Annotation.js.map +1 -1
  22. package/lib/commonjs/components/map-view/MapView.js +3 -3
  23. package/lib/commonjs/components/map-view/MapView.js.map +1 -1
  24. package/lib/commonjs/components/sources/ShapeSource.js +1 -0
  25. package/lib/commonjs/components/sources/ShapeSource.js.map +1 -1
  26. package/lib/commonjs/components/user-location/NativeUserLocation.js +3 -4
  27. package/lib/commonjs/components/user-location/NativeUserLocation.js.map +1 -1
  28. package/lib/commonjs/components/user-location/UserLocation.js +22 -132
  29. package/lib/commonjs/components/user-location/UserLocation.js.map +1 -1
  30. package/lib/commonjs/components/user-location/UserLocationNativeComponent.ts +19 -0
  31. package/lib/commonjs/components/user-location/UserLocationPuck.js +34 -22
  32. package/lib/commonjs/components/user-location/UserLocationPuck.js.map +1 -1
  33. package/lib/commonjs/components/user-location/UserLocationPuckHeading.js +3 -2
  34. package/lib/commonjs/components/user-location/UserLocationPuckHeading.js.map +1 -1
  35. package/lib/commonjs/hooks/useCurrentPosition.js +34 -0
  36. package/lib/commonjs/hooks/useCurrentPosition.js.map +1 -0
  37. package/lib/commonjs/index.js +16 -15
  38. package/lib/commonjs/index.js.map +1 -1
  39. package/lib/commonjs/modules/log/LogManager.js +99 -0
  40. package/lib/commonjs/modules/log/LogManager.js.map +1 -0
  41. package/lib/commonjs/modules/log/NativeLogModule.js +9 -0
  42. package/lib/commonjs/modules/log/NativeLogModule.js.map +1 -0
  43. package/lib/commonjs/utils/animated/Animated.js +1 -7
  44. package/lib/commonjs/utils/animated/Animated.js.map +1 -1
  45. package/lib/module/components/annotations/Annotation.js +3 -2
  46. package/lib/module/components/annotations/Annotation.js.map +1 -1
  47. package/lib/module/components/map-view/MapView.js +3 -3
  48. package/lib/module/components/map-view/MapView.js.map +1 -1
  49. package/lib/module/components/sources/ShapeSource.js +1 -0
  50. package/lib/module/components/sources/ShapeSource.js.map +1 -1
  51. package/lib/module/components/user-location/NativeUserLocation.js +2 -4
  52. package/lib/module/components/user-location/NativeUserLocation.js.map +1 -1
  53. package/lib/module/components/user-location/UserLocation.js +22 -132
  54. package/lib/module/components/user-location/UserLocation.js.map +1 -1
  55. package/lib/module/components/user-location/UserLocationNativeComponent.ts +19 -0
  56. package/lib/module/components/user-location/UserLocationPuck.js +34 -22
  57. package/lib/module/components/user-location/UserLocationPuck.js.map +1 -1
  58. package/lib/module/components/user-location/UserLocationPuckHeading.js +3 -2
  59. package/lib/module/components/user-location/UserLocationPuckHeading.js.map +1 -1
  60. package/lib/module/hooks/useCurrentPosition.js +30 -0
  61. package/lib/module/hooks/useCurrentPosition.js.map +1 -0
  62. package/lib/module/index.js +4 -3
  63. package/lib/module/index.js.map +1 -1
  64. package/lib/module/modules/log/LogManager.js +96 -0
  65. package/lib/module/modules/log/LogManager.js.map +1 -0
  66. package/lib/module/modules/log/NativeLogModule.js +5 -0
  67. package/lib/module/modules/log/NativeLogModule.js.map +1 -0
  68. package/lib/module/utils/animated/Animated.js +0 -6
  69. package/lib/module/utils/animated/Animated.js.map +1 -1
  70. package/lib/typescript/commonjs/src/components/annotations/Annotation.d.ts +3 -2
  71. package/lib/typescript/commonjs/src/components/annotations/Annotation.d.ts.map +1 -1
  72. package/lib/typescript/commonjs/src/components/sources/ShapeSource.d.ts.map +1 -1
  73. package/lib/typescript/commonjs/src/components/user-location/NativeUserLocation.d.ts +12 -13
  74. package/lib/typescript/commonjs/src/components/user-location/NativeUserLocation.d.ts.map +1 -1
  75. package/lib/typescript/commonjs/src/components/user-location/UserLocation.d.ts +13 -53
  76. package/lib/typescript/commonjs/src/components/user-location/UserLocation.d.ts.map +1 -1
  77. package/lib/typescript/commonjs/src/components/user-location/UserLocationNativeComponent.d.ts +8 -0
  78. package/lib/typescript/commonjs/src/components/user-location/UserLocationNativeComponent.d.ts.map +1 -0
  79. package/lib/typescript/commonjs/src/components/user-location/UserLocationPuck.d.ts +2 -1
  80. package/lib/typescript/commonjs/src/components/user-location/UserLocationPuck.d.ts.map +1 -1
  81. package/lib/typescript/commonjs/src/components/user-location/UserLocationPuckHeading.d.ts.map +1 -1
  82. package/lib/typescript/commonjs/src/hooks/useCurrentPosition.d.ts +18 -0
  83. package/lib/typescript/commonjs/src/hooks/useCurrentPosition.d.ts.map +1 -0
  84. package/lib/typescript/commonjs/src/index.d.ts +4 -4
  85. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  86. package/lib/typescript/commonjs/src/modules/location/LocationManager.d.ts +3 -3
  87. package/lib/typescript/commonjs/src/modules/location/LocationManager.d.ts.map +1 -1
  88. package/lib/typescript/commonjs/src/modules/location/NativeLocationModule.d.ts +3 -3
  89. package/lib/typescript/commonjs/src/modules/location/NativeLocationModule.d.ts.map +1 -1
  90. package/lib/typescript/commonjs/src/modules/log/LogManager.d.ts +45 -0
  91. package/lib/typescript/commonjs/src/modules/log/LogManager.d.ts.map +1 -0
  92. package/lib/typescript/commonjs/src/modules/log/NativeLogModule.d.ts +13 -0
  93. package/lib/typescript/commonjs/src/modules/log/NativeLogModule.d.ts.map +1 -0
  94. package/lib/typescript/commonjs/src/utils/animated/Animated.d.ts +1 -13
  95. package/lib/typescript/commonjs/src/utils/animated/Animated.d.ts.map +1 -1
  96. package/lib/typescript/module/src/components/annotations/Annotation.d.ts +3 -2
  97. package/lib/typescript/module/src/components/annotations/Annotation.d.ts.map +1 -1
  98. package/lib/typescript/module/src/components/sources/ShapeSource.d.ts.map +1 -1
  99. package/lib/typescript/module/src/components/user-location/NativeUserLocation.d.ts +12 -13
  100. package/lib/typescript/module/src/components/user-location/NativeUserLocation.d.ts.map +1 -1
  101. package/lib/typescript/module/src/components/user-location/UserLocation.d.ts +13 -53
  102. package/lib/typescript/module/src/components/user-location/UserLocation.d.ts.map +1 -1
  103. package/lib/typescript/module/src/components/user-location/UserLocationNativeComponent.d.ts +8 -0
  104. package/lib/typescript/module/src/components/user-location/UserLocationNativeComponent.d.ts.map +1 -0
  105. package/lib/typescript/module/src/components/user-location/UserLocationPuck.d.ts +2 -1
  106. package/lib/typescript/module/src/components/user-location/UserLocationPuck.d.ts.map +1 -1
  107. package/lib/typescript/module/src/components/user-location/UserLocationPuckHeading.d.ts.map +1 -1
  108. package/lib/typescript/module/src/hooks/useCurrentPosition.d.ts +18 -0
  109. package/lib/typescript/module/src/hooks/useCurrentPosition.d.ts.map +1 -0
  110. package/lib/typescript/module/src/index.d.ts +4 -4
  111. package/lib/typescript/module/src/index.d.ts.map +1 -1
  112. package/lib/typescript/module/src/modules/location/LocationManager.d.ts +3 -3
  113. package/lib/typescript/module/src/modules/location/LocationManager.d.ts.map +1 -1
  114. package/lib/typescript/module/src/modules/location/NativeLocationModule.d.ts +3 -3
  115. package/lib/typescript/module/src/modules/location/NativeLocationModule.d.ts.map +1 -1
  116. package/lib/typescript/module/src/modules/log/LogManager.d.ts +45 -0
  117. package/lib/typescript/module/src/modules/log/LogManager.d.ts.map +1 -0
  118. package/lib/typescript/module/src/modules/log/NativeLogModule.d.ts +13 -0
  119. package/lib/typescript/module/src/modules/log/NativeLogModule.d.ts.map +1 -0
  120. package/lib/typescript/module/src/utils/animated/Animated.d.ts +1 -13
  121. package/lib/typescript/module/src/utils/animated/Animated.d.ts.map +1 -1
  122. package/package.json +4 -2
  123. package/src/components/annotations/Annotation.tsx +7 -5
  124. package/src/components/map-view/MapView.tsx +3 -3
  125. package/src/components/sources/ShapeSource.tsx +1 -0
  126. package/src/components/user-location/NativeUserLocation.tsx +15 -19
  127. package/src/components/user-location/UserLocation.tsx +65 -249
  128. package/src/components/user-location/UserLocationNativeComponent.ts +19 -0
  129. package/src/components/user-location/UserLocationPuck.tsx +47 -28
  130. package/src/components/user-location/UserLocationPuckHeading.tsx +2 -1
  131. package/src/hooks/useCurrentPosition.ts +53 -0
  132. package/src/index.ts +6 -7
  133. package/src/modules/location/LocationManager.ts +3 -3
  134. package/src/modules/location/NativeLocationModule.ts +3 -3
  135. package/src/modules/log/LogManager.ts +114 -0
  136. package/src/modules/log/NativeLogModule.ts +16 -0
  137. package/src/utils/animated/Animated.ts +1 -28
  138. package/android/src/main/java/org/maplibre/reactnative/components/location/LocationComponentManager.java +0 -165
  139. package/android/src/main/java/org/maplibre/reactnative/components/location/MLRNNativeUserLocation.java +0 -76
  140. package/android/src/main/java/org/maplibre/reactnative/components/location/MLRNNativeUserLocationManager.java +0 -40
  141. package/android/src/main/java/org/maplibre/reactnative/modules/MLRNLogging.java +0 -140
  142. package/ios/components/user-location/MLRNNativeUserLocationManager.h +0 -5
  143. package/ios/components/user-location/MLRNNativeUserLocationManager.m +0 -21
  144. package/lib/commonjs/modules/Logger.js +0 -112
  145. package/lib/commonjs/modules/Logger.js.map +0 -1
  146. package/lib/commonjs/modules/location/requestAndroidLocationPermissions.js +0 -14
  147. package/lib/commonjs/modules/location/requestAndroidLocationPermissions.js.map +0 -1
  148. package/lib/module/modules/Logger.js +0 -107
  149. package/lib/module/modules/Logger.js.map +0 -1
  150. package/lib/module/modules/location/requestAndroidLocationPermissions.js +0 -11
  151. package/lib/module/modules/location/requestAndroidLocationPermissions.js.map +0 -1
  152. package/lib/typescript/commonjs/src/modules/Logger.d.ts +0 -49
  153. package/lib/typescript/commonjs/src/modules/Logger.d.ts.map +0 -1
  154. package/lib/typescript/commonjs/src/modules/location/requestAndroidLocationPermissions.d.ts +0 -5
  155. package/lib/typescript/commonjs/src/modules/location/requestAndroidLocationPermissions.d.ts.map +0 -1
  156. package/lib/typescript/module/src/modules/Logger.d.ts +0 -49
  157. package/lib/typescript/module/src/modules/Logger.d.ts.map +0 -1
  158. package/lib/typescript/module/src/modules/location/requestAndroidLocationPermissions.d.ts +0 -5
  159. package/lib/typescript/module/src/modules/location/requestAndroidLocationPermissions.d.ts.map +0 -1
  160. package/src/modules/Logger.ts +0 -127
  161. package/src/modules/location/requestAndroidLocationPermissions.ts +0 -8
@@ -1,152 +1,42 @@
1
1
  "use strict";
2
2
 
3
- import { forwardRef, memo, useEffect, useImperativeHandle, useRef, useState } from "react";
4
- import { NativeUserLocation } from "./NativeUserLocation.js";
3
+ import { memo, useMemo } from "react";
5
4
  import { UserLocationPuck } from "./UserLocationPuck.js";
6
- import { LocationManager } from "../../modules/location/LocationManager.js";
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 USER_LOCATION_SOURCE_ID = "mlrn-user-location";
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
- visible = true,
18
- showsUserHeadingIndicator = false,
19
- minDisplacement = 0,
20
- renderMode = "normal",
21
- androidRenderMode,
22
- androidPreferredFramesPerSecond,
10
+ accuracy = false,
11
+ heading = false,
12
+ minDisplacement,
23
13
  children,
24
- onUpdate,
25
14
  onPress
26
- }, ref) => {
27
- const _isMounted = useRef(null);
28
- const locationManagerRunning = useRef(false);
29
- const [userLocationState, setUserLocationState] = useState({
30
- shouldShowUserLocation: false
15
+ }) => {
16
+ const currentPosition = useCurrentPosition({
17
+ minDisplacement
31
18
  });
32
- useImperativeHandle(ref, () => ({
33
- /**
34
- * Whether to start or stop listening to the LocationManager
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: USER_LOCATION_SOURCE_ID,
27
+ id: "mlrn-user-location",
28
+ testID: "mlrn-user-location",
141
29
  onPress: onPress,
142
- coordinates: userLocationState.coordinates,
30
+ coordinates: coordinates,
143
31
  style: {
144
- iconRotate: userLocationState.heading
32
+ iconRotate: currentPosition.coords.heading ?? undefined
145
33
  },
146
34
  children: children || /*#__PURE__*/_jsx(UserLocationPuck, {
147
- sourceID: USER_LOCATION_SOURCE_ID,
148
- heading: showsUserHeadingIndicator ? userLocationState.heading : undefined
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":["forwardRef","memo","useEffect","useImperativeHandle","useRef","useState","NativeUserLocation","UserLocationPuck","LocationManager","Annotation","jsx","_jsx","USER_LOCATION_SOURCE_ID","UserLocationRenderMode","UserLocation","animated","visible","showsUserHeadingIndicator","minDisplacement","renderMode","androidRenderMode","androidPreferredFramesPerSecond","children","onUpdate","onPress","ref","_isMounted","locationManagerRunning","userLocationState","setUserLocationState","shouldShowUserLocation","setLocationManager","needsLocationManagerRunning","_onLocationUpdate","current","running","then","Native","setMinDisplacement","addListener","location","getCurrentPosition","removeListener","Normal","coordinates","heading","coords","longitude","latitude","props","iosShowsUserHeadingIndicator","id","style","iconRotate","sourceID","undefined"],"sourceRoot":"../../../../src","sources":["components/user-location/UserLocation.tsx"],"mappings":";;AAAA,SACEA,UAAU,EACVC,IAAI,EAEJC,SAAS,EACTC,mBAAmB,EACnBC,MAAM,EACNC,QAAQ,QACH,OAAO;AAEd,SAASC,kBAAkB,QAAQ,yBAAsB;AACzD,SAASC,gBAAgB,QAAQ,uBAAoB;AACrD,SAEEC,eAAe,QACV,2CAAwC;AAC/C,SAASC,UAAU,QAAQ,8BAA2B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEvD,MAAMC,uBAAuB,GAAG,oBAAoB;AA8DpD,WAAYC,sBAAsB,0BAAtBA,sBAAsB;EAAtBA,sBAAsB;EA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B,GAAGD,iBAAiB;MACpBgB,WAAW;MACXC;IACF,CAAC,CAAC;IAEF,IAAItB,QAAQ,EAAE;MACZA,QAAQ,CAACiB,QAAQ,CAAC;IACpB;EACF;EAEA,IAAI,CAACxB,OAAO,EAAE;IACZ,OAAO,IAAI;EACb;EAEA,IAAIG,UAAU,KAAKN,sBAAsB,CAACwB,MAAM,EAAE;IAChD,MAAMY,KAAK,GAAG;MACZ7B,iBAAiB;MACjB8B,4BAA4B,EAAEjC,yBAAyB;MACvDI;IACF,CAAC;IAED,oBAAOV,IAAA,CAACL,kBAAkB;MAAA,GAAK2C;IAAK,CAAG,CAAC;EAC1C;EAEA,IAAI,CAACrB,iBAAiB,CAACgB,WAAW,EAAE;IAClC,OAAO,IAAI;EACb;EAEA,oBACEjC,IAAA,CAACF,UAAU;IACTM,QAAQ,EAAEA,QAAS;IACnBoC,EAAE,EAAEvC,uBAAwB;IAC5BY,OAAO,EAAEA,OAAQ;IACjBoB,WAAW,EAAEhB,iBAAiB,CAACgB,WAAY;IAC3CQ,KAAK,EAAE;MACLC,UAAU,EAAEzB,iBAAiB,CAACiB;IAChC,CAAE;IAAAvB,QAAA,EAEDA,QAAQ,iBACPX,IAAA,CAACJ,gBAAgB;MACf+C,QAAQ,EAAE1C,uBAAwB;MAClCiC,OAAO,EACL5B,yBAAyB,GACrBW,iBAAiB,CAACiB,OAAO,GACzBU;IACL,CACF;EACF,CACS,CAAC;AAEjB,CACF,CACF,CAAC","ignoreList":[]}
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,QA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+1,19 @@
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
- pulse: {
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
- }) => /*#__PURE__*/_jsxs(_Fragment, {
30
- children: [/*#__PURE__*/_jsx(CircleLayer, {
31
- id: "mlrn-user-location-puck-pulse",
32
- sourceID: sourceID,
33
- style: layerStyles.pulse
34
- }), /*#__PURE__*/_jsx(CircleLayer, {
35
- id: "mlrn-user-location-puck-white",
36
- sourceID: sourceID,
37
- style: layerStyles.white
38
- }), /*#__PURE__*/_jsx(CircleLayer, {
39
- id: "mlrn-user-location-puck-blue",
40
- sourceID: sourceID,
41
- style: layerStyles.blue
42
- }), typeof heading === "number" && /*#__PURE__*/_jsx(UserLocationPuckHeading, {
43
- sourceID: sourceID,
44
- belowLayerID: "mlrn-user-location-puck-white",
45
- heading: heading
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","pulse","circleRadius","circleColor","circleOpacity","circlePitchAlignment","white","UserLocationPuck","sourceID","heading","children","id","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,WAAiE,GAAG;EACxEC,KAAK,EAAE;IACLC,YAAY,EAAE,EAAE;IAChBC,WAAW,EAAEJ,IAAI;IACjBK,aAAa,EAAE,GAAG;IAClBC,oBAAoB,EAAE;EACxB,CAAC;EACDC,KAAK,EAAE;IACLJ,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE,MAAM;IACnBE,oBAAoB,EAAE;EACxB,CAAC;EACDN,IAAI,EAAE;IACJG,YAAY,EAAE,CAAC;IACfC,WAAW,EAAEJ,IAAI;IACjBM,oBAAoB,EAAE;EACxB;AACF,CAAC;AAQD,OAAO,MAAME,gBAAgB,gBAAGjB,IAAI,CAClC,CAAC;EAAEkB,QAAQ;EAAEC;AAA+B,CAAC,kBAC3CX,KAAA,CAAAF,SAAA;EAAAc,QAAA,gBACEhB,IAAA,CAACF,WAAW;IACVmB,EAAE,EAAC,+BAA+B;IAClCH,QAAQ,EAAEA,QAAS;IACnBI,KAAK,EAAEZ,WAAW,CAACC;EAAM,CAC1B,CAAC,eACFP,IAAA,CAACF,WAAW;IACVmB,EAAE,EAAC,+BAA+B;IAClCH,QAAQ,EAAEA,QAAS;IACnBI,KAAK,EAAEZ,WAAW,CAACM;EAAM,CAC1B,CAAC,eACFZ,IAAA,CAACF,WAAW;IACVmB,EAAE,EAAC,8BAA8B;IACjCH,QAAQ,EAAEA,QAAS;IACnBI,KAAK,EAAEZ,WAAW,CAACD;EAAK,CACzB,CAAC,EACD,OAAOU,OAAO,KAAK,QAAQ,iBAC1Bf,IAAA,CAACH,uBAAuB;IACtBiB,QAAQ,EAAEA,QAAS;IACnBK,YAAY,EAAC,+BAA+B;IAC5CJ,OAAO,EAAEA;EAAQ,CAClB,CACF;AAAA,CACD,CAEN,CAAC","ignoreList":[]}
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
- iconRotate: heading,
23
- ...layerStyle
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;EACpCH,QAAQ,EAAEA,QAAS;EACnBC,YAAY,EAAEA,YAAa;EAC3BG,KAAK,EAAE;IACLC,UAAU,EAAEH,OAAO;IACnB,GAAGR;EACL;AAAE,CACH,CAEL,CAAC","ignoreList":[]}
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":[]}
@@ -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, UserLocationRenderMode } from "./components/user-location/UserLocation.js";
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,11 +24,10 @@ 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";
29
30
  export { SnapshotManager } from "./modules/snapshot/SnapshotManager.js";
30
31
  export { Animated } from "./utils/animated/Animated.js";
31
- export { Logger } from "./modules/Logger.js";
32
+ export { LogManager } from "./modules/log/LogManager.js";
32
33
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Camera","MapView","PointAnnotation","Annotation","Callout","UserLocation","UserLocationRenderMode","VectorSource","ShapeSource","RasterSource","ImageSource","Images","FillLayer","FillExtrusionLayer","HeatmapLayer","LineLayer","CircleLayer","SymbolLayer","RasterLayer","BackgroundLayer","MarkerView","LocationManager","requestAndroidLocationPermissions","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;AAC1D,SACEC,YAAY,EACZC,sBAAsB,QACjB,4CAAyC;AAEhD,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;AAC3C,SAASC,iCAAiC,QAAQ,yDAAsD;AAExG,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":[]}
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","LogManager"],"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,UAAU,QAAuB,6BAA0B","ignoreList":[]}
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+
3
+ import NativeLogModule from "./NativeLogModule.js";
4
+
5
+ /**
6
+ * Log levels in decreasing order of severity
7
+ */
8
+
9
+ /**
10
+ * Handler for `onLog` events
11
+ *
12
+ * Called before logging a message, return false to proceed with default logging.
13
+ *
14
+ * @param event
15
+ */
16
+
17
+ class LogManager {
18
+ logLevel = "warn";
19
+ startedCount = 0;
20
+ logHandler = undefined;
21
+ subscription = undefined;
22
+ constructor() {
23
+ this.handleLog = this.handleLog.bind(this);
24
+ }
25
+
26
+ /**
27
+ * Override logging behavior
28
+ *
29
+ * @param logHandler
30
+ */
31
+ onLog(logHandler) {
32
+ this.logHandler = logHandler;
33
+ }
34
+
35
+ /**
36
+ * Set the minimum log level for a message to be logged
37
+ *
38
+ * @param level Minimum log level
39
+ */
40
+ setLogLevel(level) {
41
+ this.logLevel = level;
42
+ NativeLogModule.setLogLevel(level);
43
+ }
44
+ start() {
45
+ if (this.startedCount === 0) {
46
+ this.subscribe();
47
+ }
48
+ this.startedCount += 1;
49
+ }
50
+ stop() {
51
+ this.startedCount -= 1;
52
+ if (this.startedCount === 0) {
53
+ this.unsubscribe();
54
+ }
55
+ }
56
+ subscribe() {
57
+ this.subscription = NativeLogModule.onLog(this.handleLog);
58
+ }
59
+ unsubscribe() {
60
+ if (this.subscription) {
61
+ this.subscription.remove();
62
+ this.subscription = undefined;
63
+ }
64
+ }
65
+ effectiveLevel({
66
+ level,
67
+ message,
68
+ tag
69
+ }) {
70
+ // Reduce level of cancelled HTTP requests from warn to info
71
+ if (level === "warn" && tag === "Mbgl-HttpRequest" && message.startsWith("Request failed due to a permanent error: Canceled")) {
72
+ return "info";
73
+ }
74
+ return level;
75
+ }
76
+ handleLog(log) {
77
+ if (!this.logHandler || !this.logHandler(log)) {
78
+ const {
79
+ message,
80
+ tag
81
+ } = log;
82
+ const level = this.effectiveLevel(log);
83
+ const consoleMessage = `MapLibre Native [${level.toUpperCase()}] [${tag}] ${message}`;
84
+ if (level === "error") {
85
+ console.error(consoleMessage);
86
+ } else if (level === "warn" && this.logLevel !== "error") {
87
+ console.warn(consoleMessage);
88
+ } else if (this.logLevel !== "error" && this.logLevel !== "warn") {
89
+ console.info(consoleMessage);
90
+ }
91
+ }
92
+ }
93
+ }
94
+ const logManager = new LogManager();
95
+ export { logManager as LogManager };
96
+ //# sourceMappingURL=LogManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeLogModule","LogManager","logLevel","startedCount","logHandler","undefined","subscription","constructor","handleLog","bind","onLog","setLogLevel","level","start","subscribe","stop","unsubscribe","remove","effectiveLevel","message","tag","startsWith","log","consoleMessage","toUpperCase","console","error","warn","info","logManager"],"sourceRoot":"../../../../src","sources":["modules/log/LogManager.ts"],"mappings":";;AAEA,OAAOA,eAAe,MAAM,sBAAmB;;AAE/C;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,MAAMC,UAAU,CAAC;EACPC,QAAQ,GAAa,MAAM;EAC3BC,YAAY,GAAW,CAAC;EACxBC,UAAU,GAA2BC,SAAS;EAC9CC,YAAY,GAAkCD,SAAS;EAE/DE,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACC,SAAS,GAAG,IAAI,CAACA,SAAS,CAACC,IAAI,CAAC,IAAI,CAAC;EAC5C;;EAEA;AACF;AACA;AACA;AACA;EACEC,K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;MAC5B,MAAMV,KAAK,GAAG,IAAI,CAACM,cAAc,CAACI,GAAG,CAAC;MAEtC,MAAMC,cAAc,GAAG,oBAAoBX,KAAK,CAACY,WAAW,CAAC,CAAC,MAAMJ,GAAG,KAAKD,OAAO,EAAE;MAErF,IAAIP,KAAK,KAAK,OAAO,EAAE;QACrBa,OAAO,CAACC,KAAK,CAACH,cAAc,CAAC;MAC/B,CAAC,MAAM,IAAIX,KAAK,KAAK,MAAM,IAAI,IAAI,CAACV,QAAQ,KAAK,OAAO,EAAE;QACxDuB,OAAO,CAACE,IAAI,CAACJ,cAAc,CAAC;MAC9B,CAAC,MAAM,IAAI,IAAI,CAACrB,QAAQ,KAAK,OAAO,IAAI,IAAI,CAACA,QAAQ,KAAK,MAAM,EAAE;QAChEuB,OAAO,CAACG,IAAI,CAACL,cAAc,CAAC;MAC9B;IACF;EACF;AACF;AAEA,MAAMM,UAAU,GAAG,IAAI5B,UAAU,CAAC,CAAC;AAEnC,SAAS4B,UAAU,IAAI5B,UAAU","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ import { TurboModuleRegistry } from "react-native";
4
+ export default TurboModuleRegistry.getEnforcing("MLRNLogModule");
5
+ //# sourceMappingURL=NativeLogModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../../src","sources":["modules/log/NativeLogModule.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AAclD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,eAAe,CAAC","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","AnimatedShapeSource"],"sourceRoot":"../../../../src","sources":["utils/animated/Animated.ts"],"mappings":";;AAKA,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,SACEC,WAAW,QAGN,yCAAsC;AAE7C,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;AAWD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMiB,mBAAmB,GAAGnB,UAAU,CAACc,uBAAuB,CACnED,WACF,CAA4B","ignoreList":[]}
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?: object;
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,eAAe;IACvB,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,MAAM,CAAC;IACf,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,2GA2FtB,CAAC"}
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,EAA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AAE,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
- interface NativeUserLocationProps {
1
+ import type { BaseProps } from "../../types/BaseProps";
2
+ interface NativeUserLocationProps extends BaseProps {
2
3
  /**
3
- * Android render mode.
4
+ * Rendering mode
4
5
  *
5
- * - normal: just a circle
6
- * - compass: triangle with heading
7
- * - gps: large arrow
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
- * @platform android
10
+ * @default "default"
10
11
  */
11
- androidRenderMode?: "normal" | "compass" | "gps";
12
+ mode?: "default" | "heading" | "course";
12
13
  /**
13
- * iOS only. A Boolean value indicating whether the user location annotation may display a permanent heading indicator.
14
+ * Limit the maximum frames per second for location updates on Android
14
15
  *
15
- * @platform ios
16
- */
17
- iosShowsUserHeadingIndicator?: boolean;
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":"AAIA,UAAU,uBAAuB;IAC/B;;;;;;;;OAQG;IACH,iBAAiB,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,KAAK,CAAC;IACjD;;;;OAIG;IACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC;;OAEG;IACH,+BAA+B,CAAC,EAAE,MAAM,CAAC;CAC1C;AAED,eAAO,MAAM,kBAAkB,GAAI,OAAO,uBAAuB,4CAEhE,CAAC"}
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"}