@maplibre/maplibre-react-native 11.0.0-alpha.7 → 11.0.0-alpha.9
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/MapLibreReactNative.podspec +1 -1
- package/android/build.gradle +0 -3
- package/android/src/main/java/org/maplibre/reactnative/MLRNPackage.kt +43 -0
- package/android/src/main/java/org/maplibre/reactnative/components/AbstractEvent.kt +24 -0
- package/android/src/main/java/org/maplibre/reactnative/components/AbstractEventEmitter.kt +71 -0
- package/android/src/main/java/org/maplibre/reactnative/components/annotation/MLRNPointAnnotation.java +1 -1
- package/android/src/main/java/org/maplibre/reactnative/components/camera/CameraStop.kt +203 -0
- package/android/src/main/java/org/maplibre/reactnative/components/camera/CameraUpdateItem.kt +109 -0
- package/android/src/main/java/org/maplibre/reactnative/components/camera/CameraUpdateQueue.kt +60 -0
- package/android/src/main/java/org/maplibre/reactnative/components/camera/MLRNCamera.kt +409 -0
- package/android/src/main/java/org/maplibre/reactnative/components/camera/MLRNCameraManager.kt +69 -0
- package/android/src/main/java/org/maplibre/reactnative/components/camera/MLRNCameraModule.kt +34 -0
- package/android/src/main/java/org/maplibre/reactnative/components/camera/constants/CameraEasing.kt +24 -0
- package/android/src/main/java/org/maplibre/reactnative/components/images/MLRNImages.java +1 -2
- package/android/src/main/java/org/maplibre/reactnative/components/location/LocationComponentManager.java +1 -1
- package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNAndroidTextureMapView.kt +23 -0
- package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNAndroidTextureMapViewManager.kt +23 -0
- package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapView.kt +1338 -0
- package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapViewManager.kt +187 -0
- package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapViewModule.kt +159 -0
- package/android/src/main/java/org/maplibre/reactnative/components/mapview/helpers/CameraChangeTracker.kt +26 -0
- package/android/src/main/java/org/maplibre/reactnative/components/mapview/helpers/LayerSourceInfo.kt +74 -0
- package/android/src/main/java/org/maplibre/reactnative/components/styles/layers/MLRNLayer.java +1 -5
- package/android/src/main/java/org/maplibre/reactnative/components/styles/light/MLRNLight.java +1 -6
- package/android/src/main/java/org/maplibre/reactnative/components/styles/sources/MLRNShapeSource.java +2 -9
- package/android/src/main/java/org/maplibre/reactnative/components/styles/sources/MLRNSource.java +1 -1
- package/android/src/main/java/org/maplibre/reactnative/events/AbstractEvent.java +2 -5
- package/android/src/main/java/org/maplibre/reactnative/events/MapChangeEvent.kt +18 -0
- package/android/src/main/java/org/maplibre/reactnative/events/MapClickEvent.java +4 -0
- package/android/src/main/java/org/maplibre/reactnative/events/MapPressEvent.kt +27 -0
- package/android/src/main/java/org/maplibre/reactnative/events/TrackUserLocationChangeEvent.kt +24 -0
- package/android/src/main/java/org/maplibre/reactnative/events/constants/EventKeys.java +0 -1
- package/android/src/main/java/org/maplibre/reactnative/events/constants/EventTypes.java +0 -19
- package/android/src/main/java/org/maplibre/reactnative/location/LocationManager.java +1 -1
- package/android/src/main/java/org/maplibre/reactnative/location/TrackUserLocationMode.kt +43 -0
- package/android/src/main/java/org/maplibre/reactnative/location/{UserTrackingState.java → TrackUserLocationState.java} +1 -1
- package/android/src/main/java/org/maplibre/reactnative/location/UserLocation.java +1 -1
- package/android/src/main/java/org/maplibre/reactnative/modules/MLRNModule.java +1 -49
- package/android/src/main/java/org/maplibre/reactnative/utils/ConvertUtils.java +2 -9
- package/android/src/main/java/org/maplibre/reactnative/utils/GeoJSONUtils.kt +322 -0
- package/android/src/main/java/org/maplibre/reactnative/utils/ReactTagResolver.kt +85 -0
- package/ios/MLRNCallout.h +1 -1
- package/ios/MLRNEvent.m +3 -1
- package/ios/MLRNEventTypes.h +10 -31
- package/ios/MLRNEventTypes.m +10 -30
- package/ios/MLRNImages.h +1 -1
- package/ios/MLRNImages.m +1 -1
- package/ios/MLRNLayer.h +1 -1
- package/ios/MLRNLayer.m +2 -2
- package/ios/MLRNLight.h +2 -1
- package/ios/MLRNLocationModule.m +2 -2
- package/ios/MLRNMapTouchEvent.h +2 -1
- package/ios/MLRNMapTouchEvent.m +12 -10
- package/ios/MLRNModule.m +5 -52
- package/ios/MLRNNativeUserLocation.m +0 -1
- package/ios/MLRNOfflineModule.h +2 -2
- package/ios/MLRNOfflineModule.m +9 -9
- package/ios/MLRNPointAnnotation.h +1 -1
- package/ios/MLRNShapeSource.h +1 -1
- package/ios/MLRNSource.h +3 -1
- package/ios/MLRNStyle.m +20 -20
- package/ios/MLRNUtils.h +17 -2
- package/ios/MLRNUtils.m +25 -2
- package/ios/components/camera/CameraEasing.h +8 -0
- package/ios/{CameraStop.h → components/camera/CameraStop.h} +10 -6
- package/ios/components/camera/CameraStop.m +75 -0
- package/ios/{CameraUpdateItem.m → components/camera/CameraUpdateItem.m} +45 -46
- package/ios/components/camera/MLRNCamera.h +26 -0
- package/ios/components/camera/MLRNCamera.m +195 -0
- package/ios/components/camera/MLRNCameraComponentView.h +18 -0
- package/ios/components/camera/MLRNCameraComponentView.mm +192 -0
- package/ios/components/camera/MLRNCameraManager.h +11 -0
- package/ios/components/camera/MLRNCameraManager.m +20 -0
- package/ios/components/camera/MLRNCameraModule.h +4 -0
- package/ios/components/camera/MLRNCameraModule.mm +111 -0
- package/ios/{MLRNMapView.h → components/map-view/MLRNMapView.h} +42 -20
- package/ios/components/map-view/MLRNMapView.m +809 -0
- package/ios/components/map-view/MLRNMapViewComponentView.h +18 -0
- package/ios/components/map-view/MLRNMapViewComponentView.mm +400 -0
- package/ios/components/map-view/MLRNMapViewManager.h +70 -0
- package/ios/components/map-view/MLRNMapViewManager.m +163 -0
- package/ios/components/map-view/MLRNMapViewModule.h +4 -0
- package/ios/components/map-view/MLRNMapViewModule.mm +249 -0
- package/ios/{MLRNSnapshotModule → modules/snapshot}/MLRNSnapshotModule.mm +0 -1
- package/lib/commonjs/MLRNModule.js +1 -3
- package/lib/commonjs/MLRNModule.js.map +1 -1
- package/lib/commonjs/components/Annotation.js +1 -13
- package/lib/commonjs/components/Annotation.js.map +1 -1
- package/lib/commonjs/components/Images.js.map +1 -1
- package/lib/commonjs/components/ShapeSource.js +2 -21
- package/lib/commonjs/components/ShapeSource.js.map +1 -1
- package/lib/commonjs/components/VectorSource.js +3 -26
- package/lib/commonjs/components/VectorSource.js.map +1 -1
- package/lib/commonjs/components/camera/Camera.js +97 -0
- package/lib/commonjs/components/camera/Camera.js.map +1 -0
- package/lib/commonjs/components/camera/CameraNativeComponent.ts +61 -0
- package/lib/commonjs/components/camera/NativeCameraModule.js +11 -0
- package/lib/commonjs/components/camera/NativeCameraModule.js.map +1 -0
- package/lib/commonjs/components/map-view/MapView.js +115 -0
- package/lib/commonjs/components/map-view/MapView.js.map +1 -0
- package/lib/commonjs/components/map-view/MapViewNativeComponent.ts +96 -0
- package/lib/commonjs/components/map-view/NativeMapViewModule.js +9 -0
- package/lib/commonjs/components/map-view/NativeMapViewModule.js.map +1 -0
- package/lib/commonjs/index.js +246 -4
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/modules/snapshot/NativeSnapshotModule.js +2 -2
- package/lib/commonjs/modules/snapshot/NativeSnapshotModule.js.map +1 -1
- package/lib/commonjs/modules/snapshot/SnapshotManager.js +3 -2
- package/lib/commonjs/modules/snapshot/SnapshotManager.js.map +1 -1
- package/lib/commonjs/types/Bounds.js +2 -0
- package/lib/commonjs/types/{OnPressEvent.js.map → Bounds.js.map} +1 -1
- package/lib/commonjs/types/PressEvent.js +2 -0
- package/lib/{module/types/OnPressEvent.js.map → commonjs/types/PressEvent.js.map} +1 -1
- package/lib/commonjs/types/ViewPadding.js +2 -0
- package/lib/commonjs/types/{MapLibreRNEvent.js.map → ViewPadding.js.map} +1 -1
- package/lib/commonjs/types/codegen/UnsafeMixed.js +2 -0
- package/lib/commonjs/types/codegen/UnsafeMixed.js.map +1 -0
- package/lib/commonjs/utils/index.js +0 -11
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/module/MLRNModule.js +0 -1
- package/lib/module/MLRNModule.js.map +1 -1
- package/lib/module/components/Annotation.js +2 -14
- package/lib/module/components/Annotation.js.map +1 -1
- package/lib/module/components/Images.js.map +1 -1
- package/lib/module/components/ShapeSource.js +3 -22
- package/lib/module/components/ShapeSource.js.map +1 -1
- package/lib/module/components/VectorSource.js +4 -27
- package/lib/module/components/VectorSource.js.map +1 -1
- package/lib/module/components/camera/Camera.js +92 -0
- package/lib/module/components/camera/Camera.js.map +1 -0
- package/lib/module/components/camera/CameraNativeComponent.ts +61 -0
- package/lib/module/components/camera/NativeCameraModule.js +10 -0
- package/lib/module/components/camera/NativeCameraModule.js.map +1 -0
- package/lib/module/components/map-view/MapView.js +110 -0
- package/lib/module/components/map-view/MapView.js.map +1 -0
- package/lib/module/components/map-view/MapViewNativeComponent.ts +96 -0
- package/lib/module/components/map-view/NativeMapViewModule.js +5 -0
- package/lib/module/components/map-view/NativeMapViewModule.js.map +1 -0
- package/lib/module/index.js +30 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/modules/snapshot/NativeSnapshotModule.js +1 -1
- package/lib/module/modules/snapshot/NativeSnapshotModule.js.map +1 -1
- package/lib/module/modules/snapshot/SnapshotManager.js +1 -1
- package/lib/module/modules/snapshot/SnapshotManager.js.map +1 -1
- package/lib/module/types/Bounds.js +2 -0
- package/lib/module/types/{MapLibreRNEvent.js.map → Bounds.js.map} +1 -1
- package/lib/module/types/PressEvent.js +2 -0
- package/lib/module/types/PressEvent.js.map +1 -0
- package/lib/module/types/ViewPadding.js +2 -0
- package/lib/module/types/ViewPadding.js.map +1 -0
- package/lib/module/types/codegen/UnsafeMixed.js +2 -0
- package/lib/module/types/codegen/UnsafeMixed.js.map +1 -0
- package/lib/module/utils/index.js +0 -9
- package/lib/module/utils/index.js.map +1 -1
- package/lib/typescript/commonjs/src/MLRNModule.d.ts +1 -7
- package/lib/typescript/commonjs/src/MLRNModule.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Annotation.d.ts +3 -3
- package/lib/typescript/commonjs/src/components/Annotation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Images.d.ts +1 -2
- package/lib/typescript/commonjs/src/components/Images.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/ShapeSource.d.ts +2 -5
- package/lib/typescript/commonjs/src/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/VectorSource.d.ts +3 -2
- package/lib/typescript/commonjs/src/components/VectorSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/camera/Camera.d.ts +180 -0
- package/lib/typescript/commonjs/src/components/camera/Camera.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/camera/CameraNativeComponent.d.ts +37 -0
- package/lib/typescript/commonjs/src/components/camera/CameraNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/camera/NativeCameraModule.d.ts +27 -0
- package/lib/typescript/commonjs/src/components/camera/NativeCameraModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/map-view/MapView.d.ts +323 -0
- package/lib/typescript/commonjs/src/components/map-view/MapView.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/map-view/MapViewNativeComponent.d.ts +69 -0
- package/lib/typescript/commonjs/src/components/map-view/MapViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/map-view/NativeMapViewModule.d.ts +45 -0
- package/lib/typescript/commonjs/src/components/map-view/NativeMapViewModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +41 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/snapshot/NativeSnapshotModule.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/snapshot/NativeSnapshotModule.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/Bounds.d.ts +2 -0
- package/lib/typescript/commonjs/src/types/Bounds.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/PressEvent.d.ts +16 -0
- package/lib/typescript/commonjs/src/types/PressEvent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/ViewPadding.d.ts +7 -0
- package/lib/typescript/commonjs/src/types/ViewPadding.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/codegen/UnsafeMixed.d.ts +10 -0
- package/lib/typescript/commonjs/src/types/codegen/UnsafeMixed.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/index.d.ts +1 -3
- package/lib/typescript/commonjs/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/module/src/MLRNModule.d.ts +1 -7
- package/lib/typescript/module/src/MLRNModule.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Annotation.d.ts +3 -3
- package/lib/typescript/module/src/components/Annotation.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Images.d.ts +1 -2
- package/lib/typescript/module/src/components/Images.d.ts.map +1 -1
- package/lib/typescript/module/src/components/ShapeSource.d.ts +2 -5
- package/lib/typescript/module/src/components/ShapeSource.d.ts.map +1 -1
- package/lib/typescript/module/src/components/VectorSource.d.ts +3 -2
- package/lib/typescript/module/src/components/VectorSource.d.ts.map +1 -1
- package/lib/typescript/module/src/components/camera/Camera.d.ts +180 -0
- package/lib/typescript/module/src/components/camera/Camera.d.ts.map +1 -0
- package/lib/typescript/module/src/components/camera/CameraNativeComponent.d.ts +37 -0
- package/lib/typescript/module/src/components/camera/CameraNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/components/camera/NativeCameraModule.d.ts +27 -0
- package/lib/typescript/module/src/components/camera/NativeCameraModule.d.ts.map +1 -0
- package/lib/typescript/module/src/components/map-view/MapView.d.ts +323 -0
- package/lib/typescript/module/src/components/map-view/MapView.d.ts.map +1 -0
- package/lib/typescript/module/src/components/map-view/MapViewNativeComponent.d.ts +69 -0
- package/lib/typescript/module/src/components/map-view/MapViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/components/map-view/NativeMapViewModule.d.ts +45 -0
- package/lib/typescript/module/src/components/map-view/NativeMapViewModule.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +41 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/snapshot/NativeSnapshotModule.d.ts +2 -1
- package/lib/typescript/module/src/modules/snapshot/NativeSnapshotModule.d.ts.map +1 -1
- package/lib/typescript/module/src/types/Bounds.d.ts +2 -0
- package/lib/typescript/module/src/types/Bounds.d.ts.map +1 -0
- package/lib/typescript/module/src/types/PressEvent.d.ts +16 -0
- package/lib/typescript/module/src/types/PressEvent.d.ts.map +1 -0
- package/lib/typescript/module/src/types/ViewPadding.d.ts +7 -0
- package/lib/typescript/module/src/types/ViewPadding.d.ts.map +1 -0
- package/lib/typescript/module/src/types/codegen/UnsafeMixed.d.ts +10 -0
- package/lib/typescript/module/src/types/codegen/UnsafeMixed.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/index.d.ts +1 -3
- package/lib/typescript/module/src/utils/index.d.ts.map +1 -1
- package/package.json +38 -28
- package/src/MLRNModule.ts +0 -10
- package/src/components/Annotation.tsx +8 -23
- package/src/components/Images.tsx +2 -4
- package/src/components/ShapeSource.tsx +18 -31
- package/src/components/VectorSource.tsx +5 -28
- package/src/components/camera/Camera.tsx +311 -0
- package/src/components/camera/CameraNativeComponent.ts +61 -0
- package/src/components/camera/NativeCameraModule.ts +39 -0
- package/src/components/map-view/MapView.tsx +582 -0
- package/src/components/map-view/MapViewNativeComponent.ts +96 -0
- package/src/components/map-view/NativeMapViewModule.ts +83 -0
- package/src/index.ts +86 -1
- package/src/modules/snapshot/NativeSnapshotModule.ts +1 -2
- package/src/modules/snapshot/SnapshotManager.ts +1 -1
- package/src/types/Bounds.ts +1 -0
- package/src/types/PressEvent.ts +19 -0
- package/src/types/ViewPadding.ts +6 -0
- package/src/types/codegen/UnsafeMixed.ts +9 -0
- package/src/utils/index.ts +1 -14
- package/android/src/main/java/org/maplibre/reactnative/components/AbstractEvent.java +0 -35
- package/android/src/main/java/org/maplibre/reactnative/components/AbstractEventEmitter.java +0 -80
- package/android/src/main/java/org/maplibre/reactnative/components/camera/CameraStop.java +0 -245
- package/android/src/main/java/org/maplibre/reactnative/components/camera/CameraUpdateItem.java +0 -121
- package/android/src/main/java/org/maplibre/reactnative/components/camera/CameraUpdateQueue.java +0 -68
- package/android/src/main/java/org/maplibre/reactnative/components/camera/MLRNCamera.java +0 -519
- package/android/src/main/java/org/maplibre/reactnative/components/camera/MLRNCameraManager.java +0 -101
- package/android/src/main/java/org/maplibre/reactnative/components/camera/constants/CameraMode.java +0 -18
- package/android/src/main/java/org/maplibre/reactnative/components/mapview/LayerSourceInfo.java +0 -59
- package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNAndroidTextureMapView.java +0 -13
- package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNAndroidTextureMapViewManager.java +0 -27
- package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapView.java +0 -1521
- package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapViewManager.java +0 -342
- package/android/src/main/java/org/maplibre/reactnative/components/mapview/helpers/CameraChangeTracker.java +0 -37
- package/android/src/main/java/org/maplibre/reactnative/events/MapChangeEvent.java +0 -43
- package/android/src/main/java/org/maplibre/reactnative/events/MapUserTrackingModeEvent.java +0 -32
- package/android/src/main/java/org/maplibre/reactnative/location/UserLocationVerticalAlignment.java +0 -7
- package/android/src/main/java/org/maplibre/reactnative/location/UserTrackingMode.java +0 -59
- package/android/src/main/java/org/maplibre/reactnative/utils/GeoJSONUtils.java +0 -310
- package/ios/CameraMode.h +0 -10
- package/ios/CameraMode.m +0 -10
- package/ios/CameraStop.m +0 -73
- package/ios/MLRNCamera.h +0 -29
- package/ios/MLRNCamera.m +0 -236
- package/ios/MLRNCameraManager.h +0 -5
- package/ios/MLRNCameraManager.m +0 -39
- package/ios/MLRNMapView.m +0 -497
- package/ios/MLRNMapViewManager.h +0 -9
- package/ios/MLRNMapViewManager.m +0 -604
- package/lib/commonjs/MapLibreRN.js +0 -266
- package/lib/commonjs/MapLibreRN.js.map +0 -1
- package/lib/commonjs/components/Camera.js +0 -333
- package/lib/commonjs/components/Camera.js.map +0 -1
- package/lib/commonjs/components/MapView.js +0 -449
- package/lib/commonjs/components/MapView.js.map +0 -1
- package/lib/commonjs/hooks/useNativeRef.js +0 -14
- package/lib/commonjs/hooks/useNativeRef.js.map +0 -1
- package/lib/commonjs/types/CameraMode.js +0 -14
- package/lib/commonjs/types/CameraMode.js.map +0 -1
- package/lib/commonjs/types/MapLibreRNEvent.js +0 -6
- package/lib/commonjs/types/OnPressEvent.js +0 -2
- package/lib/module/MapLibreRN.js +0 -33
- package/lib/module/MapLibreRN.js.map +0 -1
- package/lib/module/components/Camera.js +0 -328
- package/lib/module/components/Camera.js.map +0 -1
- package/lib/module/components/MapView.js +0 -444
- package/lib/module/components/MapView.js.map +0 -1
- package/lib/module/hooks/useNativeRef.js +0 -10
- package/lib/module/hooks/useNativeRef.js.map +0 -1
- package/lib/module/types/CameraMode.js +0 -10
- package/lib/module/types/CameraMode.js.map +0 -1
- package/lib/module/types/MapLibreRNEvent.js +0 -4
- package/lib/module/types/OnPressEvent.js +0 -2
- package/lib/typescript/commonjs/src/MapLibreRN.d.ts +0 -41
- package/lib/typescript/commonjs/src/MapLibreRN.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/Camera.d.ts +0 -134
- package/lib/typescript/commonjs/src/components/Camera.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/MapView.d.ts +0 -223
- package/lib/typescript/commonjs/src/components/MapView.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/hooks/useNativeRef.d.ts +0 -8
- package/lib/typescript/commonjs/src/hooks/useNativeRef.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/CameraMode.d.ts +0 -7
- package/lib/typescript/commonjs/src/types/CameraMode.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/MapLibreRNEvent.d.ts +0 -6
- package/lib/typescript/commonjs/src/types/MapLibreRNEvent.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/OnPressEvent.d.ts +0 -12
- package/lib/typescript/commonjs/src/types/OnPressEvent.d.ts.map +0 -1
- package/lib/typescript/module/src/MapLibreRN.d.ts +0 -41
- package/lib/typescript/module/src/MapLibreRN.d.ts.map +0 -1
- package/lib/typescript/module/src/components/Camera.d.ts +0 -134
- package/lib/typescript/module/src/components/Camera.d.ts.map +0 -1
- package/lib/typescript/module/src/components/MapView.d.ts +0 -223
- package/lib/typescript/module/src/components/MapView.d.ts.map +0 -1
- package/lib/typescript/module/src/hooks/useNativeRef.d.ts +0 -8
- package/lib/typescript/module/src/hooks/useNativeRef.d.ts.map +0 -1
- package/lib/typescript/module/src/types/CameraMode.d.ts +0 -7
- package/lib/typescript/module/src/types/CameraMode.d.ts.map +0 -1
- package/lib/typescript/module/src/types/MapLibreRNEvent.d.ts +0 -6
- package/lib/typescript/module/src/types/MapLibreRNEvent.d.ts.map +0 -1
- package/lib/typescript/module/src/types/OnPressEvent.d.ts +0 -12
- package/lib/typescript/module/src/types/OnPressEvent.d.ts.map +0 -1
- package/src/MapLibreRN.ts +0 -75
- package/src/components/Camera.tsx +0 -568
- package/src/components/MapView.tsx +0 -838
- package/src/hooks/useNativeRef.ts +0 -14
- package/src/types/CameraMode.ts +0 -6
- package/src/types/MapLibreRNEvent.ts +0 -7
- package/src/types/OnPressEvent.ts +0 -11
- /package/ios/{CameraUpdateItem.h → components/camera/CameraUpdateItem.h} +0 -0
- /package/ios/{CameraUpdateQueue.h → components/camera/CameraUpdateQueue.h} +0 -0
- /package/ios/{CameraUpdateQueue.m → components/camera/CameraUpdateQueue.m} +0 -0
- /package/ios/{MLRNSnapshotModule → modules/snapshot}/MLRNSnapshotModule.h +0 -0
package/ios/MLRNEventTypes.m
CHANGED
|
@@ -2,40 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
@implementation MLRNEventTypes
|
|
4
4
|
|
|
5
|
-
NSString *const
|
|
6
|
-
NSString *const
|
|
5
|
+
NSString *const RCT_MLRN_PRESS = @"Press";
|
|
6
|
+
NSString *const RCT_MLRN_LONG_PRESS = @"LongPress";
|
|
7
7
|
|
|
8
|
-
NSString *const
|
|
8
|
+
NSString *const RCT_MLRN_ANNOTATION_TAP = @"AnnotationTap";
|
|
9
9
|
|
|
10
|
-
NSString *const
|
|
11
|
-
NSString *const
|
|
12
|
-
NSString *const
|
|
10
|
+
NSString *const RCT_MLRN_OFFLINE_PROGRESS = @"OfflineProgress";
|
|
11
|
+
NSString *const RCT_MLRN_OFFLINE_ERROR = @"OfflineError";
|
|
12
|
+
NSString *const RCT_MLRN_OFFLINE_TILE_LIMIT = @"OfflineTileLimit";
|
|
13
13
|
|
|
14
|
-
NSString *const
|
|
15
|
-
NSString *const
|
|
16
|
-
NSString *const RCT_MAPBOX_DID_FAIL_LOADING_MAP = @"didfailoadingmap";
|
|
14
|
+
NSString *const RCT_MLRN_SHAPE_SOURCE_LAYER_PRESS = @"ShapeSourceLayerPress";
|
|
15
|
+
NSString *const RCT_MLRN_VECTOR_SOURCE_LAYER_PRESS = @"VectorSourceLayerPress";
|
|
17
16
|
|
|
18
|
-
NSString *const
|
|
19
|
-
NSString *const RCT_MAPBOX_DID_FINSIH_RENDERING_FRAME = @"didfinishrenderingframe";
|
|
20
|
-
NSString *const RCT_MAPBOX_DID_FINISH_RENDERING_FRAME_FULLY = @"didfinishrenderingframefully";
|
|
17
|
+
NSString *const RCT_MLRN_MISSING_IMAGE = @"MissingImage";
|
|
21
18
|
|
|
22
|
-
NSString *const
|
|
23
|
-
NSString *const RCT_MAPBOX_DID_FINISH_RENDERING_MAP = @"didfinishrenderingmap";
|
|
24
|
-
NSString *const RCT_MAPBOX_DID_FINISH_RENDERING_MAP_FULLY = @"didfinishrenderingmapfully";
|
|
25
|
-
|
|
26
|
-
NSString *const RCT_MAPBOX_DID_FINISH_LOADING_STYLE = @"didfinishloadingstyle";
|
|
27
|
-
|
|
28
|
-
NSString *const RCT_MAPBOX_ANNOTATION_TAP = @"annotationtap";
|
|
29
|
-
|
|
30
|
-
NSString *const RCT_MAPBOX_OFFLINE_PROGRESS = @"offlinestatus";
|
|
31
|
-
NSString *const RCT_MAPBOX_OFFLINE_ERROR = @"offlineerror";
|
|
32
|
-
NSString *const RCT_MAPBOX_OFFLINE_TILE_LIMIT = @"offlinetilelimit";
|
|
33
|
-
|
|
34
|
-
NSString *const RCT_MAPBOX_SHAPE_SOURCE_LAYER_PRESS = @"shapesourcelayerpress";
|
|
35
|
-
NSString *const RCT_MAPBOX_VECTOR_SOURCE_LAYER_PRESS = @"vectorsourcelayerpress";
|
|
36
|
-
|
|
37
|
-
NSString *const RCT_MAPBOX_IMAGES_MISSING_IMAGE = @"imagesmissingimage";
|
|
38
|
-
|
|
39
|
-
NSString *const RCT_MAPBOX_USER_LOCATION_UPDATE = @"MapboxUserLocationUpdate";
|
|
19
|
+
NSString *const RCT_MLRN_USER_LOCATION_UPDATE = @"UserLocationUpdate";
|
|
40
20
|
|
|
41
21
|
@end
|
package/ios/MLRNImages.h
CHANGED
package/ios/MLRNImages.m
CHANGED
|
@@ -57,7 +57,7 @@ static UIImage *_placeHolderImage;
|
|
|
57
57
|
|
|
58
58
|
- (void)sendImageMissingEvent:(NSString *)imageName {
|
|
59
59
|
NSDictionary *payload = @{@"imageKey" : imageName};
|
|
60
|
-
MLRNEvent *event = [MLRNEvent makeEvent:
|
|
60
|
+
MLRNEvent *event = [MLRNEvent makeEvent:RCT_MLRN_MISSING_IMAGE withPayload:payload];
|
|
61
61
|
if (_onImageMissing) {
|
|
62
62
|
_onImageMissing([event toJSON]);
|
|
63
63
|
}
|
package/ios/MLRNLayer.h
CHANGED
package/ios/MLRNLayer.m
CHANGED
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
- (void)insertAbove:(NSString *)aboveLayerIDs {
|
|
176
|
-
[_map
|
|
176
|
+
[_map waitForLayerWithId:aboveLayerIDs
|
|
177
177
|
then:^void(MLNStyleLayer *layer) {
|
|
178
178
|
if (![self _hasInitialized]) {
|
|
179
179
|
return;
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
- (void)insertBelow:(NSString *)belowLayerID {
|
|
187
|
-
[_map
|
|
187
|
+
[_map waitForLayerWithId:belowLayerID
|
|
188
188
|
then:^void(MLNStyleLayer *layer) {
|
|
189
189
|
if (![self _hasInitialized]) {
|
|
190
190
|
return;
|
package/ios/MLRNLight.h
CHANGED
package/ios/MLRNLocationModule.m
CHANGED
|
@@ -39,7 +39,7 @@ RCT_EXPORT_MODULE();
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
- (NSArray<NSString *> *)supportedEvents {
|
|
42
|
-
return @[
|
|
42
|
+
return @[ RCT_MLRN_USER_LOCATION_UPDATE ];
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
RCT_EXPORT_METHOD(start : (CLLocationDistance)minDisplacement) {
|
|
@@ -70,7 +70,7 @@ RCT_EXPORT_METHOD(getLastKnownLocation : (RCTPromiseResolveBlock)
|
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
[self sendEventWithName:
|
|
73
|
+
[self sendEventWithName:RCT_MLRN_USER_LOCATION_UPDATE body:[location toJSON]];
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
@end
|
package/ios/MLRNMapTouchEvent.h
CHANGED
package/ios/MLRNMapTouchEvent.m
CHANGED
|
@@ -10,32 +10,34 @@
|
|
|
10
10
|
feature.coordinate = _coordinate;
|
|
11
11
|
if (_id == nil) {
|
|
12
12
|
feature.attributes = @{
|
|
13
|
-
@"
|
|
14
|
-
@"
|
|
13
|
+
@"longitude" : [NSNumber numberWithDouble:_coordinate.longitude],
|
|
14
|
+
@"latitude" : [NSNumber numberWithDouble:_coordinate.latitude],
|
|
15
|
+
@"locationX" : [NSNumber numberWithDouble:_screenPoint.x],
|
|
16
|
+
@"locationY" : [NSNumber numberWithDouble:_screenPoint.y]
|
|
15
17
|
};
|
|
16
18
|
} else {
|
|
17
19
|
feature.attributes = @{
|
|
18
20
|
@"id" : _id,
|
|
19
|
-
@"
|
|
20
|
-
@"
|
|
21
|
+
@"longitude" : [NSNumber numberWithDouble:_coordinate.longitude],
|
|
22
|
+
@"latitude" : [NSNumber numberWithDouble:_coordinate.latitude],
|
|
23
|
+
@"locationX" : [NSNumber numberWithDouble:_screenPoint.x],
|
|
24
|
+
@"locationY" : [NSNumber numberWithDouble:_screenPoint.y]
|
|
21
25
|
};
|
|
22
26
|
}
|
|
23
27
|
return [feature geoJSONDictionary];
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
+ (MLRNMapTouchEvent *)makeTapEvent:(MLNMapView *)mapView withPoint:(CGPoint)point {
|
|
27
|
-
return [MLRNMapTouchEvent _fromPoint:point withMapView:mapView andEventType:
|
|
31
|
+
return [MLRNMapTouchEvent _fromPoint:point withMapView:mapView andEventType:RCT_MLRN_PRESS];
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
+ (MLRNMapTouchEvent *)makeLongPressEvent:(MLNMapView *)mapView withPoint:(CGPoint)point {
|
|
31
|
-
return [MLRNMapTouchEvent _fromPoint:point
|
|
32
|
-
withMapView:mapView
|
|
33
|
-
andEventType:RCT_MAPBOX_EVENT_LONGPRESS];
|
|
35
|
+
return [MLRNMapTouchEvent _fromPoint:point withMapView:mapView andEventType:RCT_MLRN_LONG_PRESS];
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
+ (MLRNMapTouchEvent *)makeAnnotationTapEvent:(MLRNPointAnnotation *)pointAnnotation {
|
|
37
39
|
MLRNMapTouchEvent *event = [[MLRNMapTouchEvent alloc] init];
|
|
38
|
-
event.type =
|
|
40
|
+
event.type = RCT_MLRN_ANNOTATION_TAP;
|
|
39
41
|
event.id = pointAnnotation.id;
|
|
40
42
|
event.coordinate = pointAnnotation.coordinate;
|
|
41
43
|
event.screenPoint = [pointAnnotation.superview convertPoint:pointAnnotation.frame.origin
|
|
@@ -45,7 +47,7 @@
|
|
|
45
47
|
|
|
46
48
|
+ (MLRNMapTouchEvent *)makeAnnotationTapEventOnDrag:(MLRNPointAnnotation *)pointAnnotation {
|
|
47
49
|
MLRNMapTouchEvent *event = [[MLRNMapTouchEvent alloc] init];
|
|
48
|
-
event.type =
|
|
50
|
+
event.type = RCT_MLRN_ANNOTATION_TAP;
|
|
49
51
|
event.id = pointAnnotation.id;
|
|
50
52
|
CGPoint screenPoint = [pointAnnotation.superview convertPoint:pointAnnotation.layer.position
|
|
51
53
|
toView:nil];
|
package/ios/MLRNModule.m
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#import "MLRNModule.h"
|
|
2
|
-
#import "CameraMode.h"
|
|
3
2
|
#import "MLRNCustomHeaders.h"
|
|
4
3
|
#import "MLRNEventTypes.h"
|
|
5
4
|
#import "MLRNOfflineModule.h"
|
|
@@ -21,55 +20,12 @@ RCT_EXPORT_MODULE();
|
|
|
21
20
|
|
|
22
21
|
// event types
|
|
23
22
|
NSMutableDictionary *eventTypes = [[NSMutableDictionary alloc] init];
|
|
24
|
-
[eventTypes setObject:
|
|
25
|
-
[eventTypes setObject:
|
|
26
|
-
[eventTypes setObject:RCT_MAPBOX_REGION_WILL_CHANGE_EVENT forKey:@"RegionWillChange"];
|
|
27
|
-
[eventTypes setObject:RCT_MAPBOX_REGION_IS_CHANGING forKey:@"RegionIsChanging"];
|
|
28
|
-
[eventTypes setObject:RCT_MAPBOX_REGION_DID_CHANGE forKey:@"RegionDidChange"];
|
|
29
|
-
[eventTypes setObject:RCT_MAPBOX_WILL_START_LOADING_MAP forKey:@"WillStartLoadingMap"];
|
|
30
|
-
[eventTypes setObject:RCT_MAPBOX_DID_FINISH_LOADING_MAP forKey:@"DidFinishLoadingMap"];
|
|
31
|
-
[eventTypes setObject:RCT_MAPBOX_DID_FAIL_LOADING_MAP forKey:@"DidFailLoadingMap"];
|
|
32
|
-
[eventTypes setObject:RCT_MAPBOX_WILL_START_RENDERING_FRAME forKey:@"WillStartRenderingFrame"];
|
|
33
|
-
[eventTypes setObject:RCT_MAPBOX_DID_FINSIH_RENDERING_FRAME forKey:@"DidFinishRenderingFrame"];
|
|
34
|
-
[eventTypes setObject:RCT_MAPBOX_DID_FINISH_RENDERING_FRAME_FULLY
|
|
35
|
-
forKey:@"DidFinishRenderingFrameFully"];
|
|
36
|
-
[eventTypes setObject:RCT_MAPBOX_WILL_START_RENDERING_MAP forKey:@"WillStartRenderingMap"];
|
|
37
|
-
[eventTypes setObject:RCT_MAPBOX_DID_FINISH_RENDERING_MAP forKey:@"DidFinishRenderingMap"];
|
|
38
|
-
[eventTypes setObject:RCT_MAPBOX_DID_FINISH_RENDERING_MAP_FULLY
|
|
39
|
-
forKey:@"DidFinishRenderingMapFully"];
|
|
40
|
-
[eventTypes setObject:RCT_MAPBOX_DID_FINISH_LOADING_STYLE forKey:@"DidFinishLoadingStyle"];
|
|
23
|
+
[eventTypes setObject:RCT_MLRN_PRESS forKey:@"Press"];
|
|
24
|
+
[eventTypes setObject:RCT_MLRN_LONG_PRESS forKey:@"LongPress"];
|
|
41
25
|
|
|
42
26
|
// location module events
|
|
43
27
|
NSMutableDictionary *locationModuleEvents = [[NSMutableDictionary alloc] init];
|
|
44
|
-
[locationModuleEvents setObject:
|
|
45
|
-
|
|
46
|
-
// user tracking modes
|
|
47
|
-
NSMutableDictionary *userTrackingModes = [[NSMutableDictionary alloc] init];
|
|
48
|
-
[userTrackingModes setObject:[NSNumber numberWithInt:MLNUserTrackingModeNone] forKey:@"None"];
|
|
49
|
-
[userTrackingModes setObject:[NSNumber numberWithInt:MLNUserTrackingModeFollow] forKey:@"Follow"];
|
|
50
|
-
[userTrackingModes setObject:[NSNumber numberWithInt:MLNUserTrackingModeFollowWithHeading]
|
|
51
|
-
forKey:@"FollowWithHeading"];
|
|
52
|
-
[userTrackingModes setObject:[NSNumber numberWithInt:MLNUserTrackingModeFollowWithCourse]
|
|
53
|
-
forKey:@"FollowWithCourse"];
|
|
54
|
-
|
|
55
|
-
// user location vertical alignment
|
|
56
|
-
NSMutableDictionary *userLocationVerticalAlignment = [[NSMutableDictionary alloc] init];
|
|
57
|
-
[userLocationVerticalAlignment
|
|
58
|
-
setObject:[NSNumber numberWithInt:MLNAnnotationVerticalAlignmentTop]
|
|
59
|
-
forKey:@"Top"];
|
|
60
|
-
[userLocationVerticalAlignment
|
|
61
|
-
setObject:[NSNumber numberWithInt:MLNAnnotationVerticalAlignmentCenter]
|
|
62
|
-
forKey:@"Center"];
|
|
63
|
-
[userLocationVerticalAlignment
|
|
64
|
-
setObject:[NSNumber numberWithInt:MLNAnnotationVerticalAlignmentBottom]
|
|
65
|
-
forKey:@"Bottom"];
|
|
66
|
-
|
|
67
|
-
// camera modes
|
|
68
|
-
NSMutableDictionary *cameraModes = [[NSMutableDictionary alloc] init];
|
|
69
|
-
[cameraModes setObject:[NSNumber numberWithInt:RCT_MAPBOX_CAMERA_MODE_FLIGHT] forKey:@"Flight"];
|
|
70
|
-
[cameraModes setObject:[NSNumber numberWithInt:RCT_MAPBOX_CAMERA_MODE_EASE] forKey:@"Ease"];
|
|
71
|
-
[cameraModes setObject:[NSNumber numberWithInt:RCT_MAPBOX_CAMERA_MODE_LINEAR] forKey:@"Linear"];
|
|
72
|
-
[cameraModes setObject:[NSNumber numberWithInt:RCT_MAPBOX_CAMERA_MODE_NONE] forKey:@"None"];
|
|
28
|
+
[locationModuleEvents setObject:RCT_MLRN_USER_LOCATION_UPDATE forKey:@"Update"];
|
|
73
29
|
|
|
74
30
|
// style sources
|
|
75
31
|
NSMutableDictionary *styleSourceConsts = [[NSMutableDictionary alloc] init];
|
|
@@ -77,8 +33,8 @@ RCT_EXPORT_MODULE();
|
|
|
77
33
|
|
|
78
34
|
// offline module callback names
|
|
79
35
|
NSMutableDictionary *offlineModuleCallbackNames = [[NSMutableDictionary alloc] init];
|
|
80
|
-
[offlineModuleCallbackNames setObject:
|
|
81
|
-
[offlineModuleCallbackNames setObject:
|
|
36
|
+
[offlineModuleCallbackNames setObject:RCT_MLRN_OFFLINE_CALLBACK_ERROR forKey:@"Error"];
|
|
37
|
+
[offlineModuleCallbackNames setObject:RCT_MLRN_OFFLINE_CALLBACK_PROGRESS forKey:@"Progress"];
|
|
82
38
|
|
|
83
39
|
NSMutableDictionary *offlinePackDownloadState = [[NSMutableDictionary alloc] init];
|
|
84
40
|
[offlinePackDownloadState setObject:@(MLNOfflinePackStateInactive) forKey:@"Inactive"];
|
|
@@ -88,9 +44,6 @@ RCT_EXPORT_MODULE();
|
|
|
88
44
|
return @{
|
|
89
45
|
@"StyleURL" : styleURLS,
|
|
90
46
|
@"EventTypes" : eventTypes,
|
|
91
|
-
@"UserTrackingModes" : userTrackingModes,
|
|
92
|
-
@"UserLocationVerticalAlignment" : userLocationVerticalAlignment,
|
|
93
|
-
@"CameraModes" : cameraModes,
|
|
94
47
|
@"StyleSource" : styleSourceConsts,
|
|
95
48
|
@"OfflineCallbackName" : offlineModuleCallbackNames,
|
|
96
49
|
@"OfflinePackDownloadState" : offlinePackDownloadState,
|
package/ios/MLRNOfflineModule.h
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
@interface MLRNOfflineModule : RCTEventEmitter <RCTBridgeModule>
|
|
7
7
|
|
|
8
|
-
extern NSString *const
|
|
9
|
-
extern NSString *const
|
|
8
|
+
extern NSString *const RCT_MLRN_OFFLINE_CALLBACK_PROGRESS;
|
|
9
|
+
extern NSString *const RCT_MLRN_OFFLINE_CALLBACK_ERROR;
|
|
10
10
|
|
|
11
11
|
@end
|
package/ios/MLRNOfflineModule.m
CHANGED
|
@@ -27,8 +27,8 @@ RCT_EXPORT_MODULE()
|
|
|
27
27
|
hasListeners = NO;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
NSString *const
|
|
31
|
-
NSString *const
|
|
30
|
+
NSString *const RCT_MLRN_OFFLINE_CALLBACK_PROGRESS = @"OfflineRegionProgress";
|
|
31
|
+
NSString *const RCT_MLRN_OFFLINE_CALLBACK_ERROR = @"OfflineRegionError";
|
|
32
32
|
|
|
33
33
|
- (instancetype)init {
|
|
34
34
|
if (self = [super init]) {
|
|
@@ -64,7 +64,7 @@ NSString *const RCT_MAPBOX_OFFLINE_CALLBACK_ERROR = @"MapboOfflineRegionError";
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
- (NSArray<NSString *> *)supportedEvents {
|
|
67
|
-
return @[
|
|
67
|
+
return @[ RCT_MLRN_OFFLINE_CALLBACK_PROGRESS, RCT_MLRN_OFFLINE_CALLBACK_ERROR ];
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
- (void)observeValueForKeyPath:(NSString *)keyPath
|
|
@@ -343,7 +343,7 @@ RCT_EXPORT_METHOD(setProgressEventThrottle : (nonnull NSNumber *)throttleValue)
|
|
|
343
343
|
if ([self _shouldSendProgressEvent:[self _getCurrentTimestamp] pack:pack]) {
|
|
344
344
|
NSDictionary *metadata = [self _unarchiveMetadata:pack];
|
|
345
345
|
MLRNEvent *event = [self _makeProgressEvent:metadata[@"name"] pack:pack];
|
|
346
|
-
[self _sendEvent:
|
|
346
|
+
[self _sendEvent:RCT_MLRN_OFFLINE_CALLBACK_PROGRESS event:event];
|
|
347
347
|
lastPackTimestamp = [self _getCurrentTimestamp];
|
|
348
348
|
}
|
|
349
349
|
|
|
@@ -361,9 +361,9 @@ RCT_EXPORT_METHOD(setProgressEventThrottle : (nonnull NSNumber *)throttleValue)
|
|
|
361
361
|
if (name != nil) {
|
|
362
362
|
NSError *error = notification.userInfo[MLNOfflinePackUserInfoKeyError];
|
|
363
363
|
MLRNEvent *event = [self _makeErrorEvent:name
|
|
364
|
-
type:
|
|
364
|
+
type:RCT_MLRN_OFFLINE_ERROR
|
|
365
365
|
message:error.description];
|
|
366
|
-
[self _sendEvent:
|
|
366
|
+
[self _sendEvent:RCT_MLRN_OFFLINE_CALLBACK_ERROR event:event];
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
|
|
@@ -374,9 +374,9 @@ RCT_EXPORT_METHOD(setProgressEventThrottle : (nonnull NSNumber *)throttleValue)
|
|
|
374
374
|
NSString *name = metadata[@"name"];
|
|
375
375
|
if (name != nil) {
|
|
376
376
|
MLRNEvent *event = [self _makeErrorEvent:name
|
|
377
|
-
type:
|
|
377
|
+
type:RCT_MLRN_OFFLINE_ERROR
|
|
378
378
|
message:@"Mapbox tile limit exceeded"];
|
|
379
|
-
[self _sendEvent:
|
|
379
|
+
[self _sendEvent:RCT_MLRN_OFFLINE_CALLBACK_ERROR event:event];
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
382
|
|
|
@@ -436,7 +436,7 @@ RCT_EXPORT_METHOD(setProgressEventThrottle : (nonnull NSNumber *)throttleValue)
|
|
|
436
436
|
}
|
|
437
437
|
|
|
438
438
|
- (MLRNEvent *)_makeProgressEvent:(NSString *)name pack:(MLNOfflinePack *)pack {
|
|
439
|
-
return [MLRNEvent makeEvent:
|
|
439
|
+
return [MLRNEvent makeEvent:RCT_MLRN_OFFLINE_PROGRESS
|
|
440
440
|
withPayload:[self _makeRegionStatusPayload:name pack:pack]];
|
|
441
441
|
}
|
|
442
442
|
|
package/ios/MLRNShapeSource.h
CHANGED
package/ios/MLRNSource.h
CHANGED
package/ios/MLRNStyle.m
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
- (void)fillLayer:(MLNFillStyleLayer *)layer withReactStyle:(NSDictionary *)reactStyle isValid:(BOOL (^)(void)) isValid
|
|
19
19
|
{
|
|
20
20
|
if (![self _hasReactStyle:reactStyle]) {
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
} else if ([prop isEqualToString:@"fillPatternTransition"]) {
|
|
71
71
|
[self setFillPatternTransition:layer withReactStyleValue:styleValue];
|
|
72
72
|
} else {
|
|
73
|
-
|
|
73
|
+
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
- (void)lineLayer:(MLNLineStyleLayer *)layer withReactStyle:(NSDictionary *)reactStyle isValid:(BOOL (^)(void)) isValid
|
|
79
79
|
{
|
|
80
80
|
if (![self _hasReactStyle:reactStyle]) {
|
|
81
|
-
|
|
81
|
+
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
84
|
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
} else if ([prop isEqualToString:@"lineGradient"]) {
|
|
155
155
|
[self setLineGradient:layer withReactStyleValue:styleValue];
|
|
156
156
|
} else {
|
|
157
|
-
|
|
157
|
+
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
}
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
- (void)symbolLayer:(MLNSymbolStyleLayer *)layer withReactStyle:(NSDictionary *)reactStyle isValid:(BOOL (^)(void)) isValid
|
|
163
163
|
{
|
|
164
164
|
if (![self _hasReactStyle:reactStyle]) {
|
|
165
|
-
|
|
165
|
+
|
|
166
166
|
return;
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -322,7 +322,7 @@
|
|
|
322
322
|
} else if ([prop isEqualToString:@"textTranslateAnchor"]) {
|
|
323
323
|
[self setTextTranslateAnchor:layer withReactStyleValue:styleValue];
|
|
324
324
|
} else {
|
|
325
|
-
|
|
325
|
+
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
}
|
|
@@ -330,7 +330,7 @@
|
|
|
330
330
|
- (void)circleLayer:(MLNCircleStyleLayer *)layer withReactStyle:(NSDictionary *)reactStyle isValid:(BOOL (^)(void)) isValid
|
|
331
331
|
{
|
|
332
332
|
if (![self _hasReactStyle:reactStyle]) {
|
|
333
|
-
|
|
333
|
+
|
|
334
334
|
return;
|
|
335
335
|
}
|
|
336
336
|
|
|
@@ -381,7 +381,7 @@
|
|
|
381
381
|
} else if ([prop isEqualToString:@"circleStrokeOpacityTransition"]) {
|
|
382
382
|
[self setCircleStrokeOpacityTransition:layer withReactStyleValue:styleValue];
|
|
383
383
|
} else {
|
|
384
|
-
|
|
384
|
+
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
}
|
|
@@ -389,7 +389,7 @@
|
|
|
389
389
|
- (void)heatmapLayer:(MLNHeatmapStyleLayer *)layer withReactStyle:(NSDictionary *)reactStyle isValid:(BOOL (^)(void)) isValid
|
|
390
390
|
{
|
|
391
391
|
if (![self _hasReactStyle:reactStyle]) {
|
|
392
|
-
|
|
392
|
+
|
|
393
393
|
return;
|
|
394
394
|
}
|
|
395
395
|
|
|
@@ -416,7 +416,7 @@
|
|
|
416
416
|
} else if ([prop isEqualToString:@"heatmapOpacityTransition"]) {
|
|
417
417
|
[self setHeatmapOpacityTransition:layer withReactStyleValue:styleValue];
|
|
418
418
|
} else {
|
|
419
|
-
|
|
419
|
+
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
}
|
|
@@ -424,7 +424,7 @@
|
|
|
424
424
|
- (void)fillExtrusionLayer:(MLNFillExtrusionStyleLayer *)layer withReactStyle:(NSDictionary *)reactStyle isValid:(BOOL (^)(void)) isValid
|
|
425
425
|
{
|
|
426
426
|
if (![self _hasReactStyle:reactStyle]) {
|
|
427
|
-
|
|
427
|
+
|
|
428
428
|
return;
|
|
429
429
|
}
|
|
430
430
|
|
|
@@ -478,7 +478,7 @@
|
|
|
478
478
|
} else if ([prop isEqualToString:@"fillExtrusionVerticalGradient"]) {
|
|
479
479
|
[self setFillExtrusionVerticalGradient:layer withReactStyleValue:styleValue];
|
|
480
480
|
} else {
|
|
481
|
-
|
|
481
|
+
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
484
|
}
|
|
@@ -486,7 +486,7 @@
|
|
|
486
486
|
- (void)rasterLayer:(MLNRasterStyleLayer *)layer withReactStyle:(NSDictionary *)reactStyle isValid:(BOOL (^)(void)) isValid
|
|
487
487
|
{
|
|
488
488
|
if (![self _hasReactStyle:reactStyle]) {
|
|
489
|
-
|
|
489
|
+
|
|
490
490
|
return;
|
|
491
491
|
}
|
|
492
492
|
|
|
@@ -525,7 +525,7 @@
|
|
|
525
525
|
} else if ([prop isEqualToString:@"rasterFadeDuration"]) {
|
|
526
526
|
[self setRasterFadeDuration:layer withReactStyleValue:styleValue];
|
|
527
527
|
} else {
|
|
528
|
-
|
|
528
|
+
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
531
|
}
|
|
@@ -533,7 +533,7 @@
|
|
|
533
533
|
- (void)hillshadeLayer:(MLNHillshadeStyleLayer *)layer withReactStyle:(NSDictionary *)reactStyle isValid:(BOOL (^)(void)) isValid
|
|
534
534
|
{
|
|
535
535
|
if (![self _hasReactStyle:reactStyle]) {
|
|
536
|
-
|
|
536
|
+
|
|
537
537
|
return;
|
|
538
538
|
}
|
|
539
539
|
|
|
@@ -564,7 +564,7 @@
|
|
|
564
564
|
} else if ([prop isEqualToString:@"hillshadeAccentColorTransition"]) {
|
|
565
565
|
[self setHillshadeAccentColorTransition:layer withReactStyleValue:styleValue];
|
|
566
566
|
} else {
|
|
567
|
-
|
|
567
|
+
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
570
|
}
|
|
@@ -572,7 +572,7 @@
|
|
|
572
572
|
- (void)backgroundLayer:(MLNBackgroundStyleLayer *)layer withReactStyle:(NSDictionary *)reactStyle isValid:(BOOL (^)(void)) isValid
|
|
573
573
|
{
|
|
574
574
|
if (![self _hasReactStyle:reactStyle]) {
|
|
575
|
-
|
|
575
|
+
|
|
576
576
|
return;
|
|
577
577
|
}
|
|
578
578
|
|
|
@@ -610,7 +610,7 @@
|
|
|
610
610
|
} else if ([prop isEqualToString:@"backgroundOpacityTransition"]) {
|
|
611
611
|
[self setBackgroundOpacityTransition:layer withReactStyleValue:styleValue];
|
|
612
612
|
} else {
|
|
613
|
-
|
|
613
|
+
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
616
|
}
|
|
@@ -618,7 +618,7 @@
|
|
|
618
618
|
- (void)lightLayer:(MLNLight *)layer withReactStyle:(NSDictionary *)reactStyle isValid:(BOOL (^)(void)) isValid
|
|
619
619
|
{
|
|
620
620
|
if (![self _hasReactStyle:reactStyle]) {
|
|
621
|
-
|
|
621
|
+
|
|
622
622
|
return;
|
|
623
623
|
}
|
|
624
624
|
|
|
@@ -641,7 +641,7 @@
|
|
|
641
641
|
} else if ([prop isEqualToString:@"intensityTransition"]) {
|
|
642
642
|
[self setIntensityTransition:layer withReactStyleValue:styleValue];
|
|
643
643
|
} else {
|
|
644
|
-
|
|
644
|
+
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
647
|
}
|
package/ios/MLRNUtils.h
CHANGED
|
@@ -1,30 +1,45 @@
|
|
|
1
|
-
#import <
|
|
1
|
+
#import <MapLibre/MapLibre.h>
|
|
2
2
|
#import <React/RCTBridge.h>
|
|
3
3
|
#import <React/RCTConvert.h>
|
|
4
4
|
#import <React/RCTImageLoader.h>
|
|
5
|
-
#import <MapLibre/MapLibre.h>
|
|
6
5
|
|
|
7
6
|
@interface MLRNUtils : NSObject
|
|
8
7
|
|
|
9
8
|
+ (CLLocationCoordinate2D)fromFeature:(NSString *)json;
|
|
9
|
+
|
|
10
|
+
+ (CLLocationCoordinate2D)fromLongitude:(NSNumber *)longitude latitude:(NSNumber *)latitude;
|
|
11
|
+
|
|
12
|
+
+ (NSArray<NSDictionary *> *)featuresToJSON:(NSArray<id<MLNFeature>> *)features;
|
|
13
|
+
|
|
10
14
|
+ (MLNShape *)shapeFromGeoJSON:(NSString *)json;
|
|
15
|
+
|
|
11
16
|
+ (MLNCoordinateBounds)fromFeatureCollection:(NSString *)json;
|
|
17
|
+
|
|
18
|
+
+ (MLNCoordinateBounds)fromReactBounds:(NSArray<NSNumber *> *)bounds;
|
|
19
|
+
|
|
12
20
|
+ (NSArray<NSNumber *> *)fromCoordinateBounds:(MLNCoordinateBounds)bounds;
|
|
21
|
+
|
|
13
22
|
+ (NSTimeInterval)fromMS:(NSNumber *)number;
|
|
14
23
|
+ (NSNumber *)clamp:(NSNumber *)value min:(NSNumber *)min max:(NSNumber *)max;
|
|
24
|
+
|
|
15
25
|
+ (UIColor *)toColor:(id)value;
|
|
26
|
+
|
|
16
27
|
+ (void)fetchImage:(RCTBridge *)bridge
|
|
17
28
|
url:(NSString *)url
|
|
18
29
|
scale:(double)scale
|
|
19
30
|
sdf:(Boolean)sdf
|
|
20
31
|
callback:(RCTImageLoaderCompletionBlock)callback;
|
|
32
|
+
|
|
21
33
|
+ (void)fetchImages:(RCTBridge *)bridge
|
|
22
34
|
style:(MLNStyle *)style
|
|
23
35
|
objects:(NSDictionary<NSString *, NSString *> *)objects
|
|
24
36
|
forceUpdate:(BOOL)forceUpdate
|
|
25
37
|
callback:(void (^)(void))callback;
|
|
38
|
+
|
|
26
39
|
+ (CGVector)toCGVector:(NSArray<NSNumber *> *)arr;
|
|
40
|
+
|
|
27
41
|
+ (UIEdgeInsets)toUIEdgeInsets:(NSArray<NSNumber *> *)arr;
|
|
42
|
+
|
|
28
43
|
+ (NSURL *)styleURLFromStyleJSON:(NSString *)styleJSON;
|
|
29
44
|
|
|
30
45
|
@end
|
package/ios/MLRNUtils.m
CHANGED
|
@@ -15,6 +15,18 @@ static double const MS_TO_S = 0.001;
|
|
|
15
15
|
return feature.coordinate;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
+ (CLLocationCoordinate2D)fromLongitude:(NSNumber *)longitude latitude:(NSNumber *)latitude {
|
|
19
|
+
return CLLocationCoordinate2DMake([latitude doubleValue], [longitude doubleValue]);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
+ (NSArray<NSDictionary *> *)featuresToJSON:(NSArray<id<MLNFeature>> *)features {
|
|
23
|
+
NSMutableArray<NSDictionary *> *json = [[NSMutableArray alloc] init];
|
|
24
|
+
for (id<MLNFeature> feature in features) {
|
|
25
|
+
[json addObject:feature.geoJSONDictionary];
|
|
26
|
+
}
|
|
27
|
+
return json;
|
|
28
|
+
}
|
|
29
|
+
|
|
18
30
|
+ (UIEdgeInsets)toUIEdgeInsets:(NSArray<NSNumber *> *)arr {
|
|
19
31
|
return UIEdgeInsetsMake([arr[0] floatValue], [arr[1] floatValue], [arr[2] floatValue],
|
|
20
32
|
[arr[3] floatValue]);
|
|
@@ -51,10 +63,21 @@ static double const MS_TO_S = 0.001;
|
|
|
51
63
|
return MLNCoordinateBoundsMake(sw, ne);
|
|
52
64
|
}
|
|
53
65
|
|
|
66
|
+
+ (MLNCoordinateBounds)fromReactBounds:(NSArray<NSNumber *> *)bounds {
|
|
67
|
+
CLLocationCoordinate2D sw =
|
|
68
|
+
CLLocationCoordinate2DMake([bounds[1] doubleValue], [bounds[0] doubleValue]);
|
|
69
|
+
CLLocationCoordinate2D ne =
|
|
70
|
+
CLLocationCoordinate2DMake([bounds[3] doubleValue], [bounds[2] doubleValue]);
|
|
71
|
+
|
|
72
|
+
return MLNCoordinateBoundsMake(sw, ne);
|
|
73
|
+
}
|
|
74
|
+
|
|
54
75
|
+ (NSArray<NSNumber *> *)fromCoordinateBounds:(MLNCoordinateBounds)bounds {
|
|
55
76
|
return @[
|
|
56
|
-
@
|
|
57
|
-
@
|
|
77
|
+
@(bounds.sw.longitude),
|
|
78
|
+
@(bounds.sw.latitude),
|
|
79
|
+
@(bounds.ne.longitude),
|
|
80
|
+
@(bounds.ne.latitude),
|
|
58
81
|
];
|
|
59
82
|
}
|
|
60
83
|
|