@maplibre/maplibre-react-native 10.1.0 → 10.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/MLRN/CameraStop.h +1 -1
- package/ios/MLRN/CameraStop.m +58 -60
- package/ios/MLRN/CameraUpdateItem.h +2 -1
- package/ios/MLRN/CameraUpdateItem.m +132 -132
- package/ios/MLRN/CameraUpdateQueue.m +43 -47
- package/ios/MLRN/FilterParser.h +1 -1
- package/ios/MLRN/FilterParser.m +5 -6
- package/ios/MLRN/MLRNBackgroundLayer.m +10 -9
- package/ios/MLRN/MLRNBackgroundLayerManager.m +4 -5
- package/ios/MLRN/MLRNCallout.h +1 -1
- package/ios/MLRN/MLRNCallout.m +37 -36
- package/ios/MLRN/MLRNCalloutManager.m +2 -3
- package/ios/MLRN/MLRNCamera.h +1 -1
- package/ios/MLRN/MLRNCamera.m +169 -182
- package/ios/MLRN/MLRNCameraManager.m +4 -6
- package/ios/MLRN/MLRNCircleLayer.m +17 -14
- package/ios/MLRN/MLRNCircleLayerManager.m +4 -5
- package/ios/MLRN/MLRNCustomHeaders.h +2 -2
- package/ios/MLRN/MLRNCustomHeaders.m +63 -63
- package/ios/MLRN/MLRNEvent.h +3 -3
- package/ios/MLRN/MLRNEvent.m +19 -24
- package/ios/MLRN/MLRNEventProtocol.h +1 -1
- package/ios/MLRN/MLRNFillExtrusionLayer.m +18 -14
- package/ios/MLRN/MLRNFillExtrusionLayerManager.m +4 -5
- package/ios/MLRN/MLRNFillLayer.m +16 -14
- package/ios/MLRN/MLRNFillLayerManager.m +4 -5
- package/ios/MLRN/MLRNHeatmapLayer.m +17 -14
- package/ios/MLRN/MLRNHeatmapLayerManager.m +4 -5
- package/ios/MLRN/MLRNImageQueue.h +4 -1
- package/ios/MLRN/MLRNImageQueue.m +29 -32
- package/ios/MLRN/MLRNImageQueueOperation.h +1 -1
- package/ios/MLRN/MLRNImageQueueOperation.m +92 -91
- package/ios/MLRN/MLRNImageSource.m +36 -38
- package/ios/MLRN/MLRNImageSourceManager.m +2 -3
- package/ios/MLRN/MLRNImageUtils.h +3 -3
- package/ios/MLRN/MLRNImageUtils.m +15 -14
- package/ios/MLRN/MLRNImages.h +0 -1
- package/ios/MLRN/MLRNImages.m +89 -91
- package/ios/MLRN/MLRNImagesManager.m +4 -5
- package/ios/MLRN/MLRNLayer.h +9 -11
- package/ios/MLRN/MLRNLayer.m +170 -182
- package/ios/MLRN/MLRNLight.m +21 -23
- package/ios/MLRN/MLRNLightManager.m +2 -3
- package/ios/MLRN/MLRNLineLayer.m +17 -15
- package/ios/MLRN/MLRNLineLayerManager.m +4 -6
- package/ios/MLRN/MLRNLocation.h +1 -1
- package/ios/MLRN/MLRNLocation.m +16 -17
- package/ios/MLRN/MLRNLocationManager.m +109 -124
- package/ios/MLRN/MLRNLocationManagerDelegate.h +3 -3
- package/ios/MLRN/MLRNLocationModule.h +1 -1
- package/ios/MLRN/MLRNLocationModule.m +40 -55
- package/ios/MLRN/MLRNLogging.h +1 -4
- package/ios/MLRN/MLRNLogging.m +84 -89
- package/ios/MLRN/MLRNMapTouchEvent.h +2 -2
- package/ios/MLRN/MLRNMapTouchEvent.m +50 -49
- package/ios/MLRN/MLRNMapView.h +43 -36
- package/ios/MLRN/MLRNMapView.m +409 -440
- package/ios/MLRN/MLRNMapViewManager.m +489 -502
- package/ios/MLRN/MLRNModule.h +1 -1
- package/ios/MLRN/MLRNModule.m +111 -105
- package/ios/MLRN/MLRNNativeUserLocation.m +24 -27
- package/ios/MLRN/MLRNNativeUserLocationManager.m +4 -8
- package/ios/MLRN/MLRNOfflineModule.h +1 -1
- package/ios/MLRN/MLRNOfflineModule.m +416 -421
- package/ios/MLRN/MLRNPointAnnotation.h +2 -2
- package/ios/MLRN/MLRNPointAnnotation.m +154 -175
- package/ios/MLRN/MLRNPointAnnotationManager.m +2 -3
- package/ios/MLRN/MLRNRasterLayer.m +16 -12
- package/ios/MLRN/MLRNRasterLayerManager.m +4 -5
- package/ios/MLRN/MLRNRasterSource.m +21 -17
- package/ios/MLRN/MLRNRasterSourceManager.m +2 -3
- package/ios/MLRN/MLRNShapeSource.h +17 -16
- package/ios/MLRN/MLRNShapeSource.m +94 -102
- package/ios/MLRN/MLRNShapeSourceManager.h +2 -2
- package/ios/MLRN/MLRNShapeSourceManager.m +86 -90
- package/ios/MLRN/MLRNSnapshotModule.h +1 -1
- package/ios/MLRN/MLRNSnapshotModule.m +51 -53
- package/ios/MLRN/MLRNSource.h +12 -12
- package/ios/MLRN/MLRNSource.m +82 -88
- package/ios/MLRN/MLRNStyleValue.h +1 -1
- package/ios/MLRN/MLRNStyleValue.m +128 -128
- package/ios/MLRN/MLRNSymbolLayer.m +17 -13
- package/ios/MLRN/MLRNSymbolLayerManager.m +4 -5
- package/ios/MLRN/MLRNTileSource.h +1 -1
- package/ios/MLRN/MLRNTileSource.m +21 -20
- package/ios/MLRN/MLRNUserLocation.h +1 -1
- package/ios/MLRN/MLRNUserLocation.m +10 -12
- package/ios/MLRN/MLRNUtils.h +18 -11
- package/ios/MLRN/MLRNUtils.m +168 -160
- package/ios/MLRN/MLRNVectorLayer.m +28 -34
- package/ios/MLRN/MLRNVectorSource.h +3 -1
- package/ios/MLRN/MLRNVectorSource.m +14 -11
- package/ios/MLRN/MLRNVectorSourceManager.h +2 -2
- package/ios/MLRN/MLRNVectorSourceManager.m +36 -39
- package/ios/MLRN/ViewManager.h +1 -1
- package/ios/MLRN/ViewManager.m +29 -35
- package/lib/commonjs/components/MarkerView.js +1 -1
- package/lib/commonjs/components/ShapeSource.js +2 -1
- package/lib/commonjs/components/ShapeSource.js.map +1 -1
- package/lib/commonjs/components/UserLocation.js +8 -38
- package/lib/commonjs/components/UserLocation.js.map +1 -1
- package/lib/commonjs/components/UserLocationPuck.js +52 -0
- package/lib/commonjs/components/UserLocationPuck.js.map +1 -0
- package/lib/commonjs/components/{HeadingIndicator.js → UserLocationPuckHeading.js} +12 -9
- package/lib/commonjs/components/UserLocationPuckHeading.js.map +1 -0
- package/lib/commonjs/utils/animated/AbstractAnimatedCoordinates.js +8 -7
- package/lib/commonjs/utils/animated/AbstractAnimatedCoordinates.js.map +1 -1
- package/lib/commonjs/utils/animated/AnimatedExtractCoordinateFromArray.js +1 -2
- package/lib/commonjs/utils/animated/AnimatedExtractCoordinateFromArray.js.map +1 -1
- package/lib/commonjs/utils/animated/AnimatedRouteCoordinatesArray.js +28 -38
- package/lib/commonjs/utils/animated/AnimatedRouteCoordinatesArray.js.map +1 -1
- package/lib/commonjs/utils/animated/AnimatedShape.js +11 -7
- package/lib/commonjs/utils/animated/AnimatedShape.js.map +1 -1
- package/lib/module/components/MarkerView.js +1 -1
- package/lib/module/components/ShapeSource.js +2 -1
- package/lib/module/components/ShapeSource.js.map +1 -1
- package/lib/module/components/UserLocation.js +7 -36
- package/lib/module/components/UserLocation.js.map +1 -1
- package/lib/module/components/UserLocationPuck.js +48 -0
- package/lib/module/components/UserLocationPuck.js.map +1 -0
- package/lib/module/components/{HeadingIndicator.js → UserLocationPuckHeading.js} +11 -7
- package/lib/module/components/UserLocationPuckHeading.js.map +1 -0
- package/lib/module/utils/animated/AbstractAnimatedCoordinates.js +8 -7
- package/lib/module/utils/animated/AbstractAnimatedCoordinates.js.map +1 -1
- package/lib/module/utils/animated/AnimatedExtractCoordinateFromArray.js +1 -3
- package/lib/module/utils/animated/AnimatedExtractCoordinateFromArray.js.map +1 -1
- package/lib/module/utils/animated/AnimatedRouteCoordinatesArray.js +29 -39
- package/lib/module/utils/animated/AnimatedRouteCoordinatesArray.js.map +1 -1
- package/lib/module/utils/animated/AnimatedShape.js +11 -7
- package/lib/module/utils/animated/AnimatedShape.js.map +1 -1
- package/lib/typescript/commonjs/src/components/MarkerView.d.ts +1 -1
- package/lib/typescript/commonjs/src/components/ShapeSource.d.ts +1 -1
- package/lib/typescript/commonjs/src/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/UserLocation.d.ts +0 -1
- package/lib/typescript/commonjs/src/components/UserLocation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/UserLocationPuck.d.ts +9 -0
- package/lib/typescript/commonjs/src/components/UserLocationPuck.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/UserLocationPuckHeading.d.ts +9 -0
- package/lib/typescript/commonjs/src/components/UserLocationPuckHeading.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts +12 -13
- package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +5 -4
- package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts +0 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts +33 -21
- package/lib/typescript/commonjs/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts +8 -5
- package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts.map +1 -1
- package/lib/typescript/module/src/components/MarkerView.d.ts +1 -1
- package/lib/typescript/module/src/components/ShapeSource.d.ts +1 -1
- package/lib/typescript/module/src/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/module/src/components/UserLocation.d.ts +0 -1
- package/lib/typescript/module/src/components/UserLocation.d.ts.map +1 -1
- package/lib/typescript/module/src/components/UserLocationPuck.d.ts +9 -0
- package/lib/typescript/module/src/components/UserLocationPuck.d.ts.map +1 -0
- package/lib/typescript/module/src/components/UserLocationPuckHeading.d.ts +9 -0
- package/lib/typescript/module/src/components/UserLocationPuckHeading.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts +12 -13
- package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +5 -4
- package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts +0 -1
- package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts +33 -21
- package/lib/typescript/module/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts +8 -5
- package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/components/MarkerView.tsx +1 -1
- package/src/components/ShapeSource.tsx +58 -53
- package/src/components/UserLocation.tsx +13 -51
- package/src/components/UserLocationPuck.tsx +62 -0
- package/src/components/UserLocationPuckHeading.tsx +33 -0
- package/src/utils/animated/AbstractAnimatedCoordinates.ts +26 -15
- package/src/utils/animated/AnimatedExtractCoordinateFromArray.ts +10 -6
- package/src/utils/animated/AnimatedRouteCoordinatesArray.ts +63 -51
- package/src/utils/animated/AnimatedShape.ts +22 -13
- package/lib/commonjs/components/HeadingIndicator.js.map +0 -1
- package/lib/module/components/HeadingIndicator.js.map +0 -1
- package/lib/typescript/commonjs/src/components/HeadingIndicator.d.ts +0 -7
- package/lib/typescript/commonjs/src/components/HeadingIndicator.d.ts.map +0 -1
- package/lib/typescript/module/src/components/HeadingIndicator.d.ts +0 -7
- package/lib/typescript/module/src/components/HeadingIndicator.d.ts.map +0 -1
- package/src/components/HeadingIndicator.tsx +0 -26
package/ios/MLRN/MLRNModule.h
CHANGED
package/ios/MLRN/MLRNModule.m
CHANGED
|
@@ -1,130 +1,136 @@
|
|
|
1
1
|
#import "MLRNModule.h"
|
|
2
|
+
#import "CameraMode.h"
|
|
3
|
+
#import "MLRNCustomHeaders.h"
|
|
2
4
|
#import "MLRNEventTypes.h"
|
|
3
5
|
#import "MLRNOfflineModule.h"
|
|
4
|
-
#import "CameraMode.h"
|
|
5
6
|
#import "MLRNSource.h"
|
|
6
|
-
#import "MLRNCustomHeaders.h"
|
|
7
7
|
@import MapLibre;
|
|
8
8
|
|
|
9
9
|
@implementation MLRNModule
|
|
10
10
|
|
|
11
11
|
RCT_EXPORT_MODULE();
|
|
12
12
|
|
|
13
|
-
+ (BOOL)requiresMainQueueSetup
|
|
14
|
-
|
|
15
|
-
return YES;
|
|
13
|
+
+ (BOOL)requiresMainQueueSetup {
|
|
14
|
+
return YES;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
- (NSDictionary<NSString *, id> *)constantsToExport
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
17
|
+
- (NSDictionary<NSString *, id> *)constantsToExport {
|
|
18
|
+
// style urls
|
|
19
|
+
NSMutableDictionary *styleURLS = [[NSMutableDictionary alloc] init];
|
|
20
|
+
[styleURLS setObject:[[MLNStyle defaultStyleURL] absoluteString] forKey:@"Default"];
|
|
21
|
+
|
|
22
|
+
// event types
|
|
23
|
+
NSMutableDictionary *eventTypes = [[NSMutableDictionary alloc] init];
|
|
24
|
+
[eventTypes setObject:RCT_MAPBOX_EVENT_TAP forKey:@"MapClick"];
|
|
25
|
+
[eventTypes setObject:RCT_MAPBOX_EVENT_LONGPRESS forKey:@"MapLongClick"];
|
|
26
|
+
[eventTypes setObject:RCT_MAPBOX_REGION_WILL_CHANGE_EVENT forKey:@"RegionWillChange"];
|
|
27
|
+
[eventTypes setObject:RCT_MAPBOX_REGION_IS_CHANGING forKey:@"RegionIsChanging"];
|
|
28
|
+
[eventTypes setObject:RCT_MAPBOX_REGION_DID_CHANGE forKey:@"RegionDidChange"];
|
|
29
|
+
[eventTypes setObject:RCT_MAPBOX_WILL_START_LOADING_MAP forKey:@"WillStartLoadingMap"];
|
|
30
|
+
[eventTypes setObject:RCT_MAPBOX_DID_FINISH_LOADING_MAP forKey:@"DidFinishLoadingMap"];
|
|
31
|
+
[eventTypes setObject:RCT_MAPBOX_DID_FAIL_LOADING_MAP forKey:@"DidFailLoadingMap"];
|
|
32
|
+
[eventTypes setObject:RCT_MAPBOX_WILL_START_RENDERING_FRAME forKey:@"WillStartRenderingFrame"];
|
|
33
|
+
[eventTypes setObject:RCT_MAPBOX_DID_FINSIH_RENDERING_FRAME forKey:@"DidFinishRenderingFrame"];
|
|
34
|
+
[eventTypes setObject:RCT_MAPBOX_DID_FINISH_RENDERING_FRAME_FULLY
|
|
35
|
+
forKey:@"DidFinishRenderingFrameFully"];
|
|
36
|
+
[eventTypes setObject:RCT_MAPBOX_WILL_START_RENDERING_MAP forKey:@"WillStartRenderingMap"];
|
|
37
|
+
[eventTypes setObject:RCT_MAPBOX_DID_FINISH_RENDERING_MAP forKey:@"DidFinishRenderingMap"];
|
|
38
|
+
[eventTypes setObject:RCT_MAPBOX_DID_FINISH_RENDERING_MAP_FULLY
|
|
39
|
+
forKey:@"DidFinishRenderingMapFully"];
|
|
40
|
+
[eventTypes setObject:RCT_MAPBOX_DID_FINISH_LOADING_STYLE forKey:@"DidFinishLoadingStyle"];
|
|
41
|
+
|
|
42
|
+
// location module events
|
|
43
|
+
NSMutableDictionary *locationModuleEvents = [[NSMutableDictionary alloc] init];
|
|
44
|
+
[locationModuleEvents setObject:RCT_MAPBOX_USER_LOCATION_UPDATE forKey:@"Update"];
|
|
45
|
+
|
|
46
|
+
// user tracking modes
|
|
47
|
+
NSMutableDictionary *userTrackingModes = [[NSMutableDictionary alloc] init];
|
|
48
|
+
[userTrackingModes setObject:[NSNumber numberWithInt:MLNUserTrackingModeNone] forKey:@"None"];
|
|
49
|
+
[userTrackingModes setObject:[NSNumber numberWithInt:MLNUserTrackingModeFollow] forKey:@"Follow"];
|
|
50
|
+
[userTrackingModes setObject:[NSNumber numberWithInt:MLNUserTrackingModeFollowWithHeading]
|
|
51
|
+
forKey:@"FollowWithHeading"];
|
|
52
|
+
[userTrackingModes setObject:[NSNumber numberWithInt:MLNUserTrackingModeFollowWithCourse]
|
|
53
|
+
forKey:@"FollowWithCourse"];
|
|
54
|
+
|
|
55
|
+
// user location vertical alignment
|
|
56
|
+
NSMutableDictionary *userLocationVerticalAlignment = [[NSMutableDictionary alloc] init];
|
|
57
|
+
[userLocationVerticalAlignment
|
|
58
|
+
setObject:[NSNumber numberWithInt:MLNAnnotationVerticalAlignmentTop]
|
|
59
|
+
forKey:@"Top"];
|
|
60
|
+
[userLocationVerticalAlignment
|
|
61
|
+
setObject:[NSNumber numberWithInt:MLNAnnotationVerticalAlignmentCenter]
|
|
62
|
+
forKey:@"Center"];
|
|
63
|
+
[userLocationVerticalAlignment
|
|
64
|
+
setObject:[NSNumber numberWithInt:MLNAnnotationVerticalAlignmentBottom]
|
|
65
|
+
forKey:@"Bottom"];
|
|
66
|
+
|
|
67
|
+
// camera modes
|
|
68
|
+
NSMutableDictionary *cameraModes = [[NSMutableDictionary alloc] init];
|
|
69
|
+
[cameraModes setObject:[NSNumber numberWithInt:RCT_MAPBOX_CAMERA_MODE_FLIGHT] forKey:@"Flight"];
|
|
70
|
+
[cameraModes setObject:[NSNumber numberWithInt:RCT_MAPBOX_CAMERA_MODE_EASE] forKey:@"Ease"];
|
|
71
|
+
[cameraModes setObject:[NSNumber numberWithInt:RCT_MAPBOX_CAMERA_MODE_LINEAR] forKey:@"Linear"];
|
|
72
|
+
[cameraModes setObject:[NSNumber numberWithInt:RCT_MAPBOX_CAMERA_MODE_NONE] forKey:@"None"];
|
|
73
|
+
|
|
74
|
+
// style sources
|
|
75
|
+
NSMutableDictionary *styleSourceConsts = [[NSMutableDictionary alloc] init];
|
|
76
|
+
[styleSourceConsts setObject:DEFAULT_SOURCE_ID forKey:@"DefaultSourceID"];
|
|
77
|
+
|
|
78
|
+
// offline module callback names
|
|
79
|
+
NSMutableDictionary *offlineModuleCallbackNames = [[NSMutableDictionary alloc] init];
|
|
80
|
+
[offlineModuleCallbackNames setObject:RCT_MAPBOX_OFFLINE_CALLBACK_ERROR forKey:@"Error"];
|
|
81
|
+
[offlineModuleCallbackNames setObject:RCT_MAPBOX_OFFLINE_CALLBACK_PROGRESS forKey:@"Progress"];
|
|
82
|
+
|
|
83
|
+
NSMutableDictionary *offlinePackDownloadState = [[NSMutableDictionary alloc] init];
|
|
84
|
+
[offlinePackDownloadState setObject:@(MLNOfflinePackStateInactive) forKey:@"Inactive"];
|
|
85
|
+
[offlinePackDownloadState setObject:@(MLNOfflinePackStateActive) forKey:@"Active"];
|
|
86
|
+
[offlinePackDownloadState setObject:@(MLNOfflinePackStateComplete) forKey:@"Complete"];
|
|
87
|
+
|
|
88
|
+
return @{
|
|
89
|
+
@"StyleURL" : styleURLS,
|
|
90
|
+
@"EventTypes" : eventTypes,
|
|
91
|
+
@"UserTrackingModes" : userTrackingModes,
|
|
92
|
+
@"UserLocationVerticalAlignment" : userLocationVerticalAlignment,
|
|
93
|
+
@"CameraModes" : cameraModes,
|
|
94
|
+
@"StyleSource" : styleSourceConsts,
|
|
95
|
+
@"OfflineCallbackName" : offlineModuleCallbackNames,
|
|
96
|
+
@"OfflinePackDownloadState" : offlinePackDownloadState,
|
|
97
|
+
@"LocationCallbackName" : locationModuleEvents
|
|
98
|
+
};
|
|
91
99
|
}
|
|
92
100
|
|
|
93
101
|
/**
|
|
94
|
-
* @deprecated This will be removed in the next major version.
|
|
95
|
-
* @see https://github.com/maplibre/maplibre-react-native/issues/25#issuecomment-1382382044
|
|
96
|
-
*/
|
|
97
|
-
RCT_EXPORT_METHOD(setAccessToken:(NSString *)accessToken)
|
|
98
|
-
{
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
+
* @deprecated This will be removed in the next major version.
|
|
103
|
+
* @see https://github.com/maplibre/maplibre-react-native/issues/25#issuecomment-1382382044
|
|
104
|
+
*/
|
|
105
|
+
RCT_EXPORT_METHOD(setAccessToken : (NSString *)accessToken) {
|
|
106
|
+
if (accessToken.length > 0) {
|
|
107
|
+
[MLNSettings setApiKey:accessToken];
|
|
108
|
+
}
|
|
102
109
|
}
|
|
103
110
|
|
|
104
|
-
RCT_EXPORT_METHOD(addCustomHeader:(NSString *)headerName forHeaderValue:(NSString *)
|
|
105
|
-
{
|
|
106
|
-
|
|
111
|
+
RCT_EXPORT_METHOD(addCustomHeader : (NSString *)headerName forHeaderValue : (NSString *)
|
|
112
|
+
headerValue) {
|
|
113
|
+
[MLRNCustomHeaders.sharedInstance addHeader:headerValue forHeaderName:headerName];
|
|
107
114
|
}
|
|
108
115
|
|
|
109
|
-
RCT_EXPORT_METHOD(removeCustomHeader:(NSString *)headerName)
|
|
110
|
-
|
|
111
|
-
[MLRNCustomHeaders.sharedInstance removeHeader:headerName];
|
|
116
|
+
RCT_EXPORT_METHOD(removeCustomHeader : (NSString *)headerName) {
|
|
117
|
+
[MLRNCustomHeaders.sharedInstance removeHeader:headerName];
|
|
112
118
|
}
|
|
113
119
|
|
|
114
120
|
/**
|
|
115
|
-
* @deprecated This will be removed in the next major version.
|
|
116
|
-
* @see https://github.com/maplibre/maplibre-react-native/issues/25#issuecomment-1382382044
|
|
117
|
-
*/
|
|
118
|
-
RCT_EXPORT_METHOD(getAccessToken:(RCTPromiseResolveBlock)
|
|
119
|
-
{
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
121
|
+
* @deprecated This will be removed in the next major version.
|
|
122
|
+
* @see https://github.com/maplibre/maplibre-react-native/issues/25#issuecomment-1382382044
|
|
123
|
+
*/
|
|
124
|
+
RCT_EXPORT_METHOD(getAccessToken : (RCTPromiseResolveBlock)
|
|
125
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
126
|
+
NSString *accessToken = MLNSettings.apiKey;
|
|
127
|
+
|
|
128
|
+
if (accessToken != nil) {
|
|
129
|
+
resolve(accessToken);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
reject(@"missing_access_token", @"No access token has been set", nil);
|
|
128
134
|
}
|
|
129
135
|
|
|
130
136
|
@end
|
|
@@ -1,41 +1,38 @@
|
|
|
1
1
|
#import "MLRNNativeUserLocation.h"
|
|
2
|
+
#import "CameraMode.h"
|
|
2
3
|
#import "CameraStop.h"
|
|
3
4
|
#import "CameraUpdateQueue.h"
|
|
4
|
-
#import "MLRNLocation.h"
|
|
5
|
-
#import "MLRNUtils.h"
|
|
6
|
-
#import "MLRNLocationManager.h"
|
|
7
5
|
#import "MLRNEvent.h"
|
|
8
6
|
#import "MLRNEventTypes.h"
|
|
9
|
-
#import "
|
|
7
|
+
#import "MLRNLocation.h"
|
|
8
|
+
#import "MLRNLocationManager.h"
|
|
9
|
+
#import "MLRNUtils.h"
|
|
10
10
|
|
|
11
|
-
@implementation MLRNNativeUserLocation
|
|
12
|
-
{
|
|
13
|
-
|
|
11
|
+
@implementation MLRNNativeUserLocation {
|
|
14
12
|
}
|
|
15
13
|
|
|
16
|
-
- (void)setMap:(MLRNMapView *)map
|
|
17
|
-
{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
_map = map;
|
|
14
|
+
- (void)setMap:(MLRNMapView *)map {
|
|
15
|
+
if (map == nil && _map) {
|
|
16
|
+
_map.useNativeUserLocationAnnotationView = NO;
|
|
17
|
+
_map.showsUserLocation = NO;
|
|
18
|
+
_map.showsUserHeadingIndicator = NO;
|
|
19
|
+
} else if (map) {
|
|
20
|
+
map.useNativeUserLocationAnnotationView = YES;
|
|
21
|
+
// Toggle off/on showsUserLocation in order for Mapbox to invalidate the
|
|
22
|
+
// current (hidden) user location annotation view. See also: HiddenUserLocationAnnotationView
|
|
23
|
+
map.showsUserLocation = NO;
|
|
24
|
+
map.showsUserLocation = YES;
|
|
25
|
+
map.showsUserHeadingIndicator = self.iosShowsUserHeadingIndicator;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
_map = map;
|
|
32
29
|
}
|
|
33
30
|
|
|
34
31
|
- (void)setIosShowsUserHeadingIndicator:(BOOL)iosShowsUserHeadingIndicator {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
_iosShowsUserHeadingIndicator = iosShowsUserHeadingIndicator;
|
|
33
|
+
if (_map) {
|
|
34
|
+
_map.showsUserHeadingIndicator = iosShowsUserHeadingIndicator;
|
|
35
|
+
}
|
|
39
36
|
}
|
|
40
37
|
|
|
41
38
|
@end
|
|
@@ -6,20 +6,16 @@
|
|
|
6
6
|
RCT_EXPORT_MODULE(MLRNNativeUserLocation)
|
|
7
7
|
RCT_EXPORT_VIEW_PROPERTY(iosShowsUserHeadingIndicator, BOOL)
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
#pragma - View Properties
|
|
11
10
|
|
|
12
|
-
|
|
13
11
|
#pragma Methods
|
|
14
12
|
|
|
15
|
-
- (BOOL)requiresMainQueueSetup
|
|
16
|
-
|
|
17
|
-
return YES;
|
|
13
|
+
- (BOOL)requiresMainQueueSetup {
|
|
14
|
+
return YES;
|
|
18
15
|
}
|
|
19
16
|
|
|
20
|
-
- (UIView *)view
|
|
21
|
-
|
|
22
|
-
return [[MLRNNativeUserLocation alloc] init];
|
|
17
|
+
- (UIView *)view {
|
|
18
|
+
return [[MLRNNativeUserLocation alloc] init];
|
|
23
19
|
}
|
|
24
20
|
|
|
25
21
|
@end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
@import MapLibre;
|
|
5
5
|
|
|
6
|
-
@interface MLRNOfflineModule : RCTEventEmitter<RCTBridgeModule>
|
|
6
|
+
@interface MLRNOfflineModule : RCTEventEmitter <RCTBridgeModule>
|
|
7
7
|
|
|
8
8
|
extern NSString *const RCT_MAPBOX_OFFLINE_CALLBACK_PROGRESS;
|
|
9
9
|
extern NSString *const RCT_MAPBOX_OFFLINE_CALLBACK_ERROR;
|