@maplibre/maplibre-react-native 10.1.0 → 10.1.1

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 (152) hide show
  1. package/ios/MLRN/CameraStop.h +1 -1
  2. package/ios/MLRN/CameraStop.m +58 -60
  3. package/ios/MLRN/CameraUpdateItem.h +2 -1
  4. package/ios/MLRN/CameraUpdateItem.m +132 -132
  5. package/ios/MLRN/CameraUpdateQueue.m +43 -47
  6. package/ios/MLRN/FilterParser.h +1 -1
  7. package/ios/MLRN/FilterParser.m +5 -6
  8. package/ios/MLRN/MLRNBackgroundLayer.m +10 -9
  9. package/ios/MLRN/MLRNBackgroundLayerManager.m +4 -5
  10. package/ios/MLRN/MLRNCallout.h +1 -1
  11. package/ios/MLRN/MLRNCallout.m +37 -36
  12. package/ios/MLRN/MLRNCalloutManager.m +2 -3
  13. package/ios/MLRN/MLRNCamera.h +1 -1
  14. package/ios/MLRN/MLRNCamera.m +169 -182
  15. package/ios/MLRN/MLRNCameraManager.m +4 -6
  16. package/ios/MLRN/MLRNCircleLayer.m +17 -14
  17. package/ios/MLRN/MLRNCircleLayerManager.m +4 -5
  18. package/ios/MLRN/MLRNCustomHeaders.h +2 -2
  19. package/ios/MLRN/MLRNCustomHeaders.m +63 -63
  20. package/ios/MLRN/MLRNEvent.h +3 -3
  21. package/ios/MLRN/MLRNEvent.m +19 -24
  22. package/ios/MLRN/MLRNEventProtocol.h +1 -1
  23. package/ios/MLRN/MLRNFillExtrusionLayer.m +18 -14
  24. package/ios/MLRN/MLRNFillExtrusionLayerManager.m +4 -5
  25. package/ios/MLRN/MLRNFillLayer.m +16 -14
  26. package/ios/MLRN/MLRNFillLayerManager.m +4 -5
  27. package/ios/MLRN/MLRNHeatmapLayer.m +17 -14
  28. package/ios/MLRN/MLRNHeatmapLayerManager.m +4 -5
  29. package/ios/MLRN/MLRNImageQueue.h +4 -1
  30. package/ios/MLRN/MLRNImageQueue.m +29 -32
  31. package/ios/MLRN/MLRNImageQueueOperation.h +1 -1
  32. package/ios/MLRN/MLRNImageQueueOperation.m +92 -91
  33. package/ios/MLRN/MLRNImageSource.m +36 -38
  34. package/ios/MLRN/MLRNImageSourceManager.m +2 -3
  35. package/ios/MLRN/MLRNImageUtils.h +3 -3
  36. package/ios/MLRN/MLRNImageUtils.m +15 -14
  37. package/ios/MLRN/MLRNImages.h +0 -1
  38. package/ios/MLRN/MLRNImages.m +89 -91
  39. package/ios/MLRN/MLRNImagesManager.m +4 -5
  40. package/ios/MLRN/MLRNLayer.h +9 -11
  41. package/ios/MLRN/MLRNLayer.m +170 -182
  42. package/ios/MLRN/MLRNLight.m +21 -23
  43. package/ios/MLRN/MLRNLightManager.m +2 -3
  44. package/ios/MLRN/MLRNLineLayer.m +17 -15
  45. package/ios/MLRN/MLRNLineLayerManager.m +4 -6
  46. package/ios/MLRN/MLRNLocation.h +1 -1
  47. package/ios/MLRN/MLRNLocation.m +16 -17
  48. package/ios/MLRN/MLRNLocationManager.m +109 -124
  49. package/ios/MLRN/MLRNLocationManagerDelegate.h +3 -3
  50. package/ios/MLRN/MLRNLocationModule.h +1 -1
  51. package/ios/MLRN/MLRNLocationModule.m +40 -55
  52. package/ios/MLRN/MLRNLogging.h +1 -4
  53. package/ios/MLRN/MLRNLogging.m +84 -89
  54. package/ios/MLRN/MLRNMapTouchEvent.h +2 -2
  55. package/ios/MLRN/MLRNMapTouchEvent.m +50 -49
  56. package/ios/MLRN/MLRNMapView.h +43 -36
  57. package/ios/MLRN/MLRNMapView.m +409 -440
  58. package/ios/MLRN/MLRNMapViewManager.m +489 -502
  59. package/ios/MLRN/MLRNModule.h +1 -1
  60. package/ios/MLRN/MLRNModule.m +111 -105
  61. package/ios/MLRN/MLRNNativeUserLocation.m +24 -27
  62. package/ios/MLRN/MLRNNativeUserLocationManager.m +4 -8
  63. package/ios/MLRN/MLRNOfflineModule.h +1 -1
  64. package/ios/MLRN/MLRNOfflineModule.m +416 -421
  65. package/ios/MLRN/MLRNPointAnnotation.h +2 -2
  66. package/ios/MLRN/MLRNPointAnnotation.m +154 -175
  67. package/ios/MLRN/MLRNPointAnnotationManager.m +2 -3
  68. package/ios/MLRN/MLRNRasterLayer.m +16 -12
  69. package/ios/MLRN/MLRNRasterLayerManager.m +4 -5
  70. package/ios/MLRN/MLRNRasterSource.m +21 -17
  71. package/ios/MLRN/MLRNRasterSourceManager.m +2 -3
  72. package/ios/MLRN/MLRNShapeSource.h +17 -16
  73. package/ios/MLRN/MLRNShapeSource.m +94 -102
  74. package/ios/MLRN/MLRNShapeSourceManager.h +2 -2
  75. package/ios/MLRN/MLRNShapeSourceManager.m +86 -90
  76. package/ios/MLRN/MLRNSnapshotModule.h +1 -1
  77. package/ios/MLRN/MLRNSnapshotModule.m +51 -53
  78. package/ios/MLRN/MLRNSource.h +12 -12
  79. package/ios/MLRN/MLRNSource.m +82 -88
  80. package/ios/MLRN/MLRNStyleValue.h +1 -1
  81. package/ios/MLRN/MLRNStyleValue.m +128 -128
  82. package/ios/MLRN/MLRNSymbolLayer.m +17 -13
  83. package/ios/MLRN/MLRNSymbolLayerManager.m +4 -5
  84. package/ios/MLRN/MLRNTileSource.h +1 -1
  85. package/ios/MLRN/MLRNTileSource.m +21 -20
  86. package/ios/MLRN/MLRNUserLocation.h +1 -1
  87. package/ios/MLRN/MLRNUserLocation.m +10 -12
  88. package/ios/MLRN/MLRNUtils.h +18 -11
  89. package/ios/MLRN/MLRNUtils.m +168 -160
  90. package/ios/MLRN/MLRNVectorLayer.m +28 -34
  91. package/ios/MLRN/MLRNVectorSource.h +3 -1
  92. package/ios/MLRN/MLRNVectorSource.m +14 -11
  93. package/ios/MLRN/MLRNVectorSourceManager.h +2 -2
  94. package/ios/MLRN/MLRNVectorSourceManager.m +36 -39
  95. package/ios/MLRN/ViewManager.h +1 -1
  96. package/ios/MLRN/ViewManager.m +29 -35
  97. package/lib/commonjs/components/MarkerView.js +1 -1
  98. package/lib/commonjs/components/UserLocation.js +8 -38
  99. package/lib/commonjs/components/UserLocation.js.map +1 -1
  100. package/lib/commonjs/components/UserLocationPuck.js +52 -0
  101. package/lib/commonjs/components/UserLocationPuck.js.map +1 -0
  102. package/lib/commonjs/components/{HeadingIndicator.js → UserLocationPuckHeading.js} +12 -9
  103. package/lib/commonjs/components/UserLocationPuckHeading.js.map +1 -0
  104. package/lib/module/components/MarkerView.js +1 -1
  105. package/lib/module/components/UserLocation.js +7 -36
  106. package/lib/module/components/UserLocation.js.map +1 -1
  107. package/lib/module/components/UserLocationPuck.js +48 -0
  108. package/lib/module/components/UserLocationPuck.js.map +1 -0
  109. package/lib/module/components/{HeadingIndicator.js → UserLocationPuckHeading.js} +11 -7
  110. package/lib/module/components/UserLocationPuckHeading.js.map +1 -0
  111. package/lib/typescript/commonjs/src/components/MarkerView.d.ts +1 -1
  112. package/lib/typescript/commonjs/src/components/UserLocation.d.ts +0 -1
  113. package/lib/typescript/commonjs/src/components/UserLocation.d.ts.map +1 -1
  114. package/lib/typescript/commonjs/src/components/UserLocationPuck.d.ts +9 -0
  115. package/lib/typescript/commonjs/src/components/UserLocationPuck.d.ts.map +1 -0
  116. package/lib/typescript/commonjs/src/components/UserLocationPuckHeading.d.ts +9 -0
  117. package/lib/typescript/commonjs/src/components/UserLocationPuckHeading.d.ts.map +1 -0
  118. package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts +0 -1
  119. package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
  120. package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +0 -1
  121. package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
  122. package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts +0 -1
  123. package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
  124. package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts +0 -1
  125. package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts.map +1 -1
  126. package/lib/typescript/module/src/components/MarkerView.d.ts +1 -1
  127. package/lib/typescript/module/src/components/UserLocation.d.ts +0 -1
  128. package/lib/typescript/module/src/components/UserLocation.d.ts.map +1 -1
  129. package/lib/typescript/module/src/components/UserLocationPuck.d.ts +9 -0
  130. package/lib/typescript/module/src/components/UserLocationPuck.d.ts.map +1 -0
  131. package/lib/typescript/module/src/components/UserLocationPuckHeading.d.ts +9 -0
  132. package/lib/typescript/module/src/components/UserLocationPuckHeading.d.ts.map +1 -0
  133. package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts +0 -1
  134. package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
  135. package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +0 -1
  136. package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
  137. package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts +0 -1
  138. package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
  139. package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts +0 -1
  140. package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts.map +1 -1
  141. package/package.json +8 -8
  142. package/src/components/MarkerView.tsx +1 -1
  143. package/src/components/UserLocation.tsx +13 -51
  144. package/src/components/UserLocationPuck.tsx +62 -0
  145. package/src/components/UserLocationPuckHeading.tsx +33 -0
  146. package/lib/commonjs/components/HeadingIndicator.js.map +0 -1
  147. package/lib/module/components/HeadingIndicator.js.map +0 -1
  148. package/lib/typescript/commonjs/src/components/HeadingIndicator.d.ts +0 -7
  149. package/lib/typescript/commonjs/src/components/HeadingIndicator.d.ts.map +0 -1
  150. package/lib/typescript/module/src/components/HeadingIndicator.d.ts +0 -7
  151. package/lib/typescript/module/src/components/HeadingIndicator.d.ts.map +0 -1
  152. package/src/components/HeadingIndicator.tsx +0 -26
@@ -5,94 +5,94 @@
5
5
 
6
6
  #import <objc/runtime.h>
7
7
 
8
- #import "MLRNCustomHeaders.h"
9
- #import <MapLibre/MapLibre.h>
10
8
  #import <MapLibre/MLNNetworkConfiguration.h>
9
+ #import <MapLibre/MapLibre.h>
10
+ #import "MLRNCustomHeaders.h"
11
11
 
12
12
  @implementation NSMutableURLRequest (CustomHeaders)
13
13
 
14
- +(NSMutableURLRequest*) __swizzle_requestWithURL:(NSURL*)url {
15
- if([url.scheme isEqualToString:@"ws"]) {
16
- return [NSMutableURLRequest __swizzle_requestWithURL:url];
17
- }
18
-
19
- NSArray<NSString*>* stack = [NSThread callStackSymbols];
20
- if ([stack count] < 2) {
21
- return [NSMutableURLRequest __swizzle_requestWithURL:url];
22
- }
23
-
24
- if ([stack[1] containsString:@"MapLibre"] == NO) {
25
- return [NSMutableURLRequest __swizzle_requestWithURL:url];
26
- }
27
-
28
- NSMutableURLRequest *req = [NSMutableURLRequest __swizzle_requestWithURL:url];
29
- NSDictionary<NSString*, NSString*> *currentHeaders = [[[MLRNCustomHeaders sharedInstance] currentHeaders] copy];
30
- if(currentHeaders != nil && [currentHeaders count]>0) {
31
- for (NSString* headerName in currentHeaders) {
32
- id headerValue = currentHeaders[headerName];
33
- [req setValue:headerValue forHTTPHeaderField:headerName];
34
- }
35
- }
36
- return req;
14
+ + (NSMutableURLRequest *)__swizzle_requestWithURL:(NSURL *)url {
15
+ if ([url.scheme isEqualToString:@"ws"]) {
16
+ return [NSMutableURLRequest __swizzle_requestWithURL:url];
17
+ }
18
+
19
+ NSArray<NSString *> *stack = [NSThread callStackSymbols];
20
+ if ([stack count] < 2) {
21
+ return [NSMutableURLRequest __swizzle_requestWithURL:url];
22
+ }
23
+
24
+ if ([stack[1] containsString:@"MapLibre"] == NO) {
25
+ return [NSMutableURLRequest __swizzle_requestWithURL:url];
26
+ }
27
+
28
+ NSMutableURLRequest *req = [NSMutableURLRequest __swizzle_requestWithURL:url];
29
+ NSDictionary<NSString *, NSString *> *currentHeaders =
30
+ [[[MLRNCustomHeaders sharedInstance] currentHeaders] copy];
31
+ if (currentHeaders != nil && [currentHeaders count] > 0) {
32
+ for (NSString *headerName in currentHeaders) {
33
+ id headerValue = currentHeaders[headerName];
34
+ [req setValue:headerValue forHTTPHeaderField:headerName];
37
35
  }
36
+ }
37
+ return req;
38
+ }
38
39
 
39
40
  @end
40
41
 
41
42
  @implementation MLRNCustomHeaders {
42
- NSMutableDictionary<NSString*, NSString*> *_currentHeaders;
43
- BOOL areHeadersAdded;
43
+ NSMutableDictionary<NSString *, NSString *> *_currentHeaders;
44
+ BOOL areHeadersAdded;
44
45
  }
45
46
 
46
- + (id)sharedInstance
47
- {
48
- static MLRNCustomHeaders *customHeaders;
49
- static dispatch_once_t onceToken;
50
- dispatch_once(&onceToken, ^{ customHeaders = [[self alloc] init]; });
51
- return customHeaders;
47
+ + (id)sharedInstance {
48
+ static MLRNCustomHeaders *customHeaders;
49
+ static dispatch_once_t onceToken;
50
+ dispatch_once(&onceToken, ^{
51
+ customHeaders = [[self alloc] init];
52
+ });
53
+ return customHeaders;
52
54
  }
53
55
 
54
56
  // This replaces the [NSMutableURLRequest requestWithURL:] with custom implementation which
55
57
  // adds runtime headers copied from [MLRNCustomHeaders _currentHeaders]
56
- -(void)initHeaders
57
- {
58
- if (!areHeadersAdded) {
59
- areHeadersAdded = YES;
60
- NSLog(@"Replace method [NSMutableURLRequest requestWithURL]");
61
- static dispatch_once_t onceToken;
62
- dispatch_once(&onceToken, ^{
63
- Class targetClass = [NSMutableURLRequest class];
64
- Method oldMethod = class_getClassMethod(targetClass, @selector(requestWithURL:));
65
- Method newMethod = class_getClassMethod(targetClass, @selector(__swizzle_requestWithURL:));
66
- method_exchangeImplementations(oldMethod, newMethod);
67
- });
68
- }
58
+ - (void)initHeaders {
59
+ if (!areHeadersAdded) {
60
+ areHeadersAdded = YES;
61
+ NSLog(@"Replace method [NSMutableURLRequest requestWithURL]");
62
+ static dispatch_once_t onceToken;
63
+ dispatch_once(&onceToken, ^{
64
+ Class targetClass = [NSMutableURLRequest class];
65
+ Method oldMethod = class_getClassMethod(targetClass, @selector(requestWithURL:));
66
+ Method newMethod = class_getClassMethod(targetClass, @selector(__swizzle_requestWithURL:));
67
+ method_exchangeImplementations(oldMethod, newMethod);
68
+ });
69
+ }
69
70
  }
70
71
 
71
- - (instancetype)init
72
- {
73
- if (self = [super init]) {
74
- _currentHeaders = [[NSMutableDictionary alloc] init];
75
- areHeadersAdded = NO;
76
- }
77
- return self;
72
+ - (instancetype)init {
73
+ if (self = [super init]) {
74
+ _currentHeaders = [[NSMutableDictionary alloc] init];
75
+ areHeadersAdded = NO;
76
+ }
77
+ return self;
78
78
  }
79
79
 
80
80
  - (void)addHeader:(NSString *)value forHeaderName:(NSString *)headerName {
81
+ if (!areHeadersAdded) {
82
+ areHeadersAdded = YES;
83
+ }
81
84
 
82
- if(!areHeadersAdded) {
83
- areHeadersAdded = YES;
84
- }
85
-
86
- [_currentHeaders setObject:value forKey:headerName];
87
- [[[MLNNetworkConfiguration sharedManager] sessionConfiguration] setHTTPAdditionalHeaders:_currentHeaders];
85
+ [_currentHeaders setObject:value forKey:headerName];
86
+ [[[MLNNetworkConfiguration sharedManager] sessionConfiguration]
87
+ setHTTPAdditionalHeaders:_currentHeaders];
88
88
  }
89
89
 
90
90
  - (void)removeHeader:(NSString *)header {
91
- if(!areHeadersAdded) {
92
- return;
93
- }
91
+ if (!areHeadersAdded) {
92
+ return;
93
+ }
94
94
 
95
- [_currentHeaders removeObjectForKey:header];
95
+ [_currentHeaders removeObjectForKey:header];
96
96
  }
97
97
 
98
98
  @end
@@ -1,13 +1,13 @@
1
1
  #import <Foundation/Foundation.h>
2
2
  #import "MLRNEventProtocol.h"
3
3
 
4
- @interface MLRNEvent : NSObject<MLRNEventProtocol>
4
+ @interface MLRNEvent : NSObject <MLRNEventProtocol>
5
5
 
6
6
  @property (nonatomic, copy) NSString *type;
7
7
  @property (nonatomic, strong) NSDictionary *payload;
8
8
  @property (nonatomic, readonly) NSTimeInterval timestamp;
9
9
 
10
- + (MLRNEvent*)makeEvent:(NSString*)eventType;
11
- + (MLRNEvent*)makeEvent:(NSString*)eventType withPayload:(NSDictionary*)payload;
10
+ + (MLRNEvent *)makeEvent:(NSString *)eventType;
11
+ + (MLRNEvent *)makeEvent:(NSString *)eventType withPayload:(NSDictionary *)payload;
12
12
 
13
13
  @end
@@ -2,38 +2,33 @@
2
2
 
3
3
  @implementation MLRNEvent
4
4
 
5
- - (instancetype)init
6
- {
7
- if (self = [super init]) {
8
- _timestamp = [[NSDate date] timeIntervalSince1970];
9
- }
10
- return self;
5
+ - (instancetype)init {
6
+ if (self = [super init]) {
7
+ _timestamp = [[NSDate date] timeIntervalSince1970];
8
+ }
9
+ return self;
11
10
  }
12
11
 
13
- - (NSDictionary*)payload
14
- {
15
- if (_payload == nil) {
16
- return @{};
17
- }
18
- return _payload;
12
+ - (NSDictionary *)payload {
13
+ if (_payload == nil) {
14
+ return @{};
15
+ }
16
+ return _payload;
19
17
  }
20
18
 
21
- - (NSDictionary*)toJSON
22
- {
23
- return @{ @"type": self.type, @"payload": self.payload };
19
+ - (NSDictionary *)toJSON {
20
+ return @{@"type" : self.type, @"payload" : self.payload};
24
21
  }
25
22
 
26
- + (MLRNEvent*)makeEvent:(NSString*)type
27
- {
28
- return [MLRNEvent makeEvent:type withPayload:@{}];
23
+ + (MLRNEvent *)makeEvent:(NSString *)type {
24
+ return [MLRNEvent makeEvent:type withPayload:@{}];
29
25
  }
30
26
 
31
- + (MLRNEvent*)makeEvent:(NSString*)type withPayload:(NSDictionary*)payload
32
- {
33
- MLRNEvent *event = [[MLRNEvent alloc] init];
34
- event.type = type;
35
- event.payload = payload;
36
- return event;
27
+ + (MLRNEvent *)makeEvent:(NSString *)type withPayload:(NSDictionary *)payload {
28
+ MLRNEvent *event = [[MLRNEvent alloc] init];
29
+ event.type = type;
30
+ event.payload = payload;
31
+ return event;
37
32
  }
38
33
 
39
34
  @end
@@ -3,6 +3,6 @@
3
3
  @property (nonatomic, copy) NSString *type;
4
4
  @property (nonatomic, strong) NSDictionary *payload;
5
5
 
6
- - (NSDictionary*)toJSON;
6
+ - (NSDictionary *)toJSON;
7
7
 
8
8
  @end
@@ -1,24 +1,28 @@
1
1
  #import "MLRNFillExtrusionLayer.h"
2
- #import "MLRNStyle.h"
3
2
  #import <React/RCTLog.h>
3
+ #import "MLRNStyle.h"
4
4
 
5
5
  @implementation MLRNFillExtrusionLayer
6
6
 
7
- - (MLNFillExtrusionStyleLayer*)makeLayer:(MLNStyle*)style
8
- {
9
- MLNSource *source = [self layerWithSourceIDInStyle:style];
10
- if (source == nil) { return nil; }
11
- MLNFillExtrusionStyleLayer *layer = [[MLNFillExtrusionStyleLayer alloc] initWithIdentifier:self.id source:source];
12
- layer.sourceLayerIdentifier = self.sourceLayerID;
13
- return layer;
7
+ - (MLNFillExtrusionStyleLayer *)makeLayer:(MLNStyle *)style {
8
+ MLNSource *source = [self layerWithSourceIDInStyle:style];
9
+ if (source == nil) {
10
+ return nil;
11
+ }
12
+ MLNFillExtrusionStyleLayer *layer =
13
+ [[MLNFillExtrusionStyleLayer alloc] initWithIdentifier:self.id source:source];
14
+ layer.sourceLayerIdentifier = self.sourceLayerID;
15
+ return layer;
14
16
  }
15
17
 
16
- - (void)addStyles
17
- {
18
- MLRNStyle *style = [[MLRNStyle alloc] initWithMLNStyle:self.style];
19
- style.bridge = self.bridge;
20
- [style fillExtrusionLayer:(MLNFillExtrusionStyleLayer*)self.styleLayer withReactStyle:self.reactStyle isValid:^{ return [self isAddedToMap];
21
- }];
18
+ - (void)addStyles {
19
+ MLRNStyle *style = [[MLRNStyle alloc] initWithMLNStyle:self.style];
20
+ style.bridge = self.bridge;
21
+ [style fillExtrusionLayer:(MLNFillExtrusionStyleLayer *)self.styleLayer
22
+ withReactStyle:self.reactStyle
23
+ isValid:^{
24
+ return [self isAddedToMap];
25
+ }];
22
26
  }
23
27
 
24
28
  @end
@@ -21,11 +21,10 @@ RCT_EXPORT_VIEW_PROPERTY(reactStyle, NSDictionary);
21
21
  RCT_EXPORT_VIEW_PROPERTY(maxZoomLevel, NSNumber);
22
22
  RCT_EXPORT_VIEW_PROPERTY(minZoomLevel, NSNumber);
23
23
 
24
- - (UIView*)view
25
- {
26
- MLRNFillExtrusionLayer *layer = [MLRNFillExtrusionLayer new];
27
- layer.bridge = self.bridge;
28
- return layer;
24
+ - (UIView *)view {
25
+ MLRNFillExtrusionLayer *layer = [MLRNFillExtrusionLayer new];
26
+ layer.bridge = self.bridge;
27
+ return layer;
29
28
  }
30
29
 
31
30
  @end
@@ -5,22 +5,24 @@
5
5
 
6
6
  @implementation MLRNFillLayer
7
7
 
8
- - (MLNStyleLayer*)makeLayer:(MLNStyle*)style
9
- {
10
- MLNSource *source = [self layerWithSourceIDInStyle:style];
11
- if (source == nil) { return nil; }
12
- MLNFillStyleLayer *layer = [[MLNFillStyleLayer alloc] initWithIdentifier:self.id source:source];
13
- layer.sourceLayerIdentifier = self.sourceLayerID;
14
- return layer;
8
+ - (MLNStyleLayer *)makeLayer:(MLNStyle *)style {
9
+ MLNSource *source = [self layerWithSourceIDInStyle:style];
10
+ if (source == nil) {
11
+ return nil;
12
+ }
13
+ MLNFillStyleLayer *layer = [[MLNFillStyleLayer alloc] initWithIdentifier:self.id source:source];
14
+ layer.sourceLayerIdentifier = self.sourceLayerID;
15
+ return layer;
15
16
  }
16
17
 
17
- - (void)addStyles
18
- {
19
- MLRNStyle *style = [[MLRNStyle alloc] initWithMLNStyle:self.style];
20
- style.bridge = self.bridge;
21
- [style fillLayer:(MLNFillStyleLayer*)self.styleLayer withReactStyle:self.reactStyle isValid:^{
22
- return [self isAddedToMap];
23
- }];
18
+ - (void)addStyles {
19
+ MLRNStyle *style = [[MLRNStyle alloc] initWithMLNStyle:self.style];
20
+ style.bridge = self.bridge;
21
+ [style fillLayer:(MLNFillStyleLayer *)self.styleLayer
22
+ withReactStyle:self.reactStyle
23
+ isValid:^{
24
+ return [self isAddedToMap];
25
+ }];
24
26
  }
25
27
 
26
28
  @end
@@ -19,11 +19,10 @@ RCT_EXPORT_VIEW_PROPERTY(reactStyle, NSDictionary);
19
19
  RCT_EXPORT_VIEW_PROPERTY(maxZoomLevel, NSNumber);
20
20
  RCT_EXPORT_VIEW_PROPERTY(minZoomLevel, NSNumber);
21
21
 
22
- - (UIView*)view
23
- {
24
- MLRNFillLayer *layer = [MLRNFillLayer new];
25
- layer.bridge = self.bridge;
26
- return layer;
22
+ - (UIView *)view {
23
+ MLRNFillLayer *layer = [MLRNFillLayer new];
24
+ layer.bridge = self.bridge;
25
+ return layer;
27
26
  }
28
27
 
29
28
  @end
@@ -3,22 +3,25 @@
3
3
 
4
4
  @implementation MLRNHeatmapLayer
5
5
 
6
- - (MLNHeatmapStyleLayer*)makeLayer:(MLNStyle*)style
7
- {
8
- MLNSource *source = [self layerWithSourceIDInStyle:style];
9
- if (source == nil) { return nil; }
10
- MLNHeatmapStyleLayer *layer = [[MLNHeatmapStyleLayer alloc] initWithIdentifier:self.id source:source];
11
- layer.sourceLayerIdentifier = self.sourceLayerID;
12
- return layer;
6
+ - (MLNHeatmapStyleLayer *)makeLayer:(MLNStyle *)style {
7
+ MLNSource *source = [self layerWithSourceIDInStyle:style];
8
+ if (source == nil) {
9
+ return nil;
10
+ }
11
+ MLNHeatmapStyleLayer *layer = [[MLNHeatmapStyleLayer alloc] initWithIdentifier:self.id
12
+ source:source];
13
+ layer.sourceLayerIdentifier = self.sourceLayerID;
14
+ return layer;
13
15
  }
14
16
 
15
- - (void)addStyles
16
- {
17
- MLRNStyle *style = [[MLRNStyle alloc] initWithMLNStyle:self.style];
18
- style.bridge = self.bridge;
19
- [style heatmapLayer:(MLNHeatmapStyleLayer *)self.styleLayer withReactStyle:self.reactStyle isValid:^{
20
- return [self isAddedToMap];
21
- }];
17
+ - (void)addStyles {
18
+ MLRNStyle *style = [[MLRNStyle alloc] initWithMLNStyle:self.style];
19
+ style.bridge = self.bridge;
20
+ [style heatmapLayer:(MLNHeatmapStyleLayer *)self.styleLayer
21
+ withReactStyle:self.reactStyle
22
+ isValid:^{
23
+ return [self isAddedToMap];
24
+ }];
22
25
  }
23
26
 
24
27
  @end
@@ -21,11 +21,10 @@ RCT_EXPORT_VIEW_PROPERTY(reactStyle, NSDictionary);
21
21
  RCT_EXPORT_VIEW_PROPERTY(maxZoomLevel, NSNumber);
22
22
  RCT_EXPORT_VIEW_PROPERTY(minZoomLevel, NSNumber);
23
23
 
24
- - (UIView*)view
25
- {
26
- MLRNHeatmapLayer *layer = [MLRNHeatmapLayer new];
27
- layer.bridge = self.bridge;
28
- return layer;
24
+ - (UIView *)view {
25
+ MLRNHeatmapLayer *layer = [MLRNHeatmapLayer new];
26
+ layer.bridge = self.bridge;
27
+ return layer;
29
28
  }
30
29
 
31
30
  @end
@@ -6,6 +6,9 @@
6
6
  + (instancetype)sharedInstance;
7
7
 
8
8
  - (void)cancelAllOperations;
9
- - (void)addImage:(NSString *)imageURL scale:(double)scale bridge:(RCTBridge *)bridge completionHandler:(RCTImageLoaderCompletionBlock)handler;
9
+ - (void)addImage:(NSString *)imageURL
10
+ scale:(double)scale
11
+ bridge:(RCTBridge *)bridge
12
+ completionHandler:(RCTImageLoaderCompletionBlock)handler;
10
13
 
11
14
  @end
@@ -2,48 +2,45 @@
2
2
  #import "MLRNImageQueueOperation.h"
3
3
  #import "MLRNUtils.h"
4
4
 
5
- @implementation MLRNImageQueue
6
- {
7
- NSOperationQueue *imageQueue;
5
+ @implementation MLRNImageQueue {
6
+ NSOperationQueue *imageQueue;
8
7
  }
9
8
 
10
- - (id)init
11
- {
12
- if (self = [super init]) {
13
- imageQueue = [[NSOperationQueue alloc] init];
14
- imageQueue.name = @"org.maplibre.reactnative.DownloadImageQueue";
15
- }
16
- return self;
9
+ - (id)init {
10
+ if (self = [super init]) {
11
+ imageQueue = [[NSOperationQueue alloc] init];
12
+ imageQueue.name = @"org.maplibre.reactnative.DownloadImageQueue";
13
+ }
14
+ return self;
17
15
  }
18
16
 
19
- - (void)dealloc
20
- {
21
- [self cancelAllOperations];
17
+ - (void)dealloc {
18
+ [self cancelAllOperations];
22
19
  }
23
20
 
24
- + (instancetype)sharedInstance
25
- {
26
- static MLRNImageQueue *sharedInstance = nil;
27
- static dispatch_once_t onceToken;
28
- dispatch_once(&onceToken, ^{
29
- sharedInstance = [[MLRNImageQueue alloc] init];
30
- });
31
- return sharedInstance;
21
+ + (instancetype)sharedInstance {
22
+ static MLRNImageQueue *sharedInstance = nil;
23
+ static dispatch_once_t onceToken;
24
+ dispatch_once(&onceToken, ^{
25
+ sharedInstance = [[MLRNImageQueue alloc] init];
26
+ });
27
+ return sharedInstance;
32
28
  }
33
29
 
34
- - (void)cancelAllOperations
35
- {
36
- [imageQueue cancelAllOperations];
30
+ - (void)cancelAllOperations {
31
+ [imageQueue cancelAllOperations];
37
32
  }
38
33
 
39
- - (void)addImage:(NSString *)imageURL scale:(double)scale bridge:(RCTBridge *)bridge completionHandler:(RCTImageLoaderCompletionBlock)handler
40
- {
41
- MLRNImageQueueOperation *operation = [[MLRNImageQueueOperation alloc] init];
42
- operation.bridge = bridge;
43
- operation.urlRequest = [RCTConvert NSURLRequest:imageURL];
44
- operation.completionHandler = handler;
45
- operation.scale = scale;
46
- [imageQueue addOperation:operation];
34
+ - (void)addImage:(NSString *)imageURL
35
+ scale:(double)scale
36
+ bridge:(RCTBridge *)bridge
37
+ completionHandler:(RCTImageLoaderCompletionBlock)handler {
38
+ MLRNImageQueueOperation *operation = [[MLRNImageQueueOperation alloc] init];
39
+ operation.bridge = bridge;
40
+ operation.urlRequest = [RCTConvert NSURLRequest:imageURL];
41
+ operation.completionHandler = handler;
42
+ operation.scale = scale;
43
+ [imageQueue addOperation:operation];
47
44
  }
48
45
 
49
46
  @end
@@ -5,6 +5,6 @@
5
5
  @property (nonatomic, weak) RCTBridge *bridge;
6
6
  @property (nonatomic, copy) RCTImageLoaderCompletionBlock completionHandler;
7
7
  @property (nonatomic, copy) NSURLRequest *urlRequest;
8
- @property (nonatomic) double scale;
8
+ @property (nonatomic) double scale;
9
9
 
10
10
  @end