@rnmapbox/maps 10.1.0-beta.13 → 10.1.0-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/rnmapbox/rnmbx/RNMBXPackage.kt +19 -8
- package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/NativeMapViewModule.kt +1 -1
- package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXAndroidTextureMapViewManager.kt +1 -1
- package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapView.kt +15 -15
- package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapViewManager.kt +1 -1
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXImageSource.kt +1 -1
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXShapeSource.kt +21 -23
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXShapeSourceManager.kt +0 -46
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXShapeSourceModule.kt +61 -0
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/{RCTSource.kt → RNMBXSource.kt} +8 -8
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXTileSource.kt +1 -1
- package/android/src/main/java/com/rnmapbox/rnmbx/events/FeatureClickEvent.java +4 -4
- package/android/src/main/java/com/rnmapbox/rnmbx/utils/ViewTagResolver.kt +6 -5
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXImageSourceManagerDelegate.java +41 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXImageSourceManagerInterface.java +20 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXRasterDemSourceManagerDelegate.java +50 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXRasterDemSourceManagerInterface.java +23 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXRasterSourceManagerDelegate.java +56 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXRasterSourceManagerInterface.java +25 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXShapeSourceManagerDelegate.java +77 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXShapeSourceManagerInterface.java +32 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXVectorSourceManagerDelegate.java +59 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXVectorSourceManagerInterface.java +26 -0
- package/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXShapeSourceModuleSpec.java +48 -0
- package/ios/RNMBX/RNMBXBackgroundLayerComponentView.mm +2 -0
- package/ios/RNMBX/RNMBXCircleLayerComponentView.mm +2 -0
- package/ios/RNMBX/RNMBXFillExtrusionLayerComponentView.mm +3 -1
- package/ios/RNMBX/RNMBXFillLayerComponentView.mm +2 -0
- package/ios/RNMBX/RNMBXHeatmapLayerComponentView.mm +2 -0
- package/ios/RNMBX/RNMBXImageSource.swift +3 -3
- package/ios/RNMBX/RNMBXImageSourceComponentView.h +15 -0
- package/ios/RNMBX/RNMBXImageSourceComponentView.mm +100 -0
- package/ios/RNMBX/{RNMBXImageSourceManager.m → RNMBXImageSourceViewManager.m} +1 -1
- package/ios/RNMBX/{RNMBXImageSourceManager.swift → RNMBXImageSourceViewManager.swift} +2 -2
- package/ios/RNMBX/RNMBXInteractiveElement.swift +7 -7
- package/ios/RNMBX/RNMBXLayer.swift +1 -1
- package/ios/RNMBX/RNMBXLineLayerComponentView.mm +2 -0
- package/ios/RNMBX/RNMBXMapFeatureView.h +7 -0
- package/ios/RNMBX/RNMBXRasterDemSource.swift +6 -6
- package/ios/RNMBX/RNMBXRasterDemSourceComponentView.h +17 -0
- package/ios/RNMBX/RNMBXRasterDemSourceComponentView.mm +116 -0
- package/ios/RNMBX/{RNMBXRasterDemSourceManager.m → RNMBXRasterDemSourceViewManager.m} +1 -7
- package/ios/RNMBX/{RNMBXRasterDemSourceManager.swift → RNMBXRasterDemSourceViewManager.swift} +2 -2
- package/ios/RNMBX/RNMBXRasterLayerComponentView.mm +2 -0
- package/ios/RNMBX/RNMBXRasterSource.swift +8 -8
- package/ios/RNMBX/RNMBXRasterSourceComponentView.h +17 -0
- package/ios/RNMBX/RNMBXRasterSourceComponentView.mm +124 -0
- package/ios/RNMBX/{RNMBXRasterSourceManager.m → RNMBXRasterSourceViewManager.m} +1 -1
- package/ios/RNMBX/{RNMBXRasterSourceManager.swift → RNMBXRasterSourceViewManager.swift} +2 -2
- package/ios/RNMBX/RNMBXShapeSource.swift +11 -11
- package/ios/RNMBX/RNMBXShapeSourceComponentView.h +17 -0
- package/ios/RNMBX/RNMBXShapeSourceComponentView.mm +153 -0
- package/ios/RNMBX/RNMBXShapeSourceModule.h +18 -0
- package/ios/RNMBX/RNMBXShapeSourceModule.mm +87 -0
- package/ios/RNMBX/RNMBXShapeSourceViewManager.m +26 -0
- package/ios/RNMBX/{RNMBXShapeSourceManager.swift → RNMBXShapeSourceViewManager.swift} +12 -42
- package/ios/RNMBX/RNMBXSkyLayerComponentView.mm +2 -0
- package/ios/RNMBX/RNMBXSource.swift +36 -27
- package/ios/RNMBX/RNMBXSymbolLayerComponentView.mm +2 -0
- package/ios/RNMBX/RNMBXTileSource.swift +2 -2
- package/ios/RNMBX/RNMBXVectorSource.swift +6 -6
- package/ios/RNMBX/RNMBXVectorSourceComponentView.h +17 -0
- package/ios/RNMBX/RNMBXVectorSourceComponentView.mm +141 -0
- package/ios/RNMBX/{RNMBXVectorSourceManager.m → RNMBXVectorSourceViewManager.m} +1 -1
- package/ios/RNMBX/{RNMBXVectorSourceManager.swift → RNMBXVectorSourceViewManager.swift} +2 -2
- package/ios/install.md +1 -0
- package/lib/commonjs/components/ImageSource.js +10 -7
- package/lib/commonjs/components/ImageSource.js.map +1 -1
- package/lib/commonjs/components/RasterDemSource.js +11 -8
- package/lib/commonjs/components/RasterDemSource.js.map +1 -1
- package/lib/commonjs/components/RasterSource.js +11 -8
- package/lib/commonjs/components/RasterSource.js.map +1 -1
- package/lib/commonjs/components/ShapeSource.js +31 -52
- package/lib/commonjs/components/ShapeSource.js.map +1 -1
- package/lib/commonjs/components/VectorSource.js +26 -39
- package/lib/commonjs/components/VectorSource.js.map +1 -1
- package/lib/commonjs/specs/NativeRNMBXShapeSourceModule.js +10 -0
- package/lib/commonjs/specs/NativeRNMBXShapeSourceModule.js.map +1 -0
- package/lib/commonjs/specs/RNMBXImageSourceNativeComponent.js +10 -0
- package/lib/commonjs/specs/RNMBXImageSourceNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/RNMBXRasterDemSourceNativeComponent.js +10 -0
- package/lib/commonjs/specs/RNMBXRasterDemSourceNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/RNMBXRasterSourceNativeComponent.js +10 -0
- package/lib/commonjs/specs/RNMBXRasterSourceNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/RNMBXShapeSourceNativeComponent.js +10 -0
- package/lib/commonjs/specs/RNMBXShapeSourceNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/RNMBXVectorSourceNativeComponent.js +10 -0
- package/lib/commonjs/specs/RNMBXVectorSourceNativeComponent.js.map +1 -0
- package/lib/module/components/ImageSource.js +10 -7
- package/lib/module/components/ImageSource.js.map +1 -1
- package/lib/module/components/RasterDemSource.js +11 -8
- package/lib/module/components/RasterDemSource.js.map +1 -1
- package/lib/module/components/RasterSource.js +11 -8
- package/lib/module/components/RasterSource.js.map +1 -1
- package/lib/module/components/ShapeSource.js +32 -53
- package/lib/module/components/ShapeSource.js.map +1 -1
- package/lib/module/components/VectorSource.js +28 -41
- package/lib/module/components/VectorSource.js.map +1 -1
- package/lib/module/specs/NativeRNMBXShapeSourceModule.js +5 -0
- package/lib/module/specs/NativeRNMBXShapeSourceModule.js.map +1 -0
- package/lib/module/specs/RNMBXImageSourceNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXImageSourceNativeComponent.js.map +1 -0
- package/lib/module/specs/RNMBXRasterDemSourceNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXRasterDemSourceNativeComponent.js.map +1 -0
- package/lib/module/specs/RNMBXRasterSourceNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXRasterSourceNativeComponent.js.map +1 -0
- package/lib/module/specs/RNMBXShapeSourceNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXShapeSourceNativeComponent.js.map +1 -0
- package/lib/module/specs/RNMBXVectorSourceNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXVectorSourceNativeComponent.js.map +1 -0
- package/lib/typescript/src/components/ImageSource.d.ts.map +1 -1
- package/lib/typescript/src/components/RasterDemSource.d.ts +0 -1
- package/lib/typescript/src/components/RasterDemSource.d.ts.map +1 -1
- package/lib/typescript/src/components/RasterSource.d.ts +0 -1
- package/lib/typescript/src/components/RasterSource.d.ts.map +1 -1
- package/lib/typescript/src/components/ShapeSource.d.ts +2 -58
- package/lib/typescript/src/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/src/components/VectorSource.d.ts +3 -64
- package/lib/typescript/src/components/VectorSource.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeRNMBXShapeSourceModule.d.ts +11 -0
- package/lib/typescript/src/specs/NativeRNMBXShapeSourceModule.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXImageSourceNativeComponent.d.ts +11 -0
- package/lib/typescript/src/specs/RNMBXImageSourceNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXRasterDemSourceNativeComponent.d.ts +15 -0
- package/lib/typescript/src/specs/RNMBXRasterDemSourceNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXRasterSourceNativeComponent.d.ts +17 -0
- package/lib/typescript/src/specs/RNMBXRasterSourceNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXShapeSourceNativeComponent.d.ts +29 -0
- package/lib/typescript/src/specs/RNMBXShapeSourceNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXVectorSourceNativeComponent.d.ts +23 -0
- package/lib/typescript/src/specs/RNMBXVectorSourceNativeComponent.d.ts.map +1 -0
- package/package.json +1 -1
- package/plugin/build/withMapbox.d.ts +5 -4
- package/plugin/build/withMapbox.js +46 -19
- package/plugin/install.md +20 -0
- package/plugin/src/withMapbox.ts +79 -21
- package/setup-jest.js +6 -0
- package/src/components/ImageSource.tsx +4 -6
- package/src/components/RasterDemSource.tsx +5 -8
- package/src/components/RasterSource.tsx +5 -8
- package/src/components/ShapeSource.tsx +39 -86
- package/src/components/VectorSource.tsx +20 -44
- package/src/specs/NativeRNMBXShapeSourceModule.ts +23 -0
- package/src/specs/RNMBXImageSourceNativeComponent.ts +15 -0
- package/src/specs/RNMBXRasterDemSourceNativeComponent.ts +19 -0
- package/src/specs/RNMBXRasterSourceNativeComponent.ts +21 -0
- package/src/specs/RNMBXShapeSourceNativeComponent.ts +35 -0
- package/src/specs/RNMBXVectorSourceNativeComponent.ts +28 -0
- package/ios/RNMBX/RNMBXShapeSourceManager.m +0 -45
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/Annotation.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/Event.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/Feature.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/HttpInterceptor.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/Image.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/Light.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/Location.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/MapboxMap.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/OfflineManager.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/OrnamentSettings.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/ResourceOption.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/Snapshot.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v10/com/{mapbox → rnmapbox}/rnmbx/v11compat/style.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/Annotation.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/Event.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/Feature.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/HttpInterceptor.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/Image.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/Light.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/Location.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/MapboxMap.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/OfflineManager.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/OrnamentSettings.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/ResourceOption.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/Snapshot.kt +0 -0
- /package/android/src/main/mapbox-v11-compat/v11/com/{mapbox → rnmapbox}/rnmbx/v11compat/style.kt +0 -0
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import MapboxMaps
|
|
2
2
|
|
|
3
3
|
@objc
|
|
4
|
-
class RNMBXInteractiveElement : UIView, RNMBXMapComponent {
|
|
4
|
+
public class RNMBXInteractiveElement : UIView, RNMBXMapComponent {
|
|
5
5
|
weak var map : RNMBXMapView? = nil
|
|
6
6
|
|
|
7
7
|
static let hitboxDefault = 44.0
|
|
8
8
|
|
|
9
|
-
@objc var draggable: Bool = false
|
|
9
|
+
@objc public var draggable: Bool = false
|
|
10
10
|
|
|
11
|
-
@objc var hasPressListener: Bool = false
|
|
11
|
+
@objc public var hasPressListener: Bool = false
|
|
12
12
|
|
|
13
|
-
@objc var hitbox : [String:NSNumber] = [
|
|
13
|
+
@objc public var hitbox : [String:NSNumber] = [
|
|
14
14
|
"width": NSNumber(value: hitboxDefault),
|
|
15
15
|
"height": NSNumber(value: hitboxDefault)
|
|
16
16
|
]
|
|
17
17
|
|
|
18
|
-
@objc var id: String! = nil {
|
|
18
|
+
@objc public var id: String! = nil {
|
|
19
19
|
willSet {
|
|
20
20
|
if id != nil && newValue != id {
|
|
21
21
|
Logger.log(level:.warn, message: "Changing id from: \(optional: id) to \(optional: newValue), changing of id is supported")
|
|
@@ -29,9 +29,9 @@ class RNMBXInteractiveElement : UIView, RNMBXMapComponent {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
@objc var onDragStart: RCTBubblingEventBlock? = nil
|
|
32
|
+
@objc public var onDragStart: RCTBubblingEventBlock? = nil
|
|
33
33
|
|
|
34
|
-
@objc var onPress: RCTBubblingEventBlock? = nil
|
|
34
|
+
@objc public var onPress: RCTBubblingEventBlock? = nil
|
|
35
35
|
|
|
36
36
|
func getLayerIDs() -> [String] {
|
|
37
37
|
return []
|
|
@@ -15,7 +15,7 @@ func styleLayerExists(_ style: Style, id: String) -> Bool {
|
|
|
15
15
|
|
|
16
16
|
@objc(RNMBXLayer)
|
|
17
17
|
public class RNMBXLayer : UIView, RNMBXMapComponent, RNMBXSourceConsumer {
|
|
18
|
-
weak var bridge : RCTBridge? = nil
|
|
18
|
+
@objc public weak var bridge : RCTBridge? = nil
|
|
19
19
|
|
|
20
20
|
var waitingForID: String? = nil
|
|
21
21
|
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
#import <React/RCTConversions.h>
|
|
7
7
|
#import <React/RCTFabricComponentsPlugins.h>
|
|
8
|
+
#import <React/RCTBridge+Private.h>
|
|
8
9
|
|
|
9
10
|
#import <react/renderer/components/rnmapbox_maps_specs/ComponentDescriptors.h>
|
|
10
11
|
#import <react/renderer/components/rnmapbox_maps_specs/EventEmitters.h>
|
|
@@ -34,6 +35,7 @@ using namespace facebook::react;
|
|
|
34
35
|
- (void)prepareView
|
|
35
36
|
{
|
|
36
37
|
_view = [[RNMBXLineLayer alloc] init];
|
|
38
|
+
_view.bridge = [RCTBridge currentBridge];
|
|
37
39
|
self.contentView = _view;
|
|
38
40
|
}
|
|
39
41
|
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import MapboxMaps
|
|
2
2
|
|
|
3
3
|
@objc
|
|
4
|
-
class RNMBXRasterDemSource : RNMBXSource {
|
|
4
|
+
public class RNMBXRasterDemSource : RNMBXSource {
|
|
5
5
|
typealias SourceType = RasterDemSource
|
|
6
6
|
|
|
7
7
|
@objc
|
|
8
|
-
|
|
8
|
+
public var url: String? = nil
|
|
9
9
|
|
|
10
10
|
@objc
|
|
11
|
-
|
|
11
|
+
public var tileUrlTemplates: [String]? = nil
|
|
12
12
|
|
|
13
13
|
@objc
|
|
14
|
-
|
|
14
|
+
public var tileSize : NSNumber? = nil
|
|
15
15
|
|
|
16
16
|
@objc
|
|
17
|
-
|
|
17
|
+
public var maxZoomLevel : NSNumber? = nil
|
|
18
18
|
|
|
19
19
|
@objc
|
|
20
|
-
|
|
20
|
+
public var minZoomLevel : NSNumber? = nil
|
|
21
21
|
|
|
22
22
|
@objc
|
|
23
23
|
static func requiresMainQueueSetup() -> Bool {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
|
+
|
|
3
|
+
#import <UIKit/UIKit.h>
|
|
4
|
+
|
|
5
|
+
#import <React/RCTUIManager.h>
|
|
6
|
+
#import <React/RCTViewComponentView.h>
|
|
7
|
+
|
|
8
|
+
#import "RNMBXMapFeatureView.h"
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
@interface RNMBXRasterDemSourceComponentView : RCTViewComponentView <RNMBXMapFeatureView>
|
|
13
|
+
@end
|
|
14
|
+
|
|
15
|
+
NS_ASSUME_NONNULL_END
|
|
16
|
+
|
|
17
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
|
+
|
|
3
|
+
#import "RNMBXRasterDemSourceComponentView.h"
|
|
4
|
+
#import "RNMBXFabricHelpers.h"
|
|
5
|
+
|
|
6
|
+
#import <React/RCTConversions.h>
|
|
7
|
+
#import <React/RCTFabricComponentsPlugins.h>
|
|
8
|
+
|
|
9
|
+
#import <react/renderer/components/rnmapbox_maps_specs/ComponentDescriptors.h>
|
|
10
|
+
#import <react/renderer/components/rnmapbox_maps_specs/EventEmitters.h>
|
|
11
|
+
#import <react/renderer/components/rnmapbox_maps_specs/Props.h>
|
|
12
|
+
#import <react/renderer/components/rnmapbox_maps_specs/RCTComponentViewHelpers.h>
|
|
13
|
+
|
|
14
|
+
using namespace facebook::react;
|
|
15
|
+
|
|
16
|
+
@interface RNMBXRasterDemSourceComponentView () <RCTRNMBXRasterDemSourceViewProtocol>
|
|
17
|
+
@end
|
|
18
|
+
|
|
19
|
+
@implementation RNMBXRasterDemSourceComponentView {
|
|
20
|
+
RNMBXRasterDemSource *_view;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@synthesize mapFeature;
|
|
24
|
+
|
|
25
|
+
- (instancetype)initWithFrame:(CGRect)frame
|
|
26
|
+
{
|
|
27
|
+
if (self = [super initWithFrame:frame]) {
|
|
28
|
+
static const auto defaultProps = std::make_shared<const RNMBXRasterDemSourceProps>();
|
|
29
|
+
_props = defaultProps;
|
|
30
|
+
[self prepareView];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return self;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
- (void)prepareView
|
|
37
|
+
{
|
|
38
|
+
_view = [[RNMBXRasterDemSource alloc] init];
|
|
39
|
+
self.contentView = _view;
|
|
40
|
+
self.mapFeature = _view;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
- (void)prepareForRecycle
|
|
44
|
+
{
|
|
45
|
+
[super prepareForRecycle];
|
|
46
|
+
[self prepareView];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
50
|
+
{
|
|
51
|
+
if ([childComponentView isKindOfClass:[RCTViewComponentView class]]) {
|
|
52
|
+
[_view insertReactSubviewInternal:((RCTViewComponentView *)childComponentView).contentView at:index];
|
|
53
|
+
} else {
|
|
54
|
+
RCTLogError(@"Tried to add view that is not RCTViewComponentView: %@", childComponentView);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
- (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
59
|
+
{
|
|
60
|
+
if ([childComponentView isKindOfClass:[RCTViewComponentView class]]) {
|
|
61
|
+
[_view removeReactSubviewInternal:((RCTViewComponentView *)childComponentView).contentView];
|
|
62
|
+
} else {
|
|
63
|
+
RCTLogError(@"Tried to remove view that is not RCTViewComponentView: %@", childComponentView);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
#pragma mark - RCTComponentViewProtocol
|
|
68
|
+
|
|
69
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider
|
|
70
|
+
{
|
|
71
|
+
return concreteComponentDescriptorProvider<RNMBXRasterDemSourceComponentDescriptor>();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
- (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps
|
|
75
|
+
{
|
|
76
|
+
const auto &newProps = *std::static_pointer_cast<const RNMBXRasterDemSourceProps>(props);
|
|
77
|
+
id idx = RNMBXConvertFollyDynamicToId(newProps.id);
|
|
78
|
+
if (idx != nil) {
|
|
79
|
+
_view.id = idx;
|
|
80
|
+
}
|
|
81
|
+
id existing = RNMBXConvertFollyDynamicToId(newProps.existing);
|
|
82
|
+
if (existing != nil) {
|
|
83
|
+
_view.existing = existing;
|
|
84
|
+
}
|
|
85
|
+
id url = RNMBXConvertFollyDynamicToId(newProps.url);
|
|
86
|
+
if (url != nil) {
|
|
87
|
+
_view.url = url;
|
|
88
|
+
}
|
|
89
|
+
id tileUrlTemplates = RNMBXConvertFollyDynamicToId(newProps.tileUrlTemplates);
|
|
90
|
+
if (tileUrlTemplates != nil) {
|
|
91
|
+
_view.tileUrlTemplates = tileUrlTemplates;
|
|
92
|
+
}
|
|
93
|
+
id minZoomLevel = RNMBXConvertFollyDynamicToId(newProps.minZoomLevel);
|
|
94
|
+
if (minZoomLevel != nil) {
|
|
95
|
+
_view.minZoomLevel = minZoomLevel;
|
|
96
|
+
}
|
|
97
|
+
id maxZoomLevel = RNMBXConvertFollyDynamicToId(newProps.maxZoomLevel);
|
|
98
|
+
if (maxZoomLevel != nil) {
|
|
99
|
+
_view.maxZoomLevel = maxZoomLevel;
|
|
100
|
+
}
|
|
101
|
+
id tileSize = RNMBXConvertFollyDynamicToId(newProps.tileSize);
|
|
102
|
+
if (tileSize != nil) {
|
|
103
|
+
_view.tileSize = tileSize;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
[super updateProps:props oldProps:oldProps];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@end
|
|
110
|
+
|
|
111
|
+
Class<RCTComponentViewProtocol> RNMBXRasterDemSourceCls(void)
|
|
112
|
+
{
|
|
113
|
+
return RNMBXRasterDemSourceComponentView.class;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#import <React/RCTBridgeModule.h>
|
|
2
2
|
#import <React/RCTViewManager.h>
|
|
3
3
|
|
|
4
|
-
@interface
|
|
4
|
+
@interface RCT_EXTERN_REMAP_MODULE(RNMBXRasterDemSource, RNMBXRasterDemSourceViewManager, RCTViewManager)
|
|
5
5
|
|
|
6
6
|
RCT_EXPORT_VIEW_PROPERTY(id, NSString)
|
|
7
7
|
RCT_EXPORT_VIEW_PROPERTY(existing, BOOL)
|
|
@@ -11,11 +11,5 @@ RCT_EXPORT_VIEW_PROPERTY(bounds, NSArray)
|
|
|
11
11
|
RCT_EXPORT_VIEW_PROPERTY(minZoomLevel, NSNumber)
|
|
12
12
|
RCT_EXPORT_VIEW_PROPERTY(maxZoomLevel, NSNumber)
|
|
13
13
|
RCT_EXPORT_VIEW_PROPERTY(tileSize, NSNumber)
|
|
14
|
-
RCT_EXPORT_VIEW_PROPERTY(attribution, NSString)
|
|
15
|
-
RCT_EXPORT_VIEW_PROPERTY(encoding, NSString)
|
|
16
|
-
RCT_EXPORT_VIEW_PROPERTY(volatile, NSNumber)
|
|
17
|
-
RCT_EXPORT_VIEW_PROPERTY(prefetchZoomDelta, NSNumber)
|
|
18
|
-
RCT_EXPORT_VIEW_PROPERTY(minimumTileUpdateInterval, NSNumber)
|
|
19
|
-
RCT_EXPORT_VIEW_PROPERTY(maxOverscaleFactorForParentTiles, NSNumber)
|
|
20
14
|
|
|
21
15
|
@end
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
#import <React/RCTConversions.h>
|
|
7
7
|
#import <React/RCTFabricComponentsPlugins.h>
|
|
8
|
+
#import <React/RCTBridge+Private.h>
|
|
8
9
|
|
|
9
10
|
#import <react/renderer/components/rnmapbox_maps_specs/ComponentDescriptors.h>
|
|
10
11
|
#import <react/renderer/components/rnmapbox_maps_specs/EventEmitters.h>
|
|
@@ -34,6 +35,7 @@ using namespace facebook::react;
|
|
|
34
35
|
- (void)prepareView
|
|
35
36
|
{
|
|
36
37
|
_view = [[RNMBXRasterLayer alloc] init];
|
|
38
|
+
_view.bridge = [RCTBridge currentBridge];
|
|
37
39
|
self.contentView = _view;
|
|
38
40
|
}
|
|
39
41
|
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import MapboxMaps
|
|
2
2
|
|
|
3
3
|
@objc
|
|
4
|
-
class RNMBXRasterSource : RNMBXSource {
|
|
4
|
+
public class RNMBXRasterSource : RNMBXSource {
|
|
5
5
|
typealias SourceType = RasterSource
|
|
6
6
|
|
|
7
|
-
@objc var url: String? = nil
|
|
7
|
+
@objc public var url: String? = nil
|
|
8
8
|
|
|
9
|
-
@objc var tileUrlTemplates: [String]? = nil
|
|
9
|
+
@objc public var tileUrlTemplates: [String]? = nil
|
|
10
10
|
|
|
11
|
-
@objc var minZoomLevel: NSNumber?
|
|
12
|
-
@objc var maxZoomLevel: NSNumber?
|
|
13
|
-
@objc var tileSize: NSNumber?
|
|
11
|
+
@objc public var minZoomLevel: NSNumber?
|
|
12
|
+
@objc public var maxZoomLevel: NSNumber?
|
|
13
|
+
@objc public var tileSize: NSNumber?
|
|
14
14
|
|
|
15
|
-
@objc var tms: Bool = false
|
|
15
|
+
@objc public var tms: Bool = false
|
|
16
16
|
|
|
17
|
-
@objc var attribution: String?
|
|
17
|
+
@objc public var attribution: String?
|
|
18
18
|
|
|
19
19
|
override func makeSource() -> Source
|
|
20
20
|
{
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
|
+
|
|
3
|
+
#import <UIKit/UIKit.h>
|
|
4
|
+
|
|
5
|
+
#import <React/RCTUIManager.h>
|
|
6
|
+
#import <React/RCTViewComponentView.h>
|
|
7
|
+
|
|
8
|
+
#import "RNMBXMapFeatureView.h"
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
@interface RNMBXRasterSourceComponentView : RCTViewComponentView <RNMBXMapFeatureView>
|
|
13
|
+
@end
|
|
14
|
+
|
|
15
|
+
NS_ASSUME_NONNULL_END
|
|
16
|
+
|
|
17
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
|
+
|
|
3
|
+
#import "RNMBXRasterSourceComponentView.h"
|
|
4
|
+
#import "RNMBXFabricHelpers.h"
|
|
5
|
+
|
|
6
|
+
#import <React/RCTConversions.h>
|
|
7
|
+
#import <React/RCTFabricComponentsPlugins.h>
|
|
8
|
+
|
|
9
|
+
#import <react/renderer/components/rnmapbox_maps_specs/ComponentDescriptors.h>
|
|
10
|
+
#import <react/renderer/components/rnmapbox_maps_specs/EventEmitters.h>
|
|
11
|
+
#import <react/renderer/components/rnmapbox_maps_specs/Props.h>
|
|
12
|
+
#import <react/renderer/components/rnmapbox_maps_specs/RCTComponentViewHelpers.h>
|
|
13
|
+
|
|
14
|
+
using namespace facebook::react;
|
|
15
|
+
|
|
16
|
+
@interface RNMBXRasterSourceComponentView () <RCTRNMBXRasterSourceViewProtocol>
|
|
17
|
+
@end
|
|
18
|
+
|
|
19
|
+
@implementation RNMBXRasterSourceComponentView {
|
|
20
|
+
RNMBXRasterSource *_view;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@synthesize mapFeature;
|
|
24
|
+
|
|
25
|
+
- (instancetype)initWithFrame:(CGRect)frame
|
|
26
|
+
{
|
|
27
|
+
if (self = [super initWithFrame:frame]) {
|
|
28
|
+
static const auto defaultProps = std::make_shared<const RNMBXRasterSourceProps>();
|
|
29
|
+
_props = defaultProps;
|
|
30
|
+
[self prepareView];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return self;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
- (void)prepareView
|
|
37
|
+
{
|
|
38
|
+
_view = [[RNMBXRasterSource alloc] init];
|
|
39
|
+
self.contentView = _view;
|
|
40
|
+
self.mapFeature = _view;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
- (void)prepareForRecycle
|
|
44
|
+
{
|
|
45
|
+
[super prepareForRecycle];
|
|
46
|
+
[self prepareView];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
50
|
+
{
|
|
51
|
+
if ([childComponentView isKindOfClass:[RCTViewComponentView class]]) {
|
|
52
|
+
[_view insertReactSubviewInternal:((RCTViewComponentView *)childComponentView).contentView at:index];
|
|
53
|
+
} else {
|
|
54
|
+
RCTLogError(@"Tried to add view that is not RCTViewComponentView: %@", childComponentView);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
- (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
59
|
+
{
|
|
60
|
+
if ([childComponentView isKindOfClass:[RCTViewComponentView class]]) {
|
|
61
|
+
[_view removeReactSubviewInternal:((RCTViewComponentView *)childComponentView).contentView];
|
|
62
|
+
} else {
|
|
63
|
+
RCTLogError(@"Tried to remove view that is not RCTViewComponentView: %@", childComponentView);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
#pragma mark - RCTComponentViewProtocol
|
|
68
|
+
|
|
69
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider
|
|
70
|
+
{
|
|
71
|
+
return concreteComponentDescriptorProvider<RNMBXRasterSourceComponentDescriptor>();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
- (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps
|
|
75
|
+
{
|
|
76
|
+
const auto &newProps = *std::static_pointer_cast<const RNMBXRasterSourceProps>(props);
|
|
77
|
+
id idx = RNMBXConvertFollyDynamicToId(newProps.id);
|
|
78
|
+
if (idx != nil) {
|
|
79
|
+
_view.id = idx;
|
|
80
|
+
}
|
|
81
|
+
id existing = RNMBXConvertFollyDynamicToId(newProps.existing);
|
|
82
|
+
if (existing != nil) {
|
|
83
|
+
_view.existing = existing;
|
|
84
|
+
}
|
|
85
|
+
id url = RNMBXConvertFollyDynamicToId(newProps.url);
|
|
86
|
+
if (url != nil) {
|
|
87
|
+
_view.url = url;
|
|
88
|
+
}
|
|
89
|
+
id tileUrlTemplates = RNMBXConvertFollyDynamicToId(newProps.tileUrlTemplates);
|
|
90
|
+
if (tileUrlTemplates != nil) {
|
|
91
|
+
_view.tileUrlTemplates = tileUrlTemplates;
|
|
92
|
+
}
|
|
93
|
+
id minZoomLevel = RNMBXConvertFollyDynamicToId(newProps.minZoomLevel);
|
|
94
|
+
if (minZoomLevel != nil) {
|
|
95
|
+
_view.minZoomLevel = minZoomLevel;
|
|
96
|
+
}
|
|
97
|
+
id maxZoomLevel = RNMBXConvertFollyDynamicToId(newProps.maxZoomLevel);
|
|
98
|
+
if (maxZoomLevel != nil) {
|
|
99
|
+
_view.maxZoomLevel = maxZoomLevel;
|
|
100
|
+
}
|
|
101
|
+
id tileSize = RNMBXConvertFollyDynamicToId(newProps.tileSize);
|
|
102
|
+
if (tileSize != nil) {
|
|
103
|
+
_view.tileSize = tileSize;
|
|
104
|
+
}
|
|
105
|
+
id tms = RNMBXConvertFollyDynamicToId(newProps.tms);
|
|
106
|
+
if (tms != nil) {
|
|
107
|
+
_view.tms = tms;
|
|
108
|
+
}
|
|
109
|
+
id attribution = RNMBXConvertFollyDynamicToId(newProps.attribution);
|
|
110
|
+
if (attribution != nil) {
|
|
111
|
+
_view.attribution = attribution;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
[super updateProps:props oldProps:oldProps];
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@end
|
|
118
|
+
|
|
119
|
+
Class<RCTComponentViewProtocol> RNMBXRasterSourceCls(void)
|
|
120
|
+
{
|
|
121
|
+
return RNMBXRasterSourceComponentView.class;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#import <React/RCTBridgeModule.h>
|
|
2
2
|
#import <React/RCTViewManager.h>
|
|
3
3
|
|
|
4
|
-
@interface
|
|
4
|
+
@interface RCT_EXTERN_REMAP_MODULE(RNMBXRasterSource, RNMBXRasterSourceViewManager, RCTViewManager)
|
|
5
5
|
|
|
6
6
|
RCT_EXPORT_VIEW_PROPERTY(id, NSString)
|
|
7
7
|
RCT_EXPORT_VIEW_PROPERTY(existing, BOOL)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Foundation
|
|
2
2
|
import MapboxMaps
|
|
3
3
|
|
|
4
|
-
@objc(
|
|
5
|
-
class
|
|
4
|
+
@objc(RNMBXRasterSourceViewManager)
|
|
5
|
+
class RNMBXRasterSourceViewManager : RCTViewManager {
|
|
6
6
|
@objc
|
|
7
7
|
override static func requiresMainQueueSetup() -> Bool {
|
|
8
8
|
return true
|
|
@@ -2,8 +2,8 @@ import MapboxMaps
|
|
|
2
2
|
import Turf
|
|
3
3
|
|
|
4
4
|
@objc
|
|
5
|
-
class RNMBXShapeSource : RNMBXSource {
|
|
6
|
-
@objc var url : String? {
|
|
5
|
+
public class RNMBXShapeSource : RNMBXSource {
|
|
6
|
+
@objc public var url : String? {
|
|
7
7
|
didSet {
|
|
8
8
|
parseJSON(url) { [weak self] result in
|
|
9
9
|
guard let self = self else { return }
|
|
@@ -23,7 +23,7 @@ class RNMBXShapeSource : RNMBXSource {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
@objc var shape : String? {
|
|
26
|
+
@objc public var shape : String? {
|
|
27
27
|
didSet {
|
|
28
28
|
logged("RNMBXShapeSource.updateShape") {
|
|
29
29
|
let obj : GeoJSONObject = try parse(shape)
|
|
@@ -37,9 +37,9 @@ class RNMBXShapeSource : RNMBXSource {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
@objc var cluster : NSNumber?
|
|
41
|
-
@objc var clusterRadius : NSNumber?
|
|
42
|
-
@objc var clusterMaxZoomLevel : NSNumber? {
|
|
40
|
+
@objc public var cluster : NSNumber?
|
|
41
|
+
@objc public var clusterRadius : NSNumber?
|
|
42
|
+
@objc public var clusterMaxZoomLevel : NSNumber? {
|
|
43
43
|
didSet {
|
|
44
44
|
logged("RNMBXShapeSource.clusterMaxZoomLevel") {
|
|
45
45
|
if let number = clusterMaxZoomLevel?.doubleValue {
|
|
@@ -52,12 +52,12 @@ class RNMBXShapeSource : RNMBXSource {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
@objc var clusterProperties : [String: [Any]]?;
|
|
55
|
+
@objc public var clusterProperties : [String: [Any]]?;
|
|
56
56
|
|
|
57
|
-
@objc var maxZoomLevel : NSNumber?
|
|
58
|
-
@objc var buffer : NSNumber?
|
|
59
|
-
@objc var tolerance : NSNumber?
|
|
60
|
-
@objc var lineMetrics : NSNumber?
|
|
57
|
+
@objc public var maxZoomLevel : NSNumber?
|
|
58
|
+
@objc public var buffer : NSNumber?
|
|
59
|
+
@objc public var tolerance : NSNumber?
|
|
60
|
+
@objc public var lineMetrics : NSNumber?
|
|
61
61
|
|
|
62
62
|
override func sourceType() -> Source.Type {
|
|
63
63
|
return GeoJSONSource.self
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
|
+
|
|
3
|
+
#import <UIKit/UIKit.h>
|
|
4
|
+
|
|
5
|
+
#import <React/RCTUIManager.h>
|
|
6
|
+
#import <React/RCTViewComponentView.h>
|
|
7
|
+
|
|
8
|
+
#import "RNMBXMapFeatureView.h"
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
@interface RNMBXShapeSourceComponentView : RCTViewComponentView <RNMBXMapFeatureView>
|
|
13
|
+
@end
|
|
14
|
+
|
|
15
|
+
NS_ASSUME_NONNULL_END
|
|
16
|
+
|
|
17
|
+
#endif // RCT_NEW_ARCH_ENABLED
|