@maplibre/maplibre-react-native 11.0.0-alpha.13 → 11.0.0-alpha.15
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/MapLibreReactNative.podspec +1 -1
- package/android/src/main/java/org/maplibre/reactnative/MLRNPackage.kt +5 -5
- package/android/src/main/java/org/maplibre/reactnative/components/camera/MLRNCamera.kt +27 -39
- package/android/src/main/java/org/maplibre/reactnative/events/constants/EventKeys.java +0 -4
- package/android/src/main/java/org/maplibre/reactnative/events/constants/EventTypes.java +0 -1
- package/android/src/main/java/org/maplibre/reactnative/location/LocationManager.kt +165 -0
- package/android/src/main/java/org/maplibre/reactnative/location/TrackUserLocationMode.kt +0 -1
- package/android/src/main/java/org/maplibre/reactnative/location/TrackUserLocationState.kt +15 -0
- package/android/src/main/java/org/maplibre/reactnative/location/UserLocation.kt +40 -0
- package/android/src/main/java/org/maplibre/reactnative/location/engine/DefaultLocationEngineProvider.kt +18 -0
- package/android/src/main/java/org/maplibre/reactnative/location/engine/LocationEngineProvidable.kt +8 -0
- package/android/src/main/java/org/maplibre/reactnative/modules/MLRNLocationModule.kt +153 -0
- package/android/src/main/java/org/maplibre/reactnative/modules/MLRNModule.java +0 -5
- package/android/src/main/location-engine-default/org/maplibre/reactnative/location/engine/LocationEngineProvider.kt +10 -0
- package/android/src/main/location-engine-google/org/maplibre/reactnative/location/engine/GoogleLocationEngineImpl.kt +131 -0
- package/android/src/main/location-engine-google/org/maplibre/reactnative/location/engine/GoogleLocationEngineProvider.kt +28 -0
- package/android/src/main/location-engine-google/org/maplibre/reactnative/location/engine/LocationEngineProvider.kt +10 -0
- package/ios/modules/location/MLRNLocation.h +0 -1
- package/ios/modules/location/MLRNLocation.m +3 -3
- package/ios/modules/location/MLRNLocationManager.h +1 -3
- package/ios/modules/location/MLRNLocationManager.m +1 -4
- package/ios/modules/location/MLRNLocationManagerDelegate.h +0 -2
- package/ios/modules/location/MLRNLocationModule.h +4 -4
- package/ios/modules/location/MLRNLocationModule.mm +56 -0
- package/ios/modules/mlrn/MLRNModule.m +0 -5
- package/ios/utils/MLRNEventTypes.h +0 -2
- package/ios/utils/MLRNEventTypes.m +0 -2
- package/lib/commonjs/components/user-location/UserLocation.js +3 -3
- package/lib/commonjs/components/user-location/UserLocation.js.map +1 -1
- package/lib/commonjs/index.js +2 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/modules/location/LocationManager.js +46 -57
- package/lib/commonjs/modules/location/LocationManager.js.map +1 -1
- package/lib/commonjs/modules/location/NativeLocationModule.js +9 -0
- package/lib/commonjs/modules/location/NativeLocationModule.js.map +1 -0
- package/lib/commonjs/modules/location/requestAndroidLocationPermissions.js +14 -0
- package/lib/commonjs/modules/location/requestAndroidLocationPermissions.js.map +1 -0
- package/lib/module/components/user-location/UserLocation.js +3 -3
- package/lib/module/components/user-location/UserLocation.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/modules/location/LocationManager.js +45 -57
- package/lib/module/modules/location/LocationManager.js.map +1 -1
- package/lib/module/modules/location/NativeLocationModule.js +5 -0
- package/lib/module/modules/location/NativeLocationModule.js.map +1 -0
- package/lib/module/modules/location/requestAndroidLocationPermissions.js +11 -0
- package/lib/module/modules/location/requestAndroidLocationPermissions.js.map +1 -0
- package/lib/typescript/commonjs/src/components/user-location/UserLocation.d.ts +3 -3
- package/lib/typescript/commonjs/src/components/user-location/UserLocation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +2 -2
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/location/LocationManager.d.ts +42 -22
- package/lib/typescript/commonjs/src/modules/location/LocationManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/location/NativeLocationModule.d.ts +24 -0
- package/lib/typescript/commonjs/src/modules/location/NativeLocationModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/location/requestAndroidLocationPermissions.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/location/requestAndroidLocationPermissions.d.ts.map +1 -0
- package/lib/typescript/module/src/components/user-location/UserLocation.d.ts +3 -3
- package/lib/typescript/module/src/components/user-location/UserLocation.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +2 -2
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/location/LocationManager.d.ts +42 -22
- package/lib/typescript/module/src/modules/location/LocationManager.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/location/NativeLocationModule.d.ts +24 -0
- package/lib/typescript/module/src/modules/location/NativeLocationModule.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/location/requestAndroidLocationPermissions.d.ts +5 -0
- package/lib/typescript/module/src/modules/location/requestAndroidLocationPermissions.d.ts.map +1 -0
- package/package.json +5 -3
- package/src/components/user-location/UserLocation.tsx +9 -7
- package/src/index.ts +3 -2
- package/src/modules/location/LocationManager.ts +90 -97
- package/src/modules/location/NativeLocationModule.ts +31 -0
- package/src/modules/location/requestAndroidLocationPermissions.ts +8 -0
- package/android/src/main/java/org/maplibre/reactnative/events/LocationEvent.java +0 -100
- package/android/src/main/java/org/maplibre/reactnative/events/TrackUserLocationChangeEvent.kt +0 -24
- package/android/src/main/java/org/maplibre/reactnative/location/LocationManager.java +0 -160
- package/android/src/main/java/org/maplibre/reactnative/location/TrackUserLocationState.java +0 -15
- package/android/src/main/java/org/maplibre/reactnative/location/UserLocation.java +0 -59
- package/android/src/main/java/org/maplibre/reactnative/location/engine/DefaultLocationEngineProvider.java +0 -18
- package/android/src/main/java/org/maplibre/reactnative/location/engine/LocationEngineProvidable.java +0 -9
- package/android/src/main/java/org/maplibre/reactnative/modules/MLRNLocationModule.java +0 -158
- package/android/src/main/location-engine-default/org/maplibre/reactnative/location/engine/LocationEngineProvider.java +0 -12
- package/android/src/main/location-engine-google/org/maplibre/reactnative/location/engine/GoogleLocationEngineImpl.java +0 -151
- package/android/src/main/location-engine-google/org/maplibre/reactnative/location/engine/GoogleLocationEngineProvider.java +0 -24
- package/android/src/main/location-engine-google/org/maplibre/reactnative/location/engine/LocationEngineProvider.java +0 -12
- package/ios/modules/location/MLRNLocationModule.m +0 -76
- package/lib/commonjs/requestAndroidLocationPermissions.js +0 -25
- package/lib/commonjs/requestAndroidLocationPermissions.js.map +0 -1
- package/lib/module/requestAndroidLocationPermissions.js +0 -21
- package/lib/module/requestAndroidLocationPermissions.js.map +0 -1
- package/lib/typescript/commonjs/src/requestAndroidLocationPermissions.d.ts +0 -2
- package/lib/typescript/commonjs/src/requestAndroidLocationPermissions.d.ts.map +0 -1
- package/lib/typescript/module/src/requestAndroidLocationPermissions.d.ts +0 -2
- package/lib/typescript/module/src/requestAndroidLocationPermissions.d.ts.map +0 -1
- package/src/requestAndroidLocationPermissions.ts +0 -29
|
@@ -58,7 +58,7 @@ export const UserLocation = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(({
|
|
|
58
58
|
if (renderMode === UserLocationRenderMode.Native) {
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
|
-
LocationManager.setMinDisplacement(minDisplacement
|
|
61
|
+
LocationManager.setMinDisplacement(minDisplacement);
|
|
62
62
|
});
|
|
63
63
|
return () => {
|
|
64
64
|
_isMounted.current = false;
|
|
@@ -69,7 +69,7 @@ export const UserLocation = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(({
|
|
|
69
69
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
70
70
|
}, []);
|
|
71
71
|
useEffect(() => {
|
|
72
|
-
LocationManager.setMinDisplacement(minDisplacement
|
|
72
|
+
LocationManager.setMinDisplacement(minDisplacement);
|
|
73
73
|
}, [minDisplacement]);
|
|
74
74
|
useEffect(() => {
|
|
75
75
|
if (!_isMounted.current) {
|
|
@@ -86,7 +86,7 @@ export const UserLocation = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(({
|
|
|
86
86
|
locationManagerRunning.current = running;
|
|
87
87
|
if (running) {
|
|
88
88
|
LocationManager.addListener(_onLocationUpdate);
|
|
89
|
-
const location = await LocationManager.
|
|
89
|
+
const location = await LocationManager.getCurrentPosition();
|
|
90
90
|
_onLocationUpdate(location);
|
|
91
91
|
} else {
|
|
92
92
|
LocationManager.removeListener(_onLocationUpdate);
|
|
@@ -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","
|
|
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,2CAAw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AAC,GAAGR,QAAQ,CAACM,MAAM;MAC/CD,OAAO,GAAGL,QAAQ,CAACM,MAAM,CAACD,OAAO;MACjCD,WAAW,GAAG,CAACG,SAAS,EAAEC,QAAQ,CAAC;IACrC;IAEAnB,oBAAoB,CAAC;MACnB,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":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -6,7 +6,6 @@ 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 { requestAndroidLocationPermissions } from "./requestAndroidLocationPermissions.js";
|
|
10
9
|
export { UserLocation, UserLocationRenderMode } from "./components/user-location/UserLocation.js";
|
|
11
10
|
export { VectorSource } from "./components/sources/VectorSource.js";
|
|
12
11
|
export { ShapeSource } from "./components/sources/ShapeSource.js";
|
|
@@ -23,6 +22,7 @@ export { RasterLayer } from "./components/layers/RasterLayer.js";
|
|
|
23
22
|
export { BackgroundLayer } from "./components/layers/BackgroundLayer.js";
|
|
24
23
|
export { MarkerView } from "./components/annotations/MarkerView.js";
|
|
25
24
|
export { LocationManager } from "./modules/location/LocationManager.js";
|
|
25
|
+
export { requestAndroidLocationPermissions } from "./modules/location/requestAndroidLocationPermissions.js";
|
|
26
26
|
export { OfflineManager } from "./modules/offline/OfflineManager.js";
|
|
27
27
|
export { OfflinePack } from "./modules/offline/OfflinePack.js";
|
|
28
28
|
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","
|
|
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,86 +1,74 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export const LocationModuleEventEmitter = new NativeEventEmitter(MLRNLocationModule);
|
|
7
|
-
|
|
8
|
-
/*
|
|
9
|
-
* Location sent by LocationManager
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/*
|
|
13
|
-
* Coordinates sent by LocationManager
|
|
14
|
-
*/
|
|
15
|
-
|
|
3
|
+
import { PermissionsAndroid } from "react-native";
|
|
4
|
+
import NativeLocationModule from "./NativeLocationModule.js";
|
|
5
|
+
import { isAndroid } from "../../utils/index.js";
|
|
16
6
|
class LocationManager {
|
|
7
|
+
listeners = [];
|
|
8
|
+
currentPosition = undefined;
|
|
9
|
+
isListening = false;
|
|
10
|
+
subscription = undefined;
|
|
17
11
|
constructor() {
|
|
18
|
-
this.
|
|
19
|
-
this._lastKnownLocation = null;
|
|
20
|
-
this._isListening = false;
|
|
21
|
-
this.onUpdate = this.onUpdate.bind(this);
|
|
22
|
-
this.subscription = null;
|
|
12
|
+
this.handleUpdate = this.handleUpdate.bind(this);
|
|
23
13
|
}
|
|
24
|
-
async
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
// let's silently catch it and simply log out
|
|
31
|
-
// instead of throwing an exception
|
|
32
|
-
try {
|
|
33
|
-
lastKnownLocation = await MLRNLocationModule.getLastKnownLocation();
|
|
34
|
-
} catch (error) {
|
|
35
|
-
console.log("LocationManager Error: ", error);
|
|
36
|
-
}
|
|
37
|
-
if (!this._lastKnownLocation && lastKnownLocation) {
|
|
38
|
-
this._lastKnownLocation = lastKnownLocation;
|
|
39
|
-
}
|
|
14
|
+
async getCurrentPosition() {
|
|
15
|
+
let currentPosition;
|
|
16
|
+
try {
|
|
17
|
+
currentPosition = await NativeLocationModule.getCurrentPosition();
|
|
18
|
+
} catch (error) {
|
|
19
|
+
console.log("LocationManager [error]: ", error);
|
|
40
20
|
}
|
|
41
|
-
|
|
21
|
+
this.currentPosition = currentPosition;
|
|
22
|
+
return this.currentPosition;
|
|
42
23
|
}
|
|
43
|
-
addListener(
|
|
44
|
-
if (!this.
|
|
24
|
+
addListener(newListener) {
|
|
25
|
+
if (!this.isListening) {
|
|
45
26
|
this.start();
|
|
46
27
|
}
|
|
47
|
-
if (!this.
|
|
48
|
-
this.
|
|
49
|
-
if (this.
|
|
50
|
-
|
|
28
|
+
if (!this.listeners.includes(newListener)) {
|
|
29
|
+
this.listeners.push(newListener);
|
|
30
|
+
if (this.currentPosition) {
|
|
31
|
+
newListener(this.currentPosition);
|
|
51
32
|
}
|
|
52
33
|
}
|
|
53
34
|
}
|
|
54
|
-
removeListener(
|
|
55
|
-
this.
|
|
56
|
-
if (this.
|
|
35
|
+
removeListener(oldListener) {
|
|
36
|
+
this.listeners = this.listeners.filter(listener => listener !== oldListener);
|
|
37
|
+
if (this.listeners.length === 0) {
|
|
57
38
|
this.stop();
|
|
58
39
|
}
|
|
59
40
|
}
|
|
60
41
|
removeAllListeners() {
|
|
61
|
-
this.
|
|
42
|
+
this.listeners = [];
|
|
62
43
|
this.stop();
|
|
63
44
|
}
|
|
64
|
-
start(
|
|
65
|
-
if (!this.
|
|
66
|
-
|
|
67
|
-
this.subscription =
|
|
68
|
-
this.
|
|
45
|
+
start() {
|
|
46
|
+
if (!this.isListening) {
|
|
47
|
+
NativeLocationModule.start();
|
|
48
|
+
this.subscription = NativeLocationModule.onUpdate(this.handleUpdate);
|
|
49
|
+
this.isListening = true;
|
|
69
50
|
}
|
|
70
51
|
}
|
|
71
52
|
stop() {
|
|
72
|
-
|
|
73
|
-
if (this.
|
|
53
|
+
NativeLocationModule.stop();
|
|
54
|
+
if (this.isListening) {
|
|
74
55
|
this.subscription?.remove();
|
|
75
56
|
}
|
|
76
|
-
this.
|
|
57
|
+
this.isListening = false;
|
|
77
58
|
}
|
|
78
59
|
setMinDisplacement(minDisplacement) {
|
|
79
|
-
|
|
60
|
+
NativeLocationModule.setMinDisplacement(minDisplacement);
|
|
80
61
|
}
|
|
81
|
-
|
|
82
|
-
this.
|
|
83
|
-
this.
|
|
62
|
+
handleUpdate(location) {
|
|
63
|
+
this.currentPosition = location;
|
|
64
|
+
this.listeners.forEach(listener => listener(location));
|
|
65
|
+
}
|
|
66
|
+
async requestAndroidPermissions() {
|
|
67
|
+
if (isAndroid()) {
|
|
68
|
+
const res = await PermissionsAndroid.requestMultiple([PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION]);
|
|
69
|
+
return Object.values(res).every(permission => permission === PermissionsAndroid.RESULTS.GRANTED);
|
|
70
|
+
}
|
|
71
|
+
throw new Error("This method should only be called on Android");
|
|
84
72
|
}
|
|
85
73
|
}
|
|
86
74
|
const locationManager = new LocationManager();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["PermissionsAndroid","NativeLocationModule","isAndroid","LocationManager","listeners","currentPosition","undefined","isListening","subscription","constructor","handleUpdate","bind","getCurrentPosition","error","console","log","addListener","newListener","start","includes","push","removeListener","oldListener","filter","listener","length","stop","removeAllListeners","onUpdate","remove","setMinDisplacement","minDisplacement","location","forEach","requestAndroidPermissions","res","requestMultiple","PERMISSIONS","ACCESS_FINE_LOCATION","ACCESS_COARSE_LOCATION","Object","values","every","permission","RESULTS","GRANTED","Error","locationManager"],"sourceRoot":"../../../../src","sources":["modules/location/LocationManager.ts"],"mappings":";;AAAA,SAGEA,kBAAkB,QACb,cAAc;AAErB,OAAOC,oBAAoB,MAAM,2BAAwB;AACzD,SAASC,SAAS,QAAQ,sBAAa;AA6CvC,MAAMC,eAAe,CAAC;EACZC,SAAS,GAAgD,EAAE;EAC3DC,eAAe,GAAoCC,SAAS;EAC5DC,WAAW,GAAY,KAAK;EAE5BC,YAAY,GAAkCF,SAAS;EAE/DG,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACC,YAAY,GAAG,IAAI,CAACA,YAAY,CAACC,IAAI,CAAC,IAAI,CAAC;EAClD;EAEA,MAAMC,kBAAkBA,CAAA,EAA6C;IACnE,IAAIP,eAAe;IAEnB,IAAI;MACFA,eAAe,GAAG,MAAMJ,oBAAoB,CAACW,kBAAkB,CAAC,CAAC;IACnE,CAAC,CAAC,OAAOC,KAAK,EAAE;MACdC,OAAO,CAACC,GAAG,CAAC,2BAA2B,EAAEF,KAAK,CAAC;IACjD;IAEA,IAAI,CAACR,eAAe,GAAGA,eAAe;IAEtC,OA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;IAChD9B,oBAAoB,CAAC6B,kBAAkB,CAACC,eAAe,CAAC;EAC1D;EAEQrB,YAAYA,CAACsB,QAA6B,EAAQ;IACxD,IAAI,CAAC3B,eAAe,GAAG2B,QAAQ;IAE/B,IAAI,CAAC5B,SAAS,CAAC6B,OAAO,CAAET,QAAQ,IAAKA,QAAQ,CAACQ,QAAQ,CAAC,CAAC;EAC1D;EAEA,MAAME,yBAAyBA,CAAA,EAAqB;IAClD,IAAIhC,SAAS,CAAC,CAAC,EAAE;MACf,MAAMiC,GAAG,GAAG,MAAMnC,kBAAkB,CAACoC,eAAe,CAAC,CACnDpC,kBAAkB,CAACqC,WAAW,CAACC,oBAAoB,EACnDtC,kBAAkB,CAACqC,WAAW,CAACE,sBAAsB,CACtD,CAAC;MAEF,OAAOC,MAAM,CAACC,MAAM,CAACN,GAAG,CAAC,CAACO,KAAK,CAC5BC,UAAU,IAAKA,UAAU,KAAK3C,kBAAkB,CAAC4C,OAAO,CAACC,OAC5D,CAAC;IACH;IAEA,MAAM,IAAIC,KAAK,CAAC,8CAA8C,CAAC;EACjE;AACF;AAEA,MAAMC,eAAe,GAAG,IAAI5C,eAAe,CAAC,CAAC;AAC7C,SAAS4C,eAAe,IAAI5C,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../../src","sources":["modules/location/NativeLocationModule.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AA6BlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,oBAAoB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { LocationManager } from "./LocationManager.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @deprected Use `LocationManager.requestAndroidPermissions` instead
|
|
7
|
+
*/
|
|
8
|
+
export async function requestAndroidLocationPermissions() {
|
|
9
|
+
return LocationManager.requestAndroidPermissions();
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=requestAndroidLocationPermissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LocationManager","requestAndroidLocationPermissions","requestAndroidPermissions"],"sourceRoot":"../../../../src","sources":["modules/location/requestAndroidLocationPermissions.ts"],"mappings":";;AAAA,SAASA,eAAe,QAAQ,sBAAmB;;AAEnD;AACA;AACA;AACA,OAAO,eAAeC,iCAAiCA,CAAA,EAAqB;EAC1E,OAAOD,eAAe,CAACE,yBAAyB,CAAC,CAAC;AACpD","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import { type
|
|
2
|
+
import { type GeolocationPosition } from "../../modules/location/LocationManager";
|
|
3
3
|
interface UserLocationProps {
|
|
4
4
|
/**
|
|
5
5
|
* Whether location icon is animated between updates
|
|
@@ -31,7 +31,7 @@ interface UserLocationProps {
|
|
|
31
31
|
/**
|
|
32
32
|
* Callback that is triggered on location update
|
|
33
33
|
*/
|
|
34
|
-
onUpdate?: (location:
|
|
34
|
+
onUpdate?: (location: GeolocationPosition) => void;
|
|
35
35
|
/**
|
|
36
36
|
* Show or hide small arrow which indicates direction the device is pointing relative to north.
|
|
37
37
|
*/
|
|
@@ -62,7 +62,7 @@ export interface UserLocationRef {
|
|
|
62
62
|
running: boolean;
|
|
63
63
|
}) => Promise<void>;
|
|
64
64
|
needsLocationManagerRunning: () => boolean;
|
|
65
|
-
_onLocationUpdate: (location:
|
|
65
|
+
_onLocationUpdate: (location: GeolocationPosition | undefined) => void;
|
|
66
66
|
}
|
|
67
67
|
export declare const UserLocation: import("react").NamedExoticComponent<UserLocationProps & import("react").RefAttributes<UserLocationRef>>;
|
|
68
68
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserLocation.d.ts","sourceRoot":"","sources":["../../../../../../src/components/user-location/UserLocation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAIf,OAAO,EACL,KAAK,
|
|
1
|
+
{"version":3,"file":"UserLocation.d.ts","sourceRoot":"","sources":["../../../../../../src/components/user-location/UserLocation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAIf,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,wCAAwC,CAAC;AAKhD,UAAU,iBAAiB;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACjC;;;;;;;;OAQG;IACH,iBAAiB,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,KAAK,CAAC;IACjD;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACnD;;OAEG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAQD,oBAAY,sBAAsB;IAChC,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,kBAAkB,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,2BAA2B,EAAE,MAAM,OAAO,CAAC;IAC3C,iBAAiB,EAAE,CAAC,QAAQ,EAAE,mBAAmB,GAAG,SAAS,KAAK,IAAI,CAAC;CACxE;AAED,eAAO,MAAM,YAAY,0GAkLxB,CAAC"}
|
|
@@ -5,7 +5,6 @@ export { PointAnnotation } from "./components/annotations/PointAnnotation";
|
|
|
5
5
|
export type { PointAnnotationRef } from "./components/annotations/PointAnnotation";
|
|
6
6
|
export { Annotation } from "./components/annotations/Annotation";
|
|
7
7
|
export { Callout } from "./components/annotations/Callout";
|
|
8
|
-
export { requestAndroidLocationPermissions } from "./requestAndroidLocationPermissions";
|
|
9
8
|
export { UserLocation, UserLocationRenderMode, } from "./components/user-location/UserLocation";
|
|
10
9
|
export type { UserLocationRef } from "./components/user-location/UserLocation";
|
|
11
10
|
export { VectorSource } from "./components/sources/VectorSource";
|
|
@@ -23,7 +22,8 @@ export { SymbolLayer } from "./components/layers/SymbolLayer";
|
|
|
23
22
|
export { RasterLayer } from "./components/layers/RasterLayer";
|
|
24
23
|
export { BackgroundLayer } from "./components/layers/BackgroundLayer";
|
|
25
24
|
export { MarkerView } from "./components/annotations/MarkerView";
|
|
26
|
-
export { LocationManager, type
|
|
25
|
+
export { LocationManager, type GeolocationPosition, } from "./modules/location/LocationManager";
|
|
26
|
+
export { requestAndroidLocationPermissions } from "./modules/location/requestAndroidLocationPermissions";
|
|
27
27
|
export { OfflineManager } from "./modules/offline/OfflineManager";
|
|
28
28
|
export type { OfflinePackError } from "./modules/offline/OfflineManager";
|
|
29
29
|
export type { OfflinePackStatus } from "./modules/offline/OfflinePack";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAE7B,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,iBAAiB,EACt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AAE,MAAM,oCAAoC,CAAC;AAE/E,YAAY,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EACV,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,UAAU,GACX,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEzD,YAAY,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -1,32 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
timestamp?: number;
|
|
6
|
-
}
|
|
7
|
-
interface Coordinates {
|
|
8
|
-
heading?: number;
|
|
9
|
-
course?: number;
|
|
10
|
-
speed?: number;
|
|
11
|
-
latitude: number;
|
|
1
|
+
interface GeolocationCoordinates {
|
|
2
|
+
/**
|
|
3
|
+
* Longitude in degrees
|
|
4
|
+
*/
|
|
12
5
|
longitude: number;
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Latitude in degrees
|
|
8
|
+
*/
|
|
9
|
+
latitude: number;
|
|
10
|
+
/**
|
|
11
|
+
* Accuracy for longitude/latitude in meters
|
|
12
|
+
*/
|
|
13
|
+
accuracy: number;
|
|
14
|
+
/**
|
|
15
|
+
* Altitude in meters
|
|
16
|
+
*/
|
|
17
|
+
altitude: number;
|
|
18
|
+
/**
|
|
19
|
+
* Accuracy for altitude in meters
|
|
20
|
+
*/
|
|
21
|
+
altitudeAccuracy: number | null;
|
|
22
|
+
/**
|
|
23
|
+
* Direction in which the device is traveling in degrees, relative to north
|
|
24
|
+
*/
|
|
25
|
+
heading: number;
|
|
26
|
+
/**
|
|
27
|
+
* Instantaneous speed of the device in meters per second
|
|
28
|
+
*/
|
|
29
|
+
speed: number;
|
|
30
|
+
}
|
|
31
|
+
export interface GeolocationPosition {
|
|
32
|
+
coords: GeolocationCoordinates;
|
|
33
|
+
timestamp: number;
|
|
15
34
|
}
|
|
16
35
|
declare class LocationManager {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
subscription
|
|
36
|
+
private listeners;
|
|
37
|
+
private currentPosition;
|
|
38
|
+
private isListening;
|
|
39
|
+
private subscription;
|
|
21
40
|
constructor();
|
|
22
|
-
|
|
23
|
-
addListener(
|
|
24
|
-
removeListener(
|
|
41
|
+
getCurrentPosition(): Promise<GeolocationPosition | undefined>;
|
|
42
|
+
addListener(newListener: (location: GeolocationPosition) => void): void;
|
|
43
|
+
removeListener(oldListener: (location: GeolocationPosition) => void): void;
|
|
25
44
|
removeAllListeners(): void;
|
|
26
|
-
start(
|
|
45
|
+
start(): void;
|
|
27
46
|
stop(): void;
|
|
28
47
|
setMinDisplacement(minDisplacement: number): void;
|
|
29
|
-
|
|
48
|
+
private handleUpdate;
|
|
49
|
+
requestAndroidPermissions(): Promise<boolean>;
|
|
30
50
|
}
|
|
31
51
|
declare const locationManager: LocationManager;
|
|
32
52
|
export { locationManager as LocationManager };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationManager.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/location/LocationManager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LocationManager.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/location/LocationManager.ts"],"names":[],"mappings":"AASA,UAAU,sBAAsB;IAC9B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,sBAAsB,CAAC;IAE/B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,cAAM,eAAe;IACnB,OAAO,CAAC,SAAS,CAAmD;IACpE,OAAO,CAAC,eAAe,CAA8C;IACrE,OAAO,CAAC,WAAW,CAAkB;IAErC,OAAO,CAAC,YAAY,CAA4C;;IAM1D,kBAAkB,IAAI,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC;IAcpE,WAAW,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,IAAI,GAAG,IAAI;IAcvE,cAAc,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,IAAI,GAAG,IAAI;IAU1E,kBAAkB,IAAI,IAAI;IAM1B,KAAK,IAAI,IAAI;IAUb,IAAI,IAAI,IAAI;IAUZ,kBAAkB,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI;IAIjD,OAAO,CAAC,YAAY;IAMd,yBAAyB,IAAI,OAAO,CAAC,OAAO,CAAC;CAcpD;AAED,QAAA,MAAM,eAAe,iBAAwB,CAAC;AAC9C,OAAO,EAAE,eAAe,IAAI,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { TurboModule, CodegenTypes } from "react-native";
|
|
2
|
+
type NativeGeolocationCoordinates = {
|
|
3
|
+
longitude: CodegenTypes.Double;
|
|
4
|
+
latitude: CodegenTypes.Double;
|
|
5
|
+
accuracy: CodegenTypes.Double;
|
|
6
|
+
altitude: CodegenTypes.Double;
|
|
7
|
+
altitudeAccuracy: CodegenTypes.Double | null;
|
|
8
|
+
heading: CodegenTypes.Double;
|
|
9
|
+
speed: CodegenTypes.Double;
|
|
10
|
+
};
|
|
11
|
+
type NativeGeolocationPosition = {
|
|
12
|
+
coords: NativeGeolocationCoordinates;
|
|
13
|
+
timestamp: number;
|
|
14
|
+
};
|
|
15
|
+
export interface Spec extends TurboModule {
|
|
16
|
+
start(): void;
|
|
17
|
+
stop(): void;
|
|
18
|
+
getCurrentPosition(): Promise<NativeGeolocationPosition>;
|
|
19
|
+
setMinDisplacement(minDisplacement: number): void;
|
|
20
|
+
readonly onUpdate: CodegenTypes.EventEmitter<NativeGeolocationPosition>;
|
|
21
|
+
}
|
|
22
|
+
declare const _default: Spec;
|
|
23
|
+
export default _default;
|
|
24
|
+
//# sourceMappingURL=NativeLocationModule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeLocationModule.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/location/NativeLocationModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG9D,KAAK,4BAA4B,GAAG;IAClC,SAAS,EAAE,YAAY,CAAC,MAAM,CAAC;IAC/B,QAAQ,EAAE,YAAY,CAAC,MAAM,CAAC;IAC9B,QAAQ,EAAE,YAAY,CAAC,MAAM,CAAC;IAC9B,QAAQ,EAAE,YAAY,CAAC,MAAM,CAAC;IAC9B,gBAAgB,EAAE,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC;IAC7C,OAAO,EAAE,YAAY,CAAC,MAAM,CAAC;IAC7B,KAAK,EAAE,YAAY,CAAC,MAAM,CAAC;CAC5B,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,MAAM,EAAE,4BAA4B,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,KAAK,IAAI,IAAI,CAAC;IAEd,IAAI,IAAI,IAAI,CAAC;IAEb,kBAAkB,IAAI,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAEzD,kBAAkB,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAElD,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC,YAAY,CAAC,yBAAyB,CAAC,CAAC;CACzE;;AAED,wBAA4E"}
|
package/lib/typescript/commonjs/src/modules/location/requestAndroidLocationPermissions.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestAndroidLocationPermissions.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/location/requestAndroidLocationPermissions.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAsB,iCAAiC,IAAI,OAAO,CAAC,OAAO,CAAC,CAE1E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import { type
|
|
2
|
+
import { type GeolocationPosition } from "../../modules/location/LocationManager";
|
|
3
3
|
interface UserLocationProps {
|
|
4
4
|
/**
|
|
5
5
|
* Whether location icon is animated between updates
|
|
@@ -31,7 +31,7 @@ interface UserLocationProps {
|
|
|
31
31
|
/**
|
|
32
32
|
* Callback that is triggered on location update
|
|
33
33
|
*/
|
|
34
|
-
onUpdate?: (location:
|
|
34
|
+
onUpdate?: (location: GeolocationPosition) => void;
|
|
35
35
|
/**
|
|
36
36
|
* Show or hide small arrow which indicates direction the device is pointing relative to north.
|
|
37
37
|
*/
|
|
@@ -62,7 +62,7 @@ export interface UserLocationRef {
|
|
|
62
62
|
running: boolean;
|
|
63
63
|
}) => Promise<void>;
|
|
64
64
|
needsLocationManagerRunning: () => boolean;
|
|
65
|
-
_onLocationUpdate: (location:
|
|
65
|
+
_onLocationUpdate: (location: GeolocationPosition | undefined) => void;
|
|
66
66
|
}
|
|
67
67
|
export declare const UserLocation: import("react").NamedExoticComponent<UserLocationProps & import("react").RefAttributes<UserLocationRef>>;
|
|
68
68
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserLocation.d.ts","sourceRoot":"","sources":["../../../../../../src/components/user-location/UserLocation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAIf,OAAO,EACL,KAAK,
|
|
1
|
+
{"version":3,"file":"UserLocation.d.ts","sourceRoot":"","sources":["../../../../../../src/components/user-location/UserLocation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAIf,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,wCAAwC,CAAC;AAKhD,UAAU,iBAAiB;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACjC;;;;;;;;OAQG;IACH,iBAAiB,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,KAAK,CAAC;IACjD;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACnD;;OAEG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAQD,oBAAY,sBAAsB;IAChC,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,kBAAkB,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,2BAA2B,EAAE,MAAM,OAAO,CAAC;IAC3C,iBAAiB,EAAE,CAAC,QAAQ,EAAE,mBAAmB,GAAG,SAAS,KAAK,IAAI,CAAC;CACxE;AAED,eAAO,MAAM,YAAY,0GAkLxB,CAAC"}
|
|
@@ -5,7 +5,6 @@ export { PointAnnotation } from "./components/annotations/PointAnnotation";
|
|
|
5
5
|
export type { PointAnnotationRef } from "./components/annotations/PointAnnotation";
|
|
6
6
|
export { Annotation } from "./components/annotations/Annotation";
|
|
7
7
|
export { Callout } from "./components/annotations/Callout";
|
|
8
|
-
export { requestAndroidLocationPermissions } from "./requestAndroidLocationPermissions";
|
|
9
8
|
export { UserLocation, UserLocationRenderMode, } from "./components/user-location/UserLocation";
|
|
10
9
|
export type { UserLocationRef } from "./components/user-location/UserLocation";
|
|
11
10
|
export { VectorSource } from "./components/sources/VectorSource";
|
|
@@ -23,7 +22,8 @@ export { SymbolLayer } from "./components/layers/SymbolLayer";
|
|
|
23
22
|
export { RasterLayer } from "./components/layers/RasterLayer";
|
|
24
23
|
export { BackgroundLayer } from "./components/layers/BackgroundLayer";
|
|
25
24
|
export { MarkerView } from "./components/annotations/MarkerView";
|
|
26
|
-
export { LocationManager, type
|
|
25
|
+
export { LocationManager, type GeolocationPosition, } from "./modules/location/LocationManager";
|
|
26
|
+
export { requestAndroidLocationPermissions } from "./modules/location/requestAndroidLocationPermissions";
|
|
27
27
|
export { OfflineManager } from "./modules/offline/OfflineManager";
|
|
28
28
|
export type { OfflinePackError } from "./modules/offline/OfflineManager";
|
|
29
29
|
export type { OfflinePackStatus } from "./modules/offline/OfflinePack";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAE7B,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAC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AE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,YAAY,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE/E,YAAY,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EACV,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,UAAU,GACX,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEzD,YAAY,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -1,32 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
timestamp?: number;
|
|
6
|
-
}
|
|
7
|
-
interface Coordinates {
|
|
8
|
-
heading?: number;
|
|
9
|
-
course?: number;
|
|
10
|
-
speed?: number;
|
|
11
|
-
latitude: number;
|
|
1
|
+
interface GeolocationCoordinates {
|
|
2
|
+
/**
|
|
3
|
+
* Longitude in degrees
|
|
4
|
+
*/
|
|
12
5
|
longitude: number;
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Latitude in degrees
|
|
8
|
+
*/
|
|
9
|
+
latitude: number;
|
|
10
|
+
/**
|
|
11
|
+
* Accuracy for longitude/latitude in meters
|
|
12
|
+
*/
|
|
13
|
+
accuracy: number;
|
|
14
|
+
/**
|
|
15
|
+
* Altitude in meters
|
|
16
|
+
*/
|
|
17
|
+
altitude: number;
|
|
18
|
+
/**
|
|
19
|
+
* Accuracy for altitude in meters
|
|
20
|
+
*/
|
|
21
|
+
altitudeAccuracy: number | null;
|
|
22
|
+
/**
|
|
23
|
+
* Direction in which the device is traveling in degrees, relative to north
|
|
24
|
+
*/
|
|
25
|
+
heading: number;
|
|
26
|
+
/**
|
|
27
|
+
* Instantaneous speed of the device in meters per second
|
|
28
|
+
*/
|
|
29
|
+
speed: number;
|
|
30
|
+
}
|
|
31
|
+
export interface GeolocationPosition {
|
|
32
|
+
coords: GeolocationCoordinates;
|
|
33
|
+
timestamp: number;
|
|
15
34
|
}
|
|
16
35
|
declare class LocationManager {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
subscription
|
|
36
|
+
private listeners;
|
|
37
|
+
private currentPosition;
|
|
38
|
+
private isListening;
|
|
39
|
+
private subscription;
|
|
21
40
|
constructor();
|
|
22
|
-
|
|
23
|
-
addListener(
|
|
24
|
-
removeListener(
|
|
41
|
+
getCurrentPosition(): Promise<GeolocationPosition | undefined>;
|
|
42
|
+
addListener(newListener: (location: GeolocationPosition) => void): void;
|
|
43
|
+
removeListener(oldListener: (location: GeolocationPosition) => void): void;
|
|
25
44
|
removeAllListeners(): void;
|
|
26
|
-
start(
|
|
45
|
+
start(): void;
|
|
27
46
|
stop(): void;
|
|
28
47
|
setMinDisplacement(minDisplacement: number): void;
|
|
29
|
-
|
|
48
|
+
private handleUpdate;
|
|
49
|
+
requestAndroidPermissions(): Promise<boolean>;
|
|
30
50
|
}
|
|
31
51
|
declare const locationManager: LocationManager;
|
|
32
52
|
export { locationManager as LocationManager };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationManager.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/location/LocationManager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LocationManager.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/location/LocationManager.ts"],"names":[],"mappings":"AASA,UAAU,sBAAsB;IAC9B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,sBAAsB,CAAC;IAE/B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,cAAM,eAAe;IACnB,OAAO,CAAC,SAAS,CAAmD;IACpE,OAAO,CAAC,eAAe,CAA8C;IACrE,OAAO,CAAC,WAAW,CAAkB;IAErC,OAAO,CAAC,YAAY,CAA4C;;IAM1D,kBAAkB,IAAI,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC;IAcpE,WAAW,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,IAAI,GAAG,IAAI;IAcvE,cAAc,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,IAAI,GAAG,IAAI;IAU1E,kBAAkB,IAAI,IAAI;IAM1B,KAAK,IAAI,IAAI;IAUb,IAAI,IAAI,IAAI;IAUZ,kBAAkB,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI;IAIjD,OAAO,CAAC,YAAY;IAMd,yBAAyB,IAAI,OAAO,CAAC,OAAO,CAAC;CAcpD;AAED,QAAA,MAAM,eAAe,iBAAwB,CAAC;AAC9C,OAAO,EAAE,eAAe,IAAI,eAAe,EAAE,CAAC"}
|