@rnmapbox/maps 10.1.0-beta.14 → 10.1.0-beta.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/android/build.gradle +1 -1
- package/android/src/main/java/com/rnmapbox/rnmbx/RNMBXPackage.kt +22 -3
- package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXCalloutManager.kt +33 -0
- package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXMarkerViewManager.kt +24 -10
- package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXPointAnnotationManager.kt +70 -0
- package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXPointAnnotationModule.kt +33 -0
- package/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImageManager.kt +11 -21
- package/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImageModule.kt +33 -0
- package/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImagesManager.kt +9 -8
- package/android/src/main/java/com/rnmapbox/rnmbx/components/location/RNMBXNativeUserLocationManager.kt +11 -4
- package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapView.kt +140 -63
- package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapViewManager.kt +71 -55
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/atmosphere/RNMBXAtmosphereManager.kt +0 -5
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/light/RNMBXLightManager.kt +27 -0
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXImageSourceManager.kt +16 -8
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXRasterDemSourceManager.kt +15 -1
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXRasterSourceManager.kt +11 -3
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXShapeSource.kt +0 -2
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXShapeSourceManager.kt +32 -31
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXSource.kt +1 -1
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXTileSourceManager.kt +17 -17
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXVectorSourceManager.kt +13 -32
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/terrain/RNMBXTerrainManager.kt +8 -11
- package/android/src/main/java/com/rnmapbox/rnmbx/utils/PropertyChanges.kt +68 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXCalloutManagerDelegate.java +25 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXCalloutManagerInterface.java +16 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXImageManagerDelegate.java +47 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXImageManagerInterface.java +22 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXImagesManagerDelegate.java +38 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXImagesManagerInterface.java +19 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXLightManagerDelegate.java +32 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXLightManagerInterface.java +17 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXMapViewManagerDelegate.java +3 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXMapViewManagerInterface.java +1 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXMarkerViewManagerDelegate.java +41 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXMarkerViewManagerInterface.java +20 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXNativeUserLocationManagerDelegate.java +35 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXNativeUserLocationManagerInterface.java +18 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXPointAnnotationManagerDelegate.java +41 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXPointAnnotationManagerInterface.java +20 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXShapeSourceManagerDelegate.java +0 -6
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXShapeSourceManagerInterface.java +0 -2
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXTerrainManagerDelegate.java +35 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXTerrainManagerInterface.java +18 -0
- package/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXImageModuleSpec.java +40 -0
- package/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXPointAnnotationModuleSpec.java +40 -0
- package/ios/RNMBX/RNMBXAtmosphereComponentView.mm +2 -0
- package/ios/RNMBX/RNMBXCallout.swift +1 -1
- package/ios/RNMBX/RNMBXCalloutComponentView.h +15 -0
- package/ios/RNMBX/RNMBXCalloutComponentView.mm +57 -0
- package/ios/RNMBX/{RNMBXCalloutManager.m → RNMBXCalloutViewManager.m} +1 -1
- package/ios/RNMBX/{RNMBXCalloutManager.swift → RNMBXCalloutViewManager.swift} +2 -2
- package/ios/RNMBX/RNMBXFabricHelpers.h +1 -8
- package/ios/RNMBX/RNMBXImage.swift +30 -22
- package/ios/RNMBX/RNMBXImageComponentView.h +15 -0
- package/ios/RNMBX/RNMBXImageComponentView.mm +100 -0
- package/ios/RNMBX/RNMBXImageManager.swift +0 -1
- package/ios/RNMBX/RNMBXImageModule.h +17 -0
- package/ios/RNMBX/RNMBXImageModule.mm +67 -0
- package/ios/RNMBX/RNMBXImages.swift +10 -10
- package/ios/RNMBX/RNMBXImagesComponentView.h +15 -0
- package/ios/RNMBX/RNMBXImagesComponentView.mm +91 -0
- package/ios/RNMBX/{RNMBXImagesManager.m → RNMBXImagesViewManager.m} +1 -2
- package/ios/RNMBX/{RNMBXImagesManager.swift → RNMBXImagesViewManager.swift} +2 -2
- package/ios/RNMBX/RNMBXLight.swift +7 -7
- package/ios/RNMBX/RNMBXLightComponentView.h +15 -0
- package/ios/RNMBX/RNMBXLightComponentView.mm +68 -0
- package/ios/RNMBX/{RNMBXLightManager.m → RNMBXLightViewManager.m} +1 -1
- package/ios/RNMBX/{RNMBXLightManager.swift → RNMBXLightViewManager.swift} +2 -2
- package/ios/RNMBX/RNMBXMapViewComponentView.mm +0 -1
- package/ios/RNMBX/RNMBXMarkerView.swift +23 -16
- package/ios/RNMBX/RNMBXMarkerViewComponentView.h +15 -0
- package/ios/RNMBX/RNMBXMarkerViewComponentView.mm +130 -0
- package/ios/RNMBX/RNMBXNativeUserLocation.swift +3 -3
- package/ios/RNMBX/RNMBXNativeUserLocationComponentView.h +15 -0
- package/ios/RNMBX/RNMBXNativeUserLocationComponentView.mm +72 -0
- package/ios/RNMBX/{RNMBXNativeUserLocationManager.m → RNMBXNativeUserLocationViewManager.m} +1 -1
- package/ios/RNMBX/{RNMBXNativeUserLocationManager.swift → RNMBXNativeUserLocationViewManager.swift} +2 -2
- package/ios/RNMBX/RNMBXPointAnnotation.swift +41 -30
- package/ios/RNMBX/RNMBXPointAnnotationComponentView.h +15 -0
- package/ios/RNMBX/RNMBXPointAnnotationComponentView.mm +147 -0
- package/ios/RNMBX/RNMBXPointAnnotationModule.h +17 -0
- package/ios/RNMBX/RNMBXPointAnnotationModule.mm +66 -0
- package/ios/RNMBX/{RNMBXPointAnnotationManager.m → RNMBXPointAnnotationViewManager.m} +1 -6
- package/ios/RNMBX/RNMBXPointAnnotationViewManager.swift +14 -0
- package/ios/RNMBX/RNMBXRasterDemSourceComponentView.h +1 -3
- package/ios/RNMBX/RNMBXRasterDemSourceComponentView.mm +0 -2
- package/ios/RNMBX/RNMBXRasterSourceComponentView.h +1 -3
- package/ios/RNMBX/RNMBXRasterSourceComponentView.mm +0 -2
- package/ios/RNMBX/RNMBXShapeSourceComponentView.h +1 -3
- package/ios/RNMBX/RNMBXShapeSourceComponentView.mm +4 -6
- package/ios/RNMBX/RNMBXShapeSourceModule.mm +1 -9
- package/ios/RNMBX/RNMBXSingletonLayer.swift +1 -1
- package/ios/RNMBX/RNMBXTerrain.swift +2 -2
- package/ios/RNMBX/RNMBXTerrainComponentView.h +15 -0
- package/ios/RNMBX/RNMBXTerrainComponentView.mm +78 -0
- package/ios/RNMBX/{RNMBXTerrainManager.m → RNMBXTerrainViewManager.m} +1 -1
- package/ios/RNMBX/{RNMBXTerrainManager.swift → RNMBXTerrainViewManager.swift} +2 -2
- package/ios/RNMBX/RNMBXVectorSourceComponentView.h +1 -3
- package/ios/RNMBX/RNMBXVectorSourceComponentView.mm +0 -2
- package/ios/RNMBX/rnmapbox_maps-Swift.pre.h +0 -2
- package/lib/commonjs/components/Callout.js +3 -4
- package/lib/commonjs/components/Callout.js.map +1 -1
- package/lib/commonjs/components/Image.js +20 -4
- package/lib/commonjs/components/Image.js.map +1 -1
- package/lib/commonjs/components/Images.js +6 -3
- package/lib/commonjs/components/Images.js.map +1 -1
- package/lib/commonjs/components/Light.js +5 -5
- package/lib/commonjs/components/Light.js.map +1 -1
- package/lib/commonjs/components/MapView.js +12 -49
- package/lib/commonjs/components/MapView.js.map +1 -1
- package/lib/commonjs/components/MarkerView.js +2 -1
- package/lib/commonjs/components/MarkerView.js.map +1 -1
- package/lib/commonjs/components/NativeBridgeComponent.js +6 -43
- package/lib/commonjs/components/NativeBridgeComponent.js.map +1 -1
- package/lib/commonjs/components/NativeUserLocation.js +3 -4
- package/lib/commonjs/components/NativeUserLocation.js.map +1 -1
- package/lib/commonjs/components/PointAnnotation.js +29 -14
- package/lib/commonjs/components/PointAnnotation.js.map +1 -1
- package/lib/commonjs/components/ShapeSource.js +7 -18
- package/lib/commonjs/components/ShapeSource.js.map +1 -1
- package/lib/commonjs/components/Terrain.js +4 -5
- package/lib/commonjs/components/Terrain.js.map +1 -1
- package/lib/commonjs/components/VectorSource.js +2 -11
- package/lib/commonjs/components/VectorSource.js.map +1 -1
- package/lib/commonjs/specs/NativeRNMBXImageModule.js +10 -0
- package/lib/commonjs/specs/NativeRNMBXImageModule.js.map +1 -0
- package/lib/commonjs/specs/NativeRNMBXPointAnnotationModule.js +10 -0
- package/lib/commonjs/specs/NativeRNMBXPointAnnotationModule.js.map +1 -0
- package/lib/commonjs/specs/RNMBXCalloutNativeComponent.js +11 -0
- package/lib/commonjs/specs/RNMBXCalloutNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/{RNMBXAndroidTextureMapViewNativeComponent.js → RNMBXImageNativeComponent.js} +2 -4
- package/lib/commonjs/specs/RNMBXImageNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/RNMBXImagesNativeComponent.js +10 -0
- package/lib/commonjs/specs/RNMBXImagesNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/RNMBXLightNativeComponent.js +10 -0
- package/lib/commonjs/specs/RNMBXLightNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/RNMBXMapViewNativeComponent.js +1 -1
- package/lib/commonjs/specs/RNMBXMapViewNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/RNMBXMarkerViewNativeComponent.js +10 -0
- package/lib/commonjs/specs/RNMBXMarkerViewNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/RNMBXNativeUserLocationNativeComponent.js +10 -0
- package/lib/commonjs/specs/RNMBXNativeUserLocationNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/RNMBXPointAnnotationNativeComponent.js +10 -0
- package/lib/commonjs/specs/RNMBXPointAnnotationNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/RNMBXShapeSourceNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/RNMBXTerrainNativeComponent.js +10 -0
- package/lib/commonjs/specs/RNMBXTerrainNativeComponent.js.map +1 -0
- package/lib/commonjs/utils/index.js +6 -30
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/module/components/Callout.js +3 -4
- package/lib/module/components/Callout.js.map +1 -1
- package/lib/module/components/Image.js +19 -4
- package/lib/module/components/Image.js.map +1 -1
- package/lib/module/components/Images.js +7 -4
- package/lib/module/components/Images.js.map +1 -1
- package/lib/module/components/Light.js +4 -4
- package/lib/module/components/Light.js.map +1 -1
- package/lib/module/components/MapView.js +12 -49
- package/lib/module/components/MapView.js.map +1 -1
- package/lib/module/components/MarkerView.js +3 -2
- package/lib/module/components/MarkerView.js.map +1 -1
- package/lib/module/components/NativeBridgeComponent.js +7 -44
- package/lib/module/components/NativeBridgeComponent.js.map +1 -1
- package/lib/module/components/NativeUserLocation.js +2 -4
- package/lib/module/components/NativeUserLocation.js.map +1 -1
- package/lib/module/components/PointAnnotation.js +30 -15
- package/lib/module/components/PointAnnotation.js.map +1 -1
- package/lib/module/components/ShapeSource.js +7 -18
- package/lib/module/components/ShapeSource.js.map +1 -1
- package/lib/module/components/Terrain.js +2 -4
- package/lib/module/components/Terrain.js.map +1 -1
- package/lib/module/components/VectorSource.js +2 -11
- package/lib/module/components/VectorSource.js.map +1 -1
- package/lib/module/specs/NativeRNMBXImageModule.js +5 -0
- package/lib/module/specs/NativeRNMBXImageModule.js.map +1 -0
- package/lib/module/specs/NativeRNMBXPointAnnotationModule.js +5 -0
- package/lib/module/specs/NativeRNMBXPointAnnotationModule.js.map +1 -0
- package/lib/module/specs/RNMBXCalloutNativeComponent.js +6 -0
- package/lib/module/specs/RNMBXCalloutNativeComponent.js.map +1 -0
- package/lib/module/specs/RNMBXImageNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXImageNativeComponent.js.map +1 -0
- package/lib/module/specs/RNMBXImagesNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXImagesNativeComponent.js.map +1 -0
- package/lib/module/specs/RNMBXLightNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXLightNativeComponent.js.map +1 -0
- package/lib/module/specs/RNMBXMapViewNativeComponent.js +2 -0
- package/lib/module/specs/RNMBXMapViewNativeComponent.js.map +1 -1
- package/lib/module/specs/RNMBXMarkerViewNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXMarkerViewNativeComponent.js.map +1 -0
- package/lib/module/specs/RNMBXNativeUserLocationNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXNativeUserLocationNativeComponent.js.map +1 -0
- package/lib/module/specs/RNMBXPointAnnotationNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXPointAnnotationNativeComponent.js.map +1 -0
- package/lib/module/specs/RNMBXShapeSourceNativeComponent.js.map +1 -1
- package/lib/module/specs/RNMBXTerrainNativeComponent.js +3 -0
- package/lib/module/specs/RNMBXTerrainNativeComponent.js.map +1 -0
- package/lib/module/utils/index.js +6 -29
- package/lib/module/utils/index.js.map +1 -1
- package/lib/typescript/src/components/Callout.d.ts +0 -1
- package/lib/typescript/src/components/Callout.d.ts.map +1 -1
- package/lib/typescript/src/components/Image.d.ts +0 -1
- package/lib/typescript/src/components/Image.d.ts.map +1 -1
- package/lib/typescript/src/components/Images.d.ts +0 -1
- package/lib/typescript/src/components/Images.d.ts.map +1 -1
- package/lib/typescript/src/components/Light.d.ts +0 -1
- package/lib/typescript/src/components/Light.d.ts.map +1 -1
- package/lib/typescript/src/components/MapView.d.ts +21 -28
- package/lib/typescript/src/components/MapView.d.ts.map +1 -1
- package/lib/typescript/src/components/MarkerView.d.ts.map +1 -1
- package/lib/typescript/src/components/NativeBridgeComponent.d.ts +5 -9
- package/lib/typescript/src/components/NativeBridgeComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/NativeUserLocation.d.ts.map +1 -1
- package/lib/typescript/src/components/PointAnnotation.d.ts +5 -11
- package/lib/typescript/src/components/PointAnnotation.d.ts.map +1 -1
- package/lib/typescript/src/components/ShapeSource.d.ts +40 -2
- package/lib/typescript/src/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/src/components/Terrain.d.ts +0 -1
- package/lib/typescript/src/components/Terrain.d.ts.map +1 -1
- package/lib/typescript/src/components/VectorSource.d.ts +1 -2
- package/lib/typescript/src/components/VectorSource.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeRNMBXImageModule.d.ts +9 -0
- package/lib/typescript/src/specs/NativeRNMBXImageModule.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeRNMBXPointAnnotationModule.d.ts +9 -0
- package/lib/typescript/src/specs/NativeRNMBXPointAnnotationModule.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXCalloutNativeComponent.d.ts +6 -0
- package/lib/typescript/src/specs/RNMBXCalloutNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXImageNativeComponent.d.ts +14 -0
- package/lib/typescript/src/specs/RNMBXImageNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXImagesNativeComponent.d.ts +18 -0
- package/lib/typescript/src/specs/RNMBXImagesNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXLightNativeComponent.d.ts +8 -0
- package/lib/typescript/src/specs/RNMBXLightNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXMapViewNativeComponent.d.ts +52 -3
- package/lib/typescript/src/specs/RNMBXMapViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/specs/RNMBXMarkerViewNativeComponent.d.ts +16 -0
- package/lib/typescript/src/specs/RNMBXMarkerViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXNativeUserLocationNativeComponent.d.ts +9 -0
- package/lib/typescript/src/specs/RNMBXNativeUserLocationNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXPointAnnotationNativeComponent.d.ts +37 -0
- package/lib/typescript/src/specs/RNMBXPointAnnotationNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXShapeSourceNativeComponent.d.ts +0 -2
- package/lib/typescript/src/specs/RNMBXShapeSourceNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/specs/RNMBXTerrainNativeComponent.d.ts +9 -0
- package/lib/typescript/src/specs/RNMBXTerrainNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/codegenUtils.d.ts +0 -4
- package/lib/typescript/src/specs/codegenUtils.d.ts.map +1 -1
- package/lib/typescript/src/utils/index.d.ts +2 -3
- package/lib/typescript/src/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/setup-jest.js +8 -0
- package/src/components/Callout.tsx +4 -11
- package/src/components/Image.tsx +17 -13
- package/src/components/Images.tsx +9 -19
- package/src/components/Light.tsx +4 -12
- package/src/components/MapView.tsx +36 -74
- package/src/components/MarkerView.tsx +3 -15
- package/src/components/NativeBridgeComponent.tsx +9 -57
- package/src/components/NativeUserLocation.tsx +2 -8
- package/src/components/PointAnnotation.tsx +32 -24
- package/src/components/ShapeSource.tsx +21 -44
- package/src/components/Terrain.tsx +3 -11
- package/src/components/VectorSource.tsx +2 -19
- package/src/specs/NativeRNMBXImageModule.ts +10 -0
- package/src/specs/NativeRNMBXPointAnnotationModule.ts +12 -0
- package/src/specs/RNMBXCalloutNativeComponent.ts +9 -0
- package/src/specs/RNMBXImageNativeComponent.ts +18 -0
- package/src/specs/RNMBXImagesNativeComponent.ts +18 -0
- package/src/specs/RNMBXLightNativeComponent.ts +12 -0
- package/src/specs/RNMBXMapViewNativeComponent.ts +69 -5
- package/src/specs/RNMBXMarkerViewNativeComponent.ts +21 -0
- package/src/specs/RNMBXNativeUserLocationNativeComponent.ts +13 -0
- package/src/specs/RNMBXPointAnnotationNativeComponent.ts +40 -0
- package/src/specs/RNMBXShapeSourceNativeComponent.ts +0 -2
- package/src/specs/RNMBXTerrainNativeComponent.ts +13 -0
- package/src/specs/codegenUtils.ts +0 -5
- package/src/utils/index.ts +6 -43
- package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXCalloutManager.java +0 -18
- package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXPointAnnotationManager.java +0 -84
- package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXAndroidTextureMapViewManager.kt +0 -39
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/light/RNMBXLightManager.java +0 -25
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXAndroidTextureMapViewManagerDelegate.java +0 -95
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXAndroidTextureMapViewManagerInterface.java +0 -38
- package/ios/RNMBX/RNMBXCircleLayerManager.m +0 -12
- package/ios/RNMBX/RNMBXCircleLayerManager.swift +0 -13
- package/ios/RNMBX/RNMBXMapFeatureView.h +0 -7
- package/ios/RNMBX/RNMBXPointAnnotationManager.swift +0 -34
- package/lib/commonjs/specs/RNMBXAndroidTextureMapViewNativeComponent.js.map +0 -1
- package/lib/module/specs/RNMBXAndroidTextureMapViewNativeComponent.js +0 -5
- package/lib/module/specs/RNMBXAndroidTextureMapViewNativeComponent.js.map +0 -1
- package/lib/typescript/src/specs/RNMBXAndroidTextureMapViewNativeComponent.d.ts +0 -46
- package/lib/typescript/src/specs/RNMBXAndroidTextureMapViewNativeComponent.d.ts.map +0 -1
- package/src/specs/RNMBXAndroidTextureMapViewNativeComponent.ts +0 -59
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
|
+
|
|
3
|
+
#import "RNMBXImageComponentView.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 RNMBXImageComponentView () <RCTRNMBXImageViewProtocol>
|
|
17
|
+
@end
|
|
18
|
+
|
|
19
|
+
@implementation RNMBXImageComponentView {
|
|
20
|
+
RNMBXImage *_view;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
- (instancetype)initWithFrame:(CGRect)frame
|
|
25
|
+
{
|
|
26
|
+
if (self = [super initWithFrame:frame]) {
|
|
27
|
+
static const auto defaultProps = std::make_shared<const RNMBXImageProps>();
|
|
28
|
+
_props = defaultProps;
|
|
29
|
+
[self prepareView];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return self;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
- (void)prepareView
|
|
36
|
+
{
|
|
37
|
+
_view = [[RNMBXImage alloc] init];
|
|
38
|
+
self.contentView = _view;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
42
|
+
{
|
|
43
|
+
if ([childComponentView isKindOfClass:[RCTViewComponentView class]] && ((RCTViewComponentView *)childComponentView).contentView != nil) {
|
|
44
|
+
[_view insertReactSubviewInternal:((RCTViewComponentView *)childComponentView).contentView at:index];
|
|
45
|
+
} else {
|
|
46
|
+
[_view insertReactSubviewInternal:childComponentView at:index];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
- (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
51
|
+
{
|
|
52
|
+
if ([childComponentView isKindOfClass:[RCTViewComponentView class]] && ((RCTViewComponentView *)childComponentView).contentView != nil) {
|
|
53
|
+
[_view removeReactSubviewInternal:((RCTViewComponentView *)childComponentView).contentView];
|
|
54
|
+
} else {
|
|
55
|
+
[_view removeReactSubviewInternal:childComponentView];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
#pragma mark - RCTComponentViewProtocol
|
|
60
|
+
|
|
61
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider
|
|
62
|
+
{
|
|
63
|
+
return concreteComponentDescriptorProvider<RNMBXImageComponentDescriptor>();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
- (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps
|
|
67
|
+
{
|
|
68
|
+
const auto &newProps = *std::static_pointer_cast<const RNMBXImageProps>(props);
|
|
69
|
+
id stretchX = RNMBXConvertFollyDynamicToId(newProps.stretchX);
|
|
70
|
+
if (stretchX != nil) {
|
|
71
|
+
_view.stretchX = stretchX;
|
|
72
|
+
}
|
|
73
|
+
id stretchY = RNMBXConvertFollyDynamicToId(newProps.stretchY);
|
|
74
|
+
if (stretchY != nil) {
|
|
75
|
+
_view.stretchY = stretchY;
|
|
76
|
+
}
|
|
77
|
+
id content = RNMBXConvertFollyDynamicToId(newProps.content);
|
|
78
|
+
if (content != nil) {
|
|
79
|
+
_view.content = content;
|
|
80
|
+
}
|
|
81
|
+
id sdf = RNMBXConvertFollyDynamicToId(newProps.sdf);
|
|
82
|
+
if (sdf != nil) {
|
|
83
|
+
_view.sdf = sdf;
|
|
84
|
+
}
|
|
85
|
+
id name = RNMBXConvertFollyDynamicToId(newProps.name);
|
|
86
|
+
if (name != nil) {
|
|
87
|
+
_view.name = name;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
[super updateProps:props oldProps:oldProps];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@end
|
|
94
|
+
|
|
95
|
+
Class<RCTComponentViewProtocol> RNMBXImageCls(void)
|
|
96
|
+
{
|
|
97
|
+
return RNMBXImageComponentView.class;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
#import <UIKit/UIKit.h>
|
|
3
|
+
|
|
4
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
5
|
+
#import "rnmapbox_maps_specs.h"
|
|
6
|
+
#else
|
|
7
|
+
#import <React/RCTBridge.h>
|
|
8
|
+
#endif
|
|
9
|
+
|
|
10
|
+
@interface RNMBXImageModule : NSObject
|
|
11
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
12
|
+
<NativeRNMBXImageModuleSpec>
|
|
13
|
+
#else
|
|
14
|
+
<RCTBridgeModule>
|
|
15
|
+
#endif
|
|
16
|
+
|
|
17
|
+
@end
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#import <React/RCTBridge.h>
|
|
2
|
+
#import <React/RCTUIManager.h>
|
|
3
|
+
#import <React/RCTUIManagerUtils.h>
|
|
4
|
+
|
|
5
|
+
#import "RNMBXImageModule.h"
|
|
6
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
7
|
+
#import "RNMBXImageComponentView.h"
|
|
8
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
9
|
+
|
|
10
|
+
#import "rnmapbox_maps-Swift.pre.h"
|
|
11
|
+
|
|
12
|
+
@implementation RNMBXImageModule
|
|
13
|
+
|
|
14
|
+
RCT_EXPORT_MODULE();
|
|
15
|
+
|
|
16
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
17
|
+
@synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED;
|
|
18
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
19
|
+
@synthesize bridge = _bridge;
|
|
20
|
+
|
|
21
|
+
- (dispatch_queue_t)methodQueue
|
|
22
|
+
{
|
|
23
|
+
// It seems that due to how UIBlocks work with uiManager, we need to call the methods there
|
|
24
|
+
// for the blocks to be dispatched before the batch is completed
|
|
25
|
+
return RCTGetUIManagerQueue();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
- (void)withImage:(NSNumber*)viewRef block:(void (^)(RNMBXImage *))block reject:(RCTPromiseRejectBlock)reject methodName:(NSString *)methodName
|
|
29
|
+
{
|
|
30
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
31
|
+
[self.viewRegistry_DEPRECATED addUIBlock:^(RCTViewRegistry *viewRegistry) {
|
|
32
|
+
RNMBXImageComponentView *componentView = [self.viewRegistry_DEPRECATED viewForReactTag:viewRef];
|
|
33
|
+
RNMBXImage *view = componentView.contentView;
|
|
34
|
+
|
|
35
|
+
#else
|
|
36
|
+
[self.bridge.uiManager
|
|
37
|
+
addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
38
|
+
RNMBXImage *view = [uiManager viewForReactTag:viewRef];
|
|
39
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
40
|
+
if (view != nil) {
|
|
41
|
+
block(view);
|
|
42
|
+
} else {
|
|
43
|
+
reject(methodName, [NSString stringWithFormat:@"Unknown reactTag: %@", viewRef], nil);
|
|
44
|
+
}
|
|
45
|
+
}];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
RCT_EXPORT_METHOD(refresh:(NSNumber*)viewRef resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
50
|
+
{
|
|
51
|
+
[self withImage:viewRef block:^(RNMBXImage *view) {
|
|
52
|
+
// TODO: implement refresh on iOS
|
|
53
|
+
// [view refresh];
|
|
54
|
+
} reject:reject methodName:@"refresh"];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
// Thanks to this guard, we won't compile this code when we build for the old architecture.
|
|
59
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
60
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
61
|
+
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
62
|
+
{
|
|
63
|
+
return std::make_shared<facebook::react::NativeRNMBXImageModuleSpecJSI>(params);
|
|
64
|
+
}
|
|
65
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
66
|
+
|
|
67
|
+
@end
|
|
@@ -16,17 +16,17 @@ func hasImage(style: Style, name: String) -> Bool {
|
|
|
16
16
|
typealias StyleImageMissingPayload = StyleImageMissing
|
|
17
17
|
#endif
|
|
18
18
|
|
|
19
|
-
class RNMBXImages : UIView, RNMBXMapComponent {
|
|
19
|
+
open class RNMBXImages : UIView, RNMBXMapComponent {
|
|
20
20
|
|
|
21
|
-
weak var bridge : RCTBridge! = nil
|
|
21
|
+
@objc public weak var bridge : RCTBridge! = nil
|
|
22
22
|
|
|
23
23
|
weak var style: Style? = nil
|
|
24
24
|
|
|
25
25
|
@objc
|
|
26
|
-
var onImageMissing: RCTBubblingEventBlock? = nil
|
|
26
|
+
public var onImageMissing: RCTBubblingEventBlock? = nil
|
|
27
27
|
|
|
28
28
|
@objc
|
|
29
|
-
var images : [String:Any] = [:] {
|
|
29
|
+
public var images : [String:Any] = [:] {
|
|
30
30
|
didSet {
|
|
31
31
|
updateImages(images: images, oldImages: oldValue)
|
|
32
32
|
}
|
|
@@ -37,7 +37,7 @@ class RNMBXImages : UIView, RNMBXMapComponent {
|
|
|
37
37
|
var imageViews: [RNMBXImage] = []
|
|
38
38
|
|
|
39
39
|
@objc
|
|
40
|
-
var nativeImages: [Any] = [] {
|
|
40
|
+
public var nativeImages: [Any] = [] {
|
|
41
41
|
didSet {
|
|
42
42
|
nativeImageInfos = nativeImages.compactMap { decodeImage($0) }
|
|
43
43
|
}
|
|
@@ -116,9 +116,9 @@ class RNMBXImages : UIView, RNMBXMapComponent {
|
|
|
116
116
|
if !sameImage(oldValue: oldImages[name], newValue: images[name]) {
|
|
117
117
|
missingImages[name] = images[name]
|
|
118
118
|
} else {
|
|
119
|
-
if
|
|
119
|
+
if hasImage(style: style, name: name) {
|
|
120
120
|
logged("RNMBXImages.addImagePlaceholder") {
|
|
121
|
-
try
|
|
121
|
+
try style.addImage(placeholderImage, id: name, stretchX: [], stretchY: [])
|
|
122
122
|
missingImages[name] = images[name]
|
|
123
123
|
}
|
|
124
124
|
}
|
|
@@ -137,7 +137,7 @@ class RNMBXImages : UIView, RNMBXMapComponent {
|
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
|
|
140
|
+
internal func addMissingImageToStyle(style: Style, imageName: String) -> Bool {
|
|
141
141
|
if let nativeImage = nativeImageInfos.first(where: { $0.name == imageName }) {
|
|
142
142
|
addNativeImages(style: style, nativeImages: [nativeImage])
|
|
143
143
|
return true
|
|
@@ -150,7 +150,7 @@ class RNMBXImages : UIView, RNMBXMapComponent {
|
|
|
150
150
|
return false
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
internal func sendImageMissingEvent(imageName: String, payload: StyleImageMissingPayload) {
|
|
154
154
|
let payload = ["imageKey":imageName]
|
|
155
155
|
let event = RNMBXEvent(type: .imageMissing, payload: payload)
|
|
156
156
|
if let onImageMissing = onImageMissing {
|
|
@@ -243,7 +243,7 @@ class RNMBXImages : UIView, RNMBXMapComponent {
|
|
|
243
243
|
func addNativeImages(style: Style, nativeImages: [NativeImageInfo]) {
|
|
244
244
|
for imageInfo in nativeImages {
|
|
245
245
|
let imageName = imageInfo.name
|
|
246
|
-
if
|
|
246
|
+
if hasImage(style: style, name:imageName) {
|
|
247
247
|
if let image = UIImage(named: imageName) {
|
|
248
248
|
logged("RNMBXImage.addNativeImage: \(imageName)") {
|
|
249
249
|
try style.addImage(image, id: imageName, sdf: imageInfo.sdf,
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
9
|
+
|
|
10
|
+
@interface RNMBXImagesComponentView : RCTViewComponentView
|
|
11
|
+
@end
|
|
12
|
+
|
|
13
|
+
NS_ASSUME_NONNULL_END
|
|
14
|
+
|
|
15
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
|
+
|
|
3
|
+
#import "RNMBXImagesComponentView.h"
|
|
4
|
+
#import "RNMBXFabricHelpers.h"
|
|
5
|
+
|
|
6
|
+
#import <React/RCTBridge+Private.h>
|
|
7
|
+
#import <React/RCTConversions.h>
|
|
8
|
+
#import <React/RCTFabricComponentsPlugins.h>
|
|
9
|
+
|
|
10
|
+
#import <react/renderer/components/rnmapbox_maps_specs/ComponentDescriptors.h>
|
|
11
|
+
#import <react/renderer/components/rnmapbox_maps_specs/EventEmitters.h>
|
|
12
|
+
#import <react/renderer/components/rnmapbox_maps_specs/Props.h>
|
|
13
|
+
#import <react/renderer/components/rnmapbox_maps_specs/RCTComponentViewHelpers.h>
|
|
14
|
+
|
|
15
|
+
using namespace facebook::react;
|
|
16
|
+
|
|
17
|
+
@interface RNMBXImagesComponentView () <RCTRNMBXImagesViewProtocol>
|
|
18
|
+
@end
|
|
19
|
+
|
|
20
|
+
@implementation RNMBXImagesComponentView {
|
|
21
|
+
RNMBXImages *_view;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
- (instancetype)initWithFrame:(CGRect)frame
|
|
25
|
+
{
|
|
26
|
+
if (self = [super initWithFrame:frame]) {
|
|
27
|
+
static const auto defaultProps = std::make_shared<const RNMBXImagesProps>();
|
|
28
|
+
_props = defaultProps;
|
|
29
|
+
[self prepareView];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return self;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
- (void)prepareView
|
|
36
|
+
{
|
|
37
|
+
_view = [[RNMBXImages alloc] init];
|
|
38
|
+
_view.bridge = [RCTBridge currentBridge];
|
|
39
|
+
|
|
40
|
+
// capture weak self reference to prevent retain cycle
|
|
41
|
+
__weak __typeof__(self) weakSelf = self;
|
|
42
|
+
|
|
43
|
+
[_view setOnImageMissing:^(NSDictionary* event) {
|
|
44
|
+
__typeof__(self) strongSelf = weakSelf;
|
|
45
|
+
|
|
46
|
+
if (strongSelf != nullptr && strongSelf->_eventEmitter != nullptr) {
|
|
47
|
+
std::string type = [event valueForKey:@"type"] == nil ? "" : std::string([[event valueForKey:@"type"] UTF8String]);
|
|
48
|
+
std::string imageKey = (![[event valueForKey:@"payload"] isKindOfClass:[NSDictionary class]] || ![[[event valueForKey:@"payload"] valueForKey:@"imageKey"] isKindOfClass:[NSString class]]) ? "" : std::string([((NSDictionary *)event[@"payload"])[@"imageKey"] UTF8String]);
|
|
49
|
+
facebook::react::RNMBXImagesEventEmitter::OnImageMissingPayload payload = {.imageKey = imageKey};
|
|
50
|
+
std::dynamic_pointer_cast<const facebook::react::RNMBXImagesEventEmitter>(strongSelf->_eventEmitter)->onImageMissing({type, payload});
|
|
51
|
+
}
|
|
52
|
+
}];
|
|
53
|
+
self.contentView = _view;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
- (void)prepareForRecycle
|
|
57
|
+
{
|
|
58
|
+
[super prepareForRecycle];
|
|
59
|
+
[self prepareView];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
#pragma mark - RCTComponentViewProtocol
|
|
63
|
+
|
|
64
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider
|
|
65
|
+
{
|
|
66
|
+
return concreteComponentDescriptorProvider<RNMBXImagesComponentDescriptor>();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
- (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps
|
|
70
|
+
{
|
|
71
|
+
const auto &newProps = *std::static_pointer_cast<const RNMBXImagesProps>(props);
|
|
72
|
+
id images = RNMBXConvertFollyDynamicToId(newProps.images);
|
|
73
|
+
if (images != nil) {
|
|
74
|
+
_view.images = images;
|
|
75
|
+
}
|
|
76
|
+
id nativeImages = RNMBXConvertFollyDynamicToId(newProps.nativeImages);
|
|
77
|
+
if (nativeImages != nil) {
|
|
78
|
+
_view.nativeImages = nativeImages;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
[super updateProps:props oldProps:oldProps];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@end
|
|
85
|
+
|
|
86
|
+
Class<RCTComponentViewProtocol> RNMBXImagesCls(void)
|
|
87
|
+
{
|
|
88
|
+
return RNMBXImagesComponentView.class;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
#import <React/RCTBridgeModule.h>
|
|
2
2
|
#import <React/RCTViewManager.h>
|
|
3
3
|
|
|
4
|
-
@interface
|
|
4
|
+
@interface RCT_EXTERN_REMAP_MODULE(RNMBXImages, RNMBXImagesViewManager, RCTViewManager)
|
|
5
5
|
|
|
6
|
-
RCT_EXPORT_VIEW_PROPERTY(id, NSString)
|
|
7
6
|
RCT_EXPORT_VIEW_PROPERTY(images, NSDictionary)
|
|
8
7
|
RCT_EXPORT_VIEW_PROPERTY(nativeImages, NSArray)
|
|
9
8
|
RCT_REMAP_VIEW_PROPERTY(onImageMissing, onImageMissing, RCTBubblingEventBlock)
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import MapboxMaps
|
|
2
2
|
|
|
3
3
|
#if RNMBX_11
|
|
4
4
|
typealias Light = FlatLight
|
|
5
5
|
#endif
|
|
6
6
|
|
|
7
7
|
@objc(RNMBXLight)
|
|
8
|
-
class RNMBXLight: UIView, RNMBXMapComponent {
|
|
9
|
-
weak var bridge : RCTBridge! = nil
|
|
8
|
+
public class RNMBXLight: UIView, RNMBXMapComponent {
|
|
9
|
+
@objc public weak var bridge : RCTBridge! = nil
|
|
10
10
|
weak var map: MapboxMap! = nil
|
|
11
11
|
var oldReactStyle: [String:Any]?
|
|
12
|
-
@objc var reactStyle : [String:Any]! = nil {
|
|
12
|
+
@objc public var reactStyle : [String:Any]! = nil {
|
|
13
13
|
willSet {
|
|
14
14
|
oldReactStyle = reactStyle
|
|
15
15
|
}
|
|
@@ -21,13 +21,13 @@ class RNMBXLight: UIView, RNMBXMapComponent {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
func apply(light: Light) {
|
|
24
|
+
let lightData = try! JSONEncoder().encode(light)
|
|
25
|
+
let lightDictionary = try! JSONSerialization.jsonObject(with: lightData)
|
|
24
26
|
logged("RNMBXLight.apply") {
|
|
25
27
|
#if RNMBX_11
|
|
26
28
|
try self.map.setLights(light)
|
|
27
29
|
#else
|
|
28
|
-
|
|
29
|
-
let lightDictionary = try JSONSerialization.jsonObject(with: lightData)
|
|
30
|
-
try self.map.style.setLight(properties: lightDictionary as! [String:Any])
|
|
30
|
+
try! self.map.style.setLight(properties: lightDictionary as! [String:Any])
|
|
31
31
|
#endif
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
9
|
+
|
|
10
|
+
@interface RNMBXLightComponentView : RCTViewComponentView
|
|
11
|
+
@end
|
|
12
|
+
|
|
13
|
+
NS_ASSUME_NONNULL_END
|
|
14
|
+
|
|
15
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
|
+
|
|
3
|
+
#import "RNMBXLightComponentView.h"
|
|
4
|
+
#import "RNMBXFabricHelpers.h"
|
|
5
|
+
|
|
6
|
+
#import <React/RCTBridge+Private.h>
|
|
7
|
+
#import <React/RCTConversions.h>
|
|
8
|
+
#import <React/RCTFabricComponentsPlugins.h>
|
|
9
|
+
|
|
10
|
+
#import <react/renderer/components/rnmapbox_maps_specs/ComponentDescriptors.h>
|
|
11
|
+
#import <react/renderer/components/rnmapbox_maps_specs/EventEmitters.h>
|
|
12
|
+
#import <react/renderer/components/rnmapbox_maps_specs/Props.h>
|
|
13
|
+
#import <react/renderer/components/rnmapbox_maps_specs/RCTComponentViewHelpers.h>
|
|
14
|
+
|
|
15
|
+
using namespace facebook::react;
|
|
16
|
+
|
|
17
|
+
@interface RNMBXLightComponentView () <RCTRNMBXLightViewProtocol>
|
|
18
|
+
@end
|
|
19
|
+
|
|
20
|
+
@implementation RNMBXLightComponentView {
|
|
21
|
+
RNMBXLight *_view;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
- (instancetype)initWithFrame:(CGRect)frame
|
|
25
|
+
{
|
|
26
|
+
if (self = [super initWithFrame:frame]) {
|
|
27
|
+
static const auto defaultProps = std::make_shared<const RNMBXLightProps>();
|
|
28
|
+
_props = defaultProps;
|
|
29
|
+
[self prepareView];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return self;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
- (void)prepareView
|
|
36
|
+
{
|
|
37
|
+
_view = [[RNMBXLight alloc] init];
|
|
38
|
+
_view.bridge = [RCTBridge currentBridge];
|
|
39
|
+
self.contentView = _view;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#pragma mark - RCTComponentViewProtocol
|
|
43
|
+
|
|
44
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider
|
|
45
|
+
{
|
|
46
|
+
return concreteComponentDescriptorProvider<RNMBXLightComponentDescriptor>();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
- (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps
|
|
51
|
+
{
|
|
52
|
+
const auto &newProps = *std::static_pointer_cast<const RNMBXLightProps>(props);
|
|
53
|
+
id reactStyle = RNMBXConvertFollyDynamicToId(newProps.reactStyle);
|
|
54
|
+
if (reactStyle != nil) {
|
|
55
|
+
_view.reactStyle = reactStyle;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
[super updateProps:props oldProps:oldProps];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@end
|
|
62
|
+
|
|
63
|
+
Class<RCTComponentViewProtocol> RNMBXLightCls(void)
|
|
64
|
+
{
|
|
65
|
+
return RNMBXLightComponentView.class;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
#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(RNMBXLight, RNMBXLightViewManager, RCTViewManager)
|
|
5
5
|
|
|
6
6
|
// light props
|
|
7
7
|
RCT_EXPORT_VIEW_PROPERTY(reactStyle, NSDictionary);
|
|
@@ -31,7 +31,8 @@ class RNMBXMarkerViewParentViewAnnotation : UIView {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
@objc(RNMBXMarkerView)
|
|
35
|
+
public class RNMBXMarkerView: UIView, RNMBXMapComponent {
|
|
35
36
|
// MARK: - Instance variables
|
|
36
37
|
|
|
37
38
|
static let key = "RNMBXMarkerView"
|
|
@@ -42,25 +43,25 @@ class RNMBXMarkerView: UIView, RNMBXMapComponent {
|
|
|
42
43
|
|
|
43
44
|
var didAddToMap = false
|
|
44
45
|
|
|
45
|
-
@objc var coordinate: String? {
|
|
46
|
+
@objc public var coordinate: String? {
|
|
46
47
|
didSet {
|
|
47
48
|
update()
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
@objc var anchor: [String: NSNumber]? {
|
|
52
|
+
@objc public var anchor: [String: NSNumber]? {
|
|
52
53
|
didSet {
|
|
53
54
|
update()
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
@objc var allowOverlap: Bool = false {
|
|
58
|
+
@objc public var allowOverlap: Bool = false {
|
|
58
59
|
didSet {
|
|
59
60
|
update()
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
|
|
63
|
-
@objc var isSelected: Bool = false {
|
|
64
|
+
@objc public var isSelected: Bool = false {
|
|
64
65
|
didSet {
|
|
65
66
|
update()
|
|
66
67
|
}
|
|
@@ -115,7 +116,7 @@ class RNMBXMarkerView: UIView, RNMBXMapComponent {
|
|
|
115
116
|
|
|
116
117
|
// MARK: - React methods
|
|
117
118
|
|
|
118
|
-
|
|
119
|
+
public override var isHidden: Bool {
|
|
119
120
|
get {
|
|
120
121
|
return super.isHidden
|
|
121
122
|
}
|
|
@@ -124,7 +125,7 @@ class RNMBXMarkerView: UIView, RNMBXMapComponent {
|
|
|
124
125
|
}
|
|
125
126
|
}
|
|
126
127
|
|
|
127
|
-
|
|
128
|
+
public override func reactSetFrame(_ frame: CGRect) {
|
|
128
129
|
let prev = self.frame
|
|
129
130
|
var next = frame
|
|
130
131
|
|
|
@@ -140,18 +141,24 @@ class RNMBXMarkerView: UIView, RNMBXMapComponent {
|
|
|
140
141
|
|
|
141
142
|
super.reactSetFrame(next)
|
|
142
143
|
if frameDidChange {
|
|
143
|
-
|
|
144
|
+
updateAnnotationViewSize(next, prev)
|
|
144
145
|
}
|
|
145
146
|
addOrUpdate()
|
|
146
147
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
|
|
149
|
+
public override func insertReactSubview(_ subview: UIView, at atIndex: Int) {
|
|
150
|
+
super.insertReactSubview(subview, at: atIndex)
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
public override func removeReactSubview(_ subview: UIView) {
|
|
154
|
+
super.removeReactSubview(subview)
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
@objc public func updateAnnotationViewSize(_ next: CGRect, _ prev: CGRect) {
|
|
158
|
+
annotationView.updateSize(next.size, oldOffset:calcOffset(size: prev.size), newOffset: calcOffset(size: next.size))
|
|
150
159
|
}
|
|
151
160
|
|
|
152
|
-
|
|
153
|
-
super.removeReactSubview(subview)
|
|
154
|
-
}
|
|
161
|
+
|
|
155
162
|
|
|
156
163
|
func waitForStyleLoad() -> Bool {
|
|
157
164
|
true
|
|
@@ -159,7 +166,7 @@ class RNMBXMarkerView: UIView, RNMBXMapComponent {
|
|
|
159
166
|
|
|
160
167
|
// MARK: - Create, update, and remove methods
|
|
161
168
|
|
|
162
|
-
|
|
169
|
+
@objc public func addOrUpdate() {
|
|
163
170
|
if didAddToMap {
|
|
164
171
|
update()
|
|
165
172
|
} else {
|
|
@@ -253,7 +260,7 @@ class RNMBXMarkerView: UIView, RNMBXMapComponent {
|
|
|
253
260
|
return result
|
|
254
261
|
}
|
|
255
262
|
|
|
256
|
-
|
|
263
|
+
@objc public override func didMoveToSuperview() {
|
|
257
264
|
// React tends to add back us to our original superview,
|
|
258
265
|
// https://github.com/facebook/react-native/blob/11ece22fc6955d169def9ef9f2809c24bc457ba8/React/Views/UIView%2BReact.m#L172-L177
|
|
259
266
|
// fix that if we see that
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
9
|
+
|
|
10
|
+
@interface RNMBXMarkerViewComponentView : RCTViewComponentView
|
|
11
|
+
@end
|
|
12
|
+
|
|
13
|
+
NS_ASSUME_NONNULL_END
|
|
14
|
+
|
|
15
|
+
#endif // RCT_NEW_ARCH_ENABLED
|