@rnmapbox/maps 10.1.0-beta.14 → 10.1.0-beta.18
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 +2 -1
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/rnmapbox/rnmbx/RNMBXPackage.kt +25 -6
- 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/RNMBXPointAnnotation.kt +5 -0
- package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXPointAnnotationManager.kt +83 -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/RNMBXImage.kt +5 -0
- package/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImageManager.kt +25 -22
- 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 +5 -2
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXShapeSourceManager.kt +45 -32
- 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 +3 -1
- package/ios/RNMBX/RNMBXBackgroundLayerComponentView.mm +1 -1
- 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/RNMBXCamera.swift +4 -4
- package/ios/RNMBX/RNMBXCameraComponentView.mm +1 -1
- package/ios/RNMBX/RNMBXCircleLayerComponentView.mm +1 -1
- package/ios/RNMBX/RNMBXFabricHelpers.h +1 -8
- package/ios/RNMBX/RNMBXFillExtrusionLayerComponentView.mm +1 -1
- package/ios/RNMBX/RNMBXFillLayerComponentView.mm +1 -1
- package/ios/RNMBX/RNMBXHeatmapLayerComponentView.mm +1 -1
- 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/RNMBXImageSourceComponentView.mm +1 -1
- package/ios/RNMBX/RNMBXImages.swift +9 -9
- 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/RNMBXLineLayerComponentView.mm +1 -1
- package/ios/RNMBX/RNMBXMapView.swift +326 -136
- package/ios/RNMBX/RNMBXMapViewComponentView.mm +1 -2
- package/ios/RNMBX/RNMBXMarkerView.swift +24 -17
- package/ios/RNMBX/RNMBXMarkerViewComponentView.h +15 -0
- package/ios/RNMBX/RNMBXMarkerViewComponentView.mm +130 -0
- package/ios/RNMBX/RNMBXNativeUserLocation.swift +12 -10
- 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 +1 -3
- package/ios/RNMBX/RNMBXRasterLayerComponentView.mm +1 -1
- package/ios/RNMBX/RNMBXRasterSourceComponentView.h +1 -3
- package/ios/RNMBX/RNMBXRasterSourceComponentView.mm +1 -3
- package/ios/RNMBX/RNMBXShapeSourceComponentView.h +1 -3
- package/ios/RNMBX/RNMBXShapeSourceComponentView.mm +5 -7
- package/ios/RNMBX/RNMBXShapeSourceModule.mm +1 -9
- package/ios/RNMBX/RNMBXSingletonLayer.swift +1 -1
- package/ios/RNMBX/RNMBXSkyLayerComponentView.mm +1 -1
- package/ios/RNMBX/RNMBXSymbolLayerComponentView.mm +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 +1 -3
- package/ios/RNMBX/Uitls/PropertyChanges.swift +58 -0
- 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 +2 -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
|
@@ -2,14 +2,7 @@
|
|
|
2
2
|
#import <folly/dynamic.h>
|
|
3
3
|
#import <react/renderer/components/rnmapbox_maps_specs/Props.h>
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
#import <CoreFoundation/CoreFoundation.h>
|
|
7
|
-
#import <CoreLocation/CoreLocation.h>
|
|
8
|
-
|
|
9
|
-
@interface MapView : UIView
|
|
10
|
-
@end
|
|
11
|
-
|
|
12
|
-
#import <rnmapbox_maps-Swift.h>
|
|
5
|
+
#import "rnmapbox_maps-Swift.pre.h"
|
|
13
6
|
|
|
14
7
|
// copied from RCTFollyConvert
|
|
15
8
|
static id RNMBXConvertFollyDynamicToId(const folly::dynamic &dyn)
|
|
@@ -48,7 +48,7 @@ using namespace facebook::react;
|
|
|
48
48
|
|
|
49
49
|
- (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps
|
|
50
50
|
{
|
|
51
|
-
const auto &newProps =
|
|
51
|
+
const auto &newProps = static_cast<const RNMBXFillExtrusionLayerProps &>(*props);
|
|
52
52
|
RNMBXSetCommonLayerProps(newProps, _view);
|
|
53
53
|
|
|
54
54
|
|
|
@@ -48,7 +48,7 @@ using namespace facebook::react;
|
|
|
48
48
|
|
|
49
49
|
- (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps
|
|
50
50
|
{
|
|
51
|
-
const auto &newProps =
|
|
51
|
+
const auto &newProps = static_cast<const RNMBXFillLayerProps &>(*props);
|
|
52
52
|
RNMBXSetCommonLayerProps(newProps, _view);
|
|
53
53
|
|
|
54
54
|
[super updateProps:props oldProps:oldProps];
|
|
@@ -47,7 +47,7 @@ using namespace facebook::react;
|
|
|
47
47
|
|
|
48
48
|
- (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps
|
|
49
49
|
{
|
|
50
|
-
const auto &newProps =
|
|
50
|
+
const auto &newProps = static_cast<const RNMBXHeatmapLayerProps &>(*props);
|
|
51
51
|
RNMBXSetCommonLayerProps(newProps, _view);
|
|
52
52
|
|
|
53
53
|
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import MapboxMaps
|
|
2
2
|
|
|
3
|
-
class RNMBXImage : UIView {
|
|
3
|
+
public class RNMBXImage : UIView {
|
|
4
4
|
@objc
|
|
5
|
-
var name: String = "" {
|
|
5
|
+
public var name: String = "" {
|
|
6
6
|
didSet {
|
|
7
7
|
_addImageToStyle()
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
var image: UIImage? = nil
|
|
11
|
+
@objc public var image: UIImage? = nil
|
|
12
12
|
|
|
13
13
|
@objc
|
|
14
|
-
|
|
14
|
+
public var sdf: Bool = false {
|
|
15
15
|
didSet {
|
|
16
16
|
_addImageToStyle()
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
@objc
|
|
21
|
-
|
|
21
|
+
public var stretchX: [[NSNumber]] = [] {
|
|
22
22
|
didSet {
|
|
23
23
|
_addImageToStyle()
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
@objc
|
|
28
|
-
|
|
28
|
+
public var stretchY: [[NSNumber]] = [] {
|
|
29
29
|
didSet {
|
|
30
30
|
_addImageToStyle()
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
@objc
|
|
35
|
-
|
|
35
|
+
public var content: [NSNumber]? = nil {
|
|
36
36
|
didSet {
|
|
37
37
|
_addImageToStyle()
|
|
38
38
|
}
|
|
@@ -43,28 +43,36 @@ class RNMBXImage : UIView {
|
|
|
43
43
|
DispatchQueue.main.async { self.setImage() }
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
weak var bridge : RCTBridge! = nil
|
|
47
46
|
|
|
48
|
-
|
|
47
|
+
var reactSubviews : [UIView] = []
|
|
49
48
|
|
|
50
49
|
// MARK: - subview management
|
|
51
50
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
public override func insertReactSubview(_ subview: UIView!, at atIndex: Int) {
|
|
52
|
+
insertReactSubviewInternal(subview, at: atIndex)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@objc public func insertReactSubviewInternal(_ subview: UIView!, at atIndex: Int) {
|
|
56
|
+
reactSubviews.insert(subview, at: atIndex)
|
|
57
|
+
if reactSubviews.count > 1 {
|
|
58
|
+
Logger.log(level: .error, message: "Image supports max 1 subview")
|
|
59
|
+
}
|
|
60
|
+
if image == nil {
|
|
61
|
+
DispatchQueue.main.asyncAfter(deadline: .now() + .microseconds(10)) {
|
|
62
|
+
self.setImage()
|
|
63
|
+
}
|
|
60
64
|
}
|
|
61
65
|
}
|
|
62
|
-
}
|
|
63
66
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
|
|
68
|
+
public override func removeReactSubview(_ subview: UIView!) {
|
|
69
|
+
removeReactSubviewInternal(subview)
|
|
67
70
|
}
|
|
71
|
+
|
|
72
|
+
@objc
|
|
73
|
+
open func removeReactSubviewInternal(_ subview: UIView!) {
|
|
74
|
+
reactSubviews.removeAll(where: { $0 == subview })
|
|
75
|
+
}
|
|
68
76
|
|
|
69
77
|
// MARK: - view shnapshot
|
|
70
78
|
|
|
@@ -79,7 +87,7 @@ class RNMBXImage : UIView {
|
|
|
79
87
|
_addImageToStyle()
|
|
80
88
|
}
|
|
81
89
|
|
|
82
|
-
func setImage() {
|
|
90
|
+
@objc public func setImage() {
|
|
83
91
|
if let image = _createViewSnapshot() {
|
|
84
92
|
changeImage(image, name: name)
|
|
85
93
|
}
|
|
@@ -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 RNMBXImageComponentView : RCTViewComponentView
|
|
11
|
+
@end
|
|
12
|
+
|
|
13
|
+
NS_ASSUME_NONNULL_END
|
|
14
|
+
|
|
15
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -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 = static_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
|
|
@@ -70,7 +70,7 @@ using namespace facebook::react;
|
|
|
70
70
|
|
|
71
71
|
- (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps
|
|
72
72
|
{
|
|
73
|
-
const auto &newProps =
|
|
73
|
+
const auto &newProps = static_cast<const RNMBXImageSourceProps &>(*props);
|
|
74
74
|
id idx = RNMBXConvertFollyDynamicToId(newProps.id);
|
|
75
75
|
if (idx != nil) {
|
|
76
76
|
_view.id = idx;
|
|
@@ -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
|
}
|
|
@@ -118,7 +118,7 @@ class RNMBXImages : UIView, RNMBXMapComponent {
|
|
|
118
118
|
} else {
|
|
119
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 = static_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
|