@maplibre/maplibre-react-native 11.0.0-beta.8 → 11.0.0
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/README.md +0 -5
- package/android/build.gradle +3 -1
- package/android/gradle.properties +2 -2
- package/android/src/main/java/org/maplibre/reactnative/MLRNPackage.kt +14 -1
- package/android/src/main/java/org/maplibre/reactnative/components/annotations/markerview/MLRNMarkerView.kt +35 -29
- package/android/src/main/java/org/maplibre/reactnative/components/annotations/markerview/MLRNMarkerViewManager.kt +8 -1
- package/android/src/main/java/org/maplibre/reactnative/components/annotations/markerview/MarkerViewManager.kt +8 -5
- package/android/src/main/java/org/maplibre/reactnative/components/annotations/pointannotation/MLRNPointAnnotation.kt +45 -25
- package/android/src/main/java/org/maplibre/reactnative/components/annotations/pointannotation/MLRNPointAnnotationManager.kt +2 -1
- package/android/src/main/java/org/maplibre/reactnative/components/layer/MLRNLayer.kt +8 -8
- package/android/src/main/java/org/maplibre/reactnative/components/layer/style/MLRNStyle.kt +60 -0
- package/android/src/main/java/org/maplibre/reactnative/components/layer/style/MLRNStyleFactory.kt +3005 -0
- package/android/src/main/java/org/maplibre/reactnative/components/layer/style/MLRNStyleValue.kt +159 -0
- package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapView.kt +234 -128
- package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapViewManager.kt +37 -3
- package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapViewModule.kt +3 -1
- package/android/src/main/java/org/maplibre/reactnative/modules/MLRNLogModule.kt +2 -0
- package/android/src/main/java/org/maplibre/reactnative/modules/MLRNNetworkModule.kt +0 -42
- package/android/src/main/java/org/maplibre/reactnative/modules/MLRNOfflineModule.kt +27 -4
- package/android/src/main/java/org/maplibre/reactnative/modules/MLRNTransformRequestModule.kt +144 -0
- package/android/src/main/java/org/maplibre/reactnative/modules/TransformRequestInterceptor.kt +184 -0
- package/ios/components/annotations/point-annotation/MLRNPointAnnotation.h +3 -2
- package/ios/components/annotations/point-annotation/MLRNPointAnnotation.m +65 -2
- package/ios/components/annotations/point-annotation/MLRNPointAnnotationComponentView.mm +27 -19
- package/ios/components/camera/MLRNCameraComponentView.mm +5 -4
- package/ios/components/images/MLRNImageLoader.h +27 -0
- package/ios/components/images/MLRNImageLoader.m +85 -0
- package/ios/components/images/MLRNImageQueue.h +2 -2
- package/ios/components/images/MLRNImageQueue.m +2 -2
- package/ios/components/images/MLRNImageQueueOperation.h +2 -2
- package/ios/components/images/MLRNImageQueueOperation.m +3 -3
- package/ios/components/images/MLRNImages.h +0 -3
- package/ios/components/images/MLRNImages.m +6 -6
- package/ios/components/images/MLRNImagesComponentView.mm +0 -3
- package/ios/components/images/MLRNImagesModule.h +6 -0
- package/ios/components/images/MLRNImagesModule.mm +23 -0
- package/ios/components/layer/MLRNLayer.h +0 -3
- package/ios/components/layer/MLRNLayer.m +0 -1
- package/ios/components/layer/MLRNLayerComponentView.mm +12 -11
- package/ios/components/layer/style/MLRNStyle.h +1 -3
- package/ios/components/layer/style/MLRNStyle.m +68 -71
- package/ios/components/map-view/MLRNMapView.h +8 -1
- package/ios/components/map-view/MLRNMapView.m +106 -24
- package/ios/components/map-view/MLRNMapViewComponentView.mm +29 -5
- package/ios/components/sources/geojson-source/MLRNGeoJSONSource.h +0 -3
- package/ios/components/sources/image-source/MLRNImageSourceComponentView.mm +1 -1
- package/ios/components/sources/tile-sources/raster-source/MLRNRasterSourceComponentView.mm +2 -3
- package/ios/components/sources/tile-sources/vector-source/MLRNVectorSourceComponentView.mm +2 -3
- package/ios/modules/logging/MLRNLogging.h +4 -0
- package/ios/modules/logging/MLRNLogging.m +8 -0
- package/ios/modules/network/MLRNNetworkModule.mm +0 -10
- package/ios/modules/offline/MLRNOfflineModule.h +1 -2
- package/ios/modules/offline/MLRNOfflineModule.mm +9 -9
- package/ios/modules/transform-request/MLRNTransformRequest.h +38 -0
- package/ios/modules/transform-request/MLRNTransformRequest.m +413 -0
- package/ios/modules/transform-request/MLRNTransformRequestModule.h +9 -0
- package/ios/modules/transform-request/MLRNTransformRequestModule.mm +72 -0
- package/ios/utils/MLRNUtils.h +0 -14
- package/ios/utils/MLRNUtils.m +0 -71
- package/lib/commonjs/components/annotations/callout/Callout.js +2 -1
- package/lib/commonjs/components/annotations/callout/Callout.js.map +1 -1
- package/lib/commonjs/components/annotations/marker/Marker.js +17 -3
- package/lib/commonjs/components/annotations/marker/Marker.js.map +1 -1
- package/lib/commonjs/components/annotations/marker/MarkerViewNativeComponent.ts +10 -0
- package/lib/commonjs/components/annotations/view-annotation/PointAnnotationNativeComponent.ts +3 -2
- package/lib/commonjs/components/annotations/view-annotation/ViewAnnotation.js +20 -17
- package/lib/commonjs/components/annotations/view-annotation/ViewAnnotation.js.map +1 -1
- package/lib/commonjs/components/camera/Camera.js +52 -3
- package/lib/commonjs/components/camera/Camera.js.map +1 -1
- package/lib/commonjs/components/images/Images.js +12 -2
- package/lib/commonjs/components/images/Images.js.map +1 -1
- package/lib/commonjs/components/images/NativeImagesModule.js +10 -0
- package/lib/commonjs/components/images/NativeImagesModule.js.map +1 -0
- package/lib/commonjs/components/layer/Layer.js +18 -8
- package/lib/commonjs/components/layer/Layer.js.map +1 -1
- package/lib/commonjs/components/map/AndroidTextureMapViewNativeComponent.ts +7 -2
- package/lib/commonjs/components/map/Map.js +29 -4
- package/lib/commonjs/components/map/Map.js.map +1 -1
- package/lib/commonjs/components/map/MapViewNativeComponent.ts +6 -1
- package/lib/commonjs/components/sources/geojson-source/GeoJSONSource.js +6 -5
- package/lib/commonjs/components/sources/geojson-source/GeoJSONSource.js.map +1 -1
- package/lib/commonjs/components/sources/image-source/ImageSource.js +3 -2
- package/lib/commonjs/components/sources/image-source/ImageSource.js.map +1 -1
- package/lib/commonjs/components/sources/raster-source/RasterSource.js +4 -3
- package/lib/commonjs/components/sources/raster-source/RasterSource.js.map +1 -1
- package/lib/commonjs/components/sources/vector-source/VectorSource.js +8 -5
- package/lib/commonjs/components/sources/vector-source/VectorSource.js.map +1 -1
- package/lib/commonjs/components/user-location/NativeUserLocation.js.map +1 -1
- package/lib/commonjs/components/user-location/UserLocation.js.map +1 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/modules/log/LogManager.js +5 -4
- package/lib/commonjs/modules/log/LogManager.js.map +1 -1
- package/lib/commonjs/modules/network/NativeNetworkModule.js.map +1 -1
- package/lib/commonjs/modules/network/NetworkManager.js +6 -44
- package/lib/commonjs/modules/network/NetworkManager.js.map +1 -1
- package/lib/commonjs/modules/offline/OfflineManager.js +109 -62
- package/lib/commonjs/modules/offline/OfflineManager.js.map +1 -1
- package/lib/commonjs/modules/static-map/StaticMapManager.js +13 -5
- package/lib/commonjs/modules/static-map/StaticMapManager.js.map +1 -1
- package/lib/commonjs/modules/transform-request/NativeTransformRequestModule.js +9 -0
- package/lib/commonjs/modules/transform-request/NativeTransformRequestModule.js.map +1 -0
- package/lib/commonjs/modules/transform-request/TransformRequestManager.js +233 -0
- package/lib/commonjs/modules/transform-request/TransformRequestManager.js.map +1 -0
- package/lib/commonjs/plugin/ios.js +28 -15
- package/lib/commonjs/plugin/ios.js.map +1 -1
- package/lib/commonjs/types/Anchor.js +5 -6
- package/lib/commonjs/types/Anchor.js.map +1 -1
- package/lib/commonjs/types/PressableSourceProps.js.map +1 -0
- package/lib/commonjs/utils/animated/AbstractAnimatedCoordinates.js +2 -2
- package/lib/commonjs/utils/animated/AnimatedCoordinatesArray.js +6 -6
- package/lib/commonjs/utils/animated/AnimatedGeoJSON.js +2 -1
- package/lib/commonjs/utils/animated/AnimatedGeoJSON.js.map +1 -1
- package/lib/commonjs/utils/animated/AnimatedRouteCoordinatesArray.js +6 -6
- package/lib/commonjs/utils/convertStyleSpec.js +4 -4
- package/lib/commonjs/utils/getStylePropertyType.js +1 -1
- package/lib/module/components/annotations/callout/Callout.js +2 -1
- package/lib/module/components/annotations/callout/Callout.js.map +1 -1
- package/lib/module/components/annotations/marker/Marker.js +17 -3
- package/lib/module/components/annotations/marker/Marker.js.map +1 -1
- package/lib/module/components/annotations/marker/MarkerViewNativeComponent.ts +10 -0
- package/lib/module/components/annotations/view-annotation/PointAnnotationNativeComponent.ts +3 -2
- package/lib/module/components/annotations/view-annotation/ViewAnnotation.js +20 -17
- package/lib/module/components/annotations/view-annotation/ViewAnnotation.js.map +1 -1
- package/lib/module/components/camera/Camera.js +53 -4
- package/lib/module/components/camera/Camera.js.map +1 -1
- package/lib/module/components/images/Images.js +12 -2
- package/lib/module/components/images/Images.js.map +1 -1
- package/lib/module/components/images/NativeImagesModule.js +7 -0
- package/lib/module/components/images/NativeImagesModule.js.map +1 -0
- package/lib/module/components/layer/Layer.js +18 -8
- package/lib/module/components/layer/Layer.js.map +1 -1
- package/lib/module/components/map/AndroidTextureMapViewNativeComponent.ts +7 -2
- package/lib/module/components/map/Map.js +30 -5
- package/lib/module/components/map/Map.js.map +1 -1
- package/lib/module/components/map/MapViewNativeComponent.ts +6 -1
- package/lib/module/components/sources/geojson-source/GeoJSONSource.js +7 -6
- package/lib/module/components/sources/geojson-source/GeoJSONSource.js.map +1 -1
- package/lib/module/components/sources/image-source/ImageSource.js +3 -2
- package/lib/module/components/sources/image-source/ImageSource.js.map +1 -1
- package/lib/module/components/sources/raster-source/RasterSource.js +4 -3
- package/lib/module/components/sources/raster-source/RasterSource.js.map +1 -1
- package/lib/module/components/sources/vector-source/VectorSource.js +9 -6
- package/lib/module/components/sources/vector-source/VectorSource.js.map +1 -1
- package/lib/module/components/user-location/NativeUserLocation.js.map +1 -1
- package/lib/module/components/user-location/UserLocation.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/modules/log/LogManager.js +5 -4
- package/lib/module/modules/log/LogManager.js.map +1 -1
- package/lib/module/modules/network/NativeNetworkModule.js.map +1 -1
- package/lib/module/modules/network/NetworkManager.js +6 -44
- package/lib/module/modules/network/NetworkManager.js.map +1 -1
- package/lib/module/modules/offline/OfflineManager.js +109 -62
- package/lib/module/modules/offline/OfflineManager.js.map +1 -1
- package/lib/module/modules/static-map/StaticMapManager.js +13 -5
- package/lib/module/modules/static-map/StaticMapManager.js.map +1 -1
- package/lib/module/modules/transform-request/NativeTransformRequestModule.js +5 -0
- package/lib/module/modules/transform-request/NativeTransformRequestModule.js.map +1 -0
- package/lib/module/modules/transform-request/TransformRequestManager.js +230 -0
- package/lib/module/modules/transform-request/TransformRequestManager.js.map +1 -0
- package/lib/module/plugin/ios.js +28 -15
- package/lib/module/plugin/ios.js.map +1 -1
- package/lib/module/types/Anchor.js +5 -6
- package/lib/module/types/Anchor.js.map +1 -1
- package/lib/module/types/PressableSourceProps.js.map +1 -0
- package/lib/module/utils/animated/AbstractAnimatedCoordinates.js +2 -2
- package/lib/module/utils/animated/AnimatedCoordinatesArray.js +6 -6
- package/lib/module/utils/animated/AnimatedGeoJSON.js +2 -1
- package/lib/module/utils/animated/AnimatedGeoJSON.js.map +1 -1
- package/lib/module/utils/animated/AnimatedRouteCoordinatesArray.js +6 -6
- package/lib/module/utils/convertStyleSpec.js +4 -4
- package/lib/module/utils/getStylePropertyType.js +1 -1
- package/lib/typescript/commonjs/components/annotations/LayerAnnotation.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/components → components}/annotations/callout/Callout.d.ts +3 -2
- package/lib/typescript/commonjs/components/annotations/callout/Callout.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/annotations/callout/CalloutNativeComponent.d.ts.map +1 -0
- package/lib/typescript/{module/src → commonjs}/components/annotations/marker/Marker.d.ts +29 -22
- package/lib/typescript/commonjs/components/annotations/marker/Marker.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/components → components}/annotations/marker/MarkerViewNativeComponent.d.ts +10 -0
- package/lib/typescript/commonjs/components/annotations/marker/MarkerViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/{module/src → commonjs}/components/annotations/view-annotation/PointAnnotationNativeComponent.d.ts +3 -2
- package/lib/typescript/commonjs/components/annotations/view-annotation/PointAnnotationNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/components → components}/annotations/view-annotation/ViewAnnotation.d.ts +35 -29
- package/lib/typescript/commonjs/components/annotations/view-annotation/ViewAnnotation.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/components → components}/camera/Camera.d.ts +85 -43
- package/lib/typescript/commonjs/components/camera/Camera.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/camera/CameraNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/camera/NativeCameraModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/components → components}/images/Images.d.ts +20 -12
- package/lib/typescript/commonjs/components/images/Images.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/images/ImagesNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/images/NativeImagesModule.d.ts +6 -0
- package/lib/typescript/commonjs/components/images/NativeImagesModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/components → components}/layer/Layer.d.ts +18 -8
- package/lib/typescript/commonjs/components/layer/Layer.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/layer/LayerNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/components → components}/map/AndroidTextureMapViewNativeComponent.d.ts +5 -1
- package/lib/typescript/commonjs/components/map/AndroidTextureMapViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/components → components}/map/Map.d.ts +151 -75
- package/lib/typescript/commonjs/components/map/Map.d.ts.map +1 -0
- package/lib/typescript/{module/src → commonjs}/components/map/MapViewNativeComponent.d.ts +5 -1
- package/lib/typescript/commonjs/components/map/MapViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/map/NativeMapViewModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/components → components}/sources/geojson-source/GeoJSONSource.d.ts +47 -44
- package/lib/typescript/commonjs/components/sources/geojson-source/GeoJSONSource.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/sources/geojson-source/GeoJSONSourceNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/sources/geojson-source/NativeGeoJSONSourceModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/components → components}/sources/image-source/ImageSource.d.ts +5 -3
- package/lib/typescript/commonjs/components/sources/image-source/ImageSource.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/sources/image-source/ImageSourceNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/components → components}/sources/raster-source/RasterSource.d.ts +20 -15
- package/lib/typescript/commonjs/components/sources/raster-source/RasterSource.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/sources/raster-source/RasterSourceNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/sources/vector-source/NativeVectorSourceModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/sources/vector-source/VectorSource.d.ts +75 -0
- package/lib/typescript/commonjs/components/sources/vector-source/VectorSource.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/sources/vector-source/VectorSourceNativeComponent.d.ts.map +1 -0
- package/lib/typescript/{module/src → commonjs}/components/user-location/NativeUserLocation.d.ts +9 -6
- package/lib/typescript/commonjs/components/user-location/NativeUserLocation.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/components → components}/user-location/UserLocation.d.ts +4 -2
- package/lib/typescript/commonjs/components/user-location/UserLocation.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/user-location/UserLocationNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/user-location/UserLocationPuck.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/user-location/UserLocationPuckHeading.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/hooks → hooks}/useCurrentPosition.d.ts +2 -2
- package/lib/typescript/commonjs/hooks/useCurrentPosition.d.ts.map +1 -0
- package/lib/typescript/commonjs/hooks/useFrozenId.d.ts.map +1 -0
- package/lib/typescript/commonjs/hooks/useNativeBridge.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/index.d.ts → index.d.ts} +3 -2
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/modules/location/LocationManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/modules/location/NativeLocationModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/modules → modules}/log/LogManager.d.ts +5 -4
- package/lib/typescript/commonjs/modules/log/LogManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/modules/log/NativeLogModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/modules → modules}/network/NativeNetworkModule.d.ts +0 -2
- package/lib/typescript/commonjs/modules/network/NativeNetworkModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/modules/network/NetworkManager.d.ts +24 -0
- package/lib/typescript/commonjs/modules/network/NetworkManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/modules/offline/NativeOfflineModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/modules → modules}/offline/OfflineManager.d.ts +110 -63
- package/lib/typescript/commonjs/modules/offline/OfflineManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/modules/offline/OfflinePack.d.ts.map +1 -0
- package/lib/typescript/commonjs/modules/static-map/NativeStaticMapModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/modules → modules}/static-map/StaticMapManager.d.ts +15 -7
- package/lib/typescript/commonjs/modules/static-map/StaticMapManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/modules/transform-request/NativeTransformRequestModule.d.ts +15 -0
- package/lib/typescript/commonjs/modules/transform-request/NativeTransformRequestModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/modules/transform-request/TransformRequestManager.d.ts +213 -0
- package/lib/typescript/commonjs/modules/transform-request/TransformRequestManager.d.ts.map +1 -0
- package/lib/typescript/{module/src → commonjs}/plugin/MapLibrePluginProps.d.ts +10 -15
- package/lib/typescript/commonjs/plugin/MapLibrePluginProps.d.ts.map +1 -0
- package/lib/typescript/commonjs/plugin/android.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/plugin → plugin}/ios.d.ts +2 -2
- package/lib/typescript/commonjs/plugin/ios.d.ts.map +1 -0
- package/lib/typescript/commonjs/plugin/withMapLibre.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/Anchor.d.ts +16 -0
- package/lib/typescript/commonjs/types/Anchor.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/BaseProps.d.ts +7 -0
- package/lib/typescript/commonjs/types/BaseProps.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/LngLat.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/types → types}/LngLatBounds.d.ts +2 -1
- package/lib/typescript/commonjs/types/LngLatBounds.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/types → types}/MapLibreRNStyles.d.ts +316 -132
- package/lib/typescript/commonjs/types/MapLibreRNStyles.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/PixelPoint.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/PixelPointBounds.d.ts.map +1 -0
- package/lib/typescript/{module/src → commonjs}/types/PressEvent.d.ts +3 -0
- package/lib/typescript/commonjs/types/PressEvent.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/types → types}/PressEventWithFeatures.d.ts +3 -0
- package/lib/typescript/commonjs/types/PressEventWithFeatures.d.ts.map +1 -0
- package/lib/typescript/{module/src/types/sources → commonjs/types}/PressableSourceProps.d.ts +6 -4
- package/lib/typescript/commonjs/types/PressableSourceProps.d.ts.map +1 -0
- package/lib/typescript/{module/src → commonjs}/types/ViewPadding.d.ts +3 -0
- package/lib/typescript/commonjs/types/ViewPadding.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/codegen/UnsafeMixed.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/BridgeValue.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/StyleValue.d.ts.map +1 -0
- package/lib/typescript/{module/src → commonjs}/utils/animated/AbstractAnimatedCoordinates.d.ts +2 -2
- package/lib/typescript/commonjs/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -0
- package/lib/typescript/{module/src → commonjs}/utils/animated/Animated.d.ts +1 -1
- package/lib/typescript/commonjs/utils/animated/Animated.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/utils → utils}/animated/AnimatedCoordinatesArray.d.ts +6 -6
- package/lib/typescript/commonjs/utils/animated/AnimatedCoordinatesArray.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/utils → utils}/animated/AnimatedGeoJSON.d.ts +2 -1
- package/lib/typescript/commonjs/utils/animated/AnimatedGeoJSON.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/animated/AnimatedPoint.d.ts.map +1 -0
- package/lib/typescript/commonjs/{src/utils → utils}/animated/AnimatedRouteCoordinatesArray.d.ts +6 -6
- package/lib/typescript/commonjs/utils/animated/AnimatedRouteCoordinatesArray.d.ts.map +1 -0
- package/lib/typescript/{module/src → commonjs}/utils/convertStyleSpec.d.ts +4 -4
- package/lib/typescript/commonjs/utils/convertStyleSpec.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/findNodeHandle.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/getNativeFilter.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/getStylePropertyType.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/index.d.ts.map +1 -0
- package/lib/typescript/module/components/annotations/LayerAnnotation.d.ts.map +1 -0
- package/lib/typescript/module/{src/components → components}/annotations/callout/Callout.d.ts +3 -2
- package/lib/typescript/module/components/annotations/callout/Callout.d.ts.map +1 -0
- package/lib/typescript/module/components/annotations/callout/CalloutNativeComponent.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src → module}/components/annotations/marker/Marker.d.ts +29 -22
- package/lib/typescript/module/components/annotations/marker/Marker.d.ts.map +1 -0
- package/lib/typescript/module/{src/components → components}/annotations/marker/MarkerViewNativeComponent.d.ts +10 -0
- package/lib/typescript/module/components/annotations/marker/MarkerViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src → module}/components/annotations/view-annotation/PointAnnotationNativeComponent.d.ts +3 -2
- package/lib/typescript/module/components/annotations/view-annotation/PointAnnotationNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/{src/components → components}/annotations/view-annotation/ViewAnnotation.d.ts +35 -29
- package/lib/typescript/module/components/annotations/view-annotation/ViewAnnotation.d.ts.map +1 -0
- package/lib/typescript/module/{src/components → components}/camera/Camera.d.ts +85 -43
- package/lib/typescript/module/components/camera/Camera.d.ts.map +1 -0
- package/lib/typescript/module/components/camera/CameraNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/components/camera/NativeCameraModule.d.ts.map +1 -0
- package/lib/typescript/module/{src/components → components}/images/Images.d.ts +20 -12
- package/lib/typescript/module/components/images/Images.d.ts.map +1 -0
- package/lib/typescript/module/components/images/ImagesNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/components/images/NativeImagesModule.d.ts +6 -0
- package/lib/typescript/module/components/images/NativeImagesModule.d.ts.map +1 -0
- package/lib/typescript/module/{src/components → components}/layer/Layer.d.ts +18 -8
- package/lib/typescript/module/components/layer/Layer.d.ts.map +1 -0
- package/lib/typescript/module/components/layer/LayerNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/{src/components → components}/map/AndroidTextureMapViewNativeComponent.d.ts +5 -1
- package/lib/typescript/module/components/map/AndroidTextureMapViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/{src/components → components}/map/Map.d.ts +151 -75
- package/lib/typescript/module/components/map/Map.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src → module}/components/map/MapViewNativeComponent.d.ts +5 -1
- package/lib/typescript/module/components/map/MapViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/components/map/NativeMapViewModule.d.ts.map +1 -0
- package/lib/typescript/module/{src/components → components}/sources/geojson-source/GeoJSONSource.d.ts +47 -44
- package/lib/typescript/module/components/sources/geojson-source/GeoJSONSource.d.ts.map +1 -0
- package/lib/typescript/module/components/sources/geojson-source/GeoJSONSourceNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/components/sources/geojson-source/NativeGeoJSONSourceModule.d.ts.map +1 -0
- package/lib/typescript/module/{src/components → components}/sources/image-source/ImageSource.d.ts +5 -3
- package/lib/typescript/module/components/sources/image-source/ImageSource.d.ts.map +1 -0
- package/lib/typescript/module/components/sources/image-source/ImageSourceNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/{src/components → components}/sources/raster-source/RasterSource.d.ts +20 -15
- package/lib/typescript/module/components/sources/raster-source/RasterSource.d.ts.map +1 -0
- package/lib/typescript/module/components/sources/raster-source/RasterSourceNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/components/sources/vector-source/NativeVectorSourceModule.d.ts.map +1 -0
- package/lib/typescript/module/components/sources/vector-source/VectorSource.d.ts +75 -0
- package/lib/typescript/module/components/sources/vector-source/VectorSource.d.ts.map +1 -0
- package/lib/typescript/module/components/sources/vector-source/VectorSourceNativeComponent.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src → module}/components/user-location/NativeUserLocation.d.ts +9 -6
- package/lib/typescript/module/components/user-location/NativeUserLocation.d.ts.map +1 -0
- package/lib/typescript/module/{src/components → components}/user-location/UserLocation.d.ts +4 -2
- package/lib/typescript/module/components/user-location/UserLocation.d.ts.map +1 -0
- package/lib/typescript/module/components/user-location/UserLocationNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/components/user-location/UserLocationPuck.d.ts.map +1 -0
- package/lib/typescript/module/components/user-location/UserLocationPuckHeading.d.ts.map +1 -0
- package/lib/typescript/module/{src/hooks → hooks}/useCurrentPosition.d.ts +2 -2
- package/lib/typescript/module/hooks/useCurrentPosition.d.ts.map +1 -0
- package/lib/typescript/module/hooks/useFrozenId.d.ts.map +1 -0
- package/lib/typescript/module/hooks/useNativeBridge.d.ts.map +1 -0
- package/lib/typescript/module/{src/index.d.ts → index.d.ts} +3 -2
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/modules/location/LocationManager.d.ts.map +1 -0
- package/lib/typescript/module/modules/location/NativeLocationModule.d.ts.map +1 -0
- package/lib/typescript/module/{src/modules → modules}/log/LogManager.d.ts +5 -4
- package/lib/typescript/module/modules/log/LogManager.d.ts.map +1 -0
- package/lib/typescript/module/modules/log/NativeLogModule.d.ts.map +1 -0
- package/lib/typescript/module/{src/modules → modules}/network/NativeNetworkModule.d.ts +0 -2
- package/lib/typescript/module/modules/network/NativeNetworkModule.d.ts.map +1 -0
- package/lib/typescript/module/modules/network/NetworkManager.d.ts +24 -0
- package/lib/typescript/module/modules/network/NetworkManager.d.ts.map +1 -0
- package/lib/typescript/module/modules/offline/NativeOfflineModule.d.ts.map +1 -0
- package/lib/typescript/module/{src/modules → modules}/offline/OfflineManager.d.ts +110 -63
- package/lib/typescript/module/modules/offline/OfflineManager.d.ts.map +1 -0
- package/lib/typescript/module/modules/offline/OfflinePack.d.ts.map +1 -0
- package/lib/typescript/module/modules/static-map/NativeStaticMapModule.d.ts.map +1 -0
- package/lib/typescript/module/{src/modules → modules}/static-map/StaticMapManager.d.ts +15 -7
- package/lib/typescript/module/modules/static-map/StaticMapManager.d.ts.map +1 -0
- package/lib/typescript/module/modules/transform-request/NativeTransformRequestModule.d.ts +15 -0
- package/lib/typescript/module/modules/transform-request/NativeTransformRequestModule.d.ts.map +1 -0
- package/lib/typescript/module/modules/transform-request/TransformRequestManager.d.ts +213 -0
- package/lib/typescript/module/modules/transform-request/TransformRequestManager.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src → module}/plugin/MapLibrePluginProps.d.ts +10 -15
- package/lib/typescript/module/plugin/MapLibrePluginProps.d.ts.map +1 -0
- package/lib/typescript/module/plugin/android.d.ts.map +1 -0
- package/lib/typescript/module/{src/plugin → plugin}/ios.d.ts +2 -2
- package/lib/typescript/module/plugin/ios.d.ts.map +1 -0
- package/lib/typescript/module/plugin/withMapLibre.d.ts.map +1 -0
- package/lib/typescript/module/types/Anchor.d.ts +16 -0
- package/lib/typescript/module/types/Anchor.d.ts.map +1 -0
- package/lib/typescript/module/types/BaseProps.d.ts +7 -0
- package/lib/typescript/module/types/BaseProps.d.ts.map +1 -0
- package/lib/typescript/module/types/LngLat.d.ts.map +1 -0
- package/lib/typescript/module/{src/types → types}/LngLatBounds.d.ts +2 -1
- package/lib/typescript/module/types/LngLatBounds.d.ts.map +1 -0
- package/lib/typescript/module/{src/types → types}/MapLibreRNStyles.d.ts +316 -132
- package/lib/typescript/module/types/MapLibreRNStyles.d.ts.map +1 -0
- package/lib/typescript/module/types/PixelPoint.d.ts.map +1 -0
- package/lib/typescript/module/types/PixelPointBounds.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src → module}/types/PressEvent.d.ts +3 -0
- package/lib/typescript/module/types/PressEvent.d.ts.map +1 -0
- package/lib/typescript/module/{src/types → types}/PressEventWithFeatures.d.ts +3 -0
- package/lib/typescript/module/types/PressEventWithFeatures.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src/types/sources → module/types}/PressableSourceProps.d.ts +6 -4
- package/lib/typescript/module/types/PressableSourceProps.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src → module}/types/ViewPadding.d.ts +3 -0
- package/lib/typescript/module/types/ViewPadding.d.ts.map +1 -0
- package/lib/typescript/module/types/codegen/UnsafeMixed.d.ts.map +1 -0
- package/lib/typescript/module/utils/BridgeValue.d.ts.map +1 -0
- package/lib/typescript/module/utils/StyleValue.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src → module}/utils/animated/AbstractAnimatedCoordinates.d.ts +2 -2
- package/lib/typescript/module/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src → module}/utils/animated/Animated.d.ts +1 -1
- package/lib/typescript/module/utils/animated/Animated.d.ts.map +1 -0
- package/lib/typescript/module/{src/utils → utils}/animated/AnimatedCoordinatesArray.d.ts +6 -6
- package/lib/typescript/module/utils/animated/AnimatedCoordinatesArray.d.ts.map +1 -0
- package/lib/typescript/module/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -0
- package/lib/typescript/module/{src/utils → utils}/animated/AnimatedGeoJSON.d.ts +2 -1
- package/lib/typescript/module/utils/animated/AnimatedGeoJSON.d.ts.map +1 -0
- package/lib/typescript/module/utils/animated/AnimatedPoint.d.ts.map +1 -0
- package/lib/typescript/module/{src/utils → utils}/animated/AnimatedRouteCoordinatesArray.d.ts +6 -6
- package/lib/typescript/module/utils/animated/AnimatedRouteCoordinatesArray.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src → module}/utils/convertStyleSpec.d.ts +4 -4
- package/lib/typescript/module/utils/convertStyleSpec.d.ts.map +1 -0
- package/lib/typescript/module/utils/findNodeHandle.d.ts.map +1 -0
- package/lib/typescript/module/utils/getNativeFilter.d.ts.map +1 -0
- package/lib/typescript/module/utils/getStylePropertyType.d.ts.map +1 -0
- package/lib/typescript/module/utils/index.d.ts.map +1 -0
- package/package.json +19 -40
- package/src/components/annotations/callout/Callout.tsx +3 -2
- package/src/components/annotations/marker/Marker.tsx +47 -30
- package/src/components/annotations/marker/MarkerViewNativeComponent.ts +10 -0
- package/src/components/annotations/view-annotation/PointAnnotationNativeComponent.ts +3 -2
- package/src/components/annotations/view-annotation/ViewAnnotation.tsx +53 -47
- package/src/components/camera/Camera.tsx +148 -110
- package/src/components/images/Images.tsx +20 -12
- package/src/components/images/NativeImagesModule.ts +11 -0
- package/src/components/layer/Layer.tsx +18 -8
- package/src/components/map/AndroidTextureMapViewNativeComponent.ts +7 -2
- package/src/components/map/Map.tsx +296 -229
- package/src/components/map/MapViewNativeComponent.ts +6 -1
- package/src/components/sources/geojson-source/GeoJSONSource.tsx +105 -103
- package/src/components/sources/image-source/ImageSource.tsx +5 -3
- package/src/components/sources/raster-source/RasterSource.tsx +20 -15
- package/src/components/sources/vector-source/VectorSource.tsx +66 -58
- package/src/components/user-location/NativeUserLocation.tsx +9 -6
- package/src/components/user-location/UserLocation.tsx +4 -2
- package/src/hooks/useCurrentPosition.ts +2 -2
- package/src/index.ts +12 -3
- package/src/modules/log/LogManager.ts +5 -4
- package/src/modules/network/NativeNetworkModule.ts +0 -4
- package/src/modules/network/NetworkManager.ts +6 -52
- package/src/modules/offline/OfflineManager.ts +109 -62
- package/src/modules/static-map/StaticMapManager.ts +15 -7
- package/src/modules/transform-request/NativeTransformRequestModule.ts +41 -0
- package/src/modules/transform-request/TransformRequestManager.ts +304 -0
- package/src/plugin/MapLibrePluginProps.ts +10 -15
- package/src/plugin/ios.ts +43 -21
- package/src/types/Anchor.ts +5 -6
- package/src/types/BaseProps.ts +3 -0
- package/src/types/LngLatBounds.ts +2 -1
- package/src/types/MapLibreRNStyles.ts +326 -192
- package/src/types/PressEvent.ts +3 -0
- package/src/types/PressEventWithFeatures.ts +3 -0
- package/src/types/{sources/PressableSourceProps.ts → PressableSourceProps.ts} +6 -4
- package/src/types/ViewPadding.ts +3 -0
- package/src/utils/animated/AbstractAnimatedCoordinates.ts +2 -2
- package/src/utils/animated/AnimatedCoordinatesArray.ts +6 -6
- package/src/utils/animated/AnimatedGeoJSON.ts +2 -1
- package/src/utils/animated/AnimatedRouteCoordinatesArray.ts +6 -6
- package/src/utils/convertStyleSpec.ts +4 -4
- package/src/utils/getStylePropertyType.ts +1 -1
- package/android/src/main/java/org/maplibre/reactnative/components/layer/style/MLRNStyle.java +0 -76
- package/android/src/main/java/org/maplibre/reactnative/components/layer/style/MLRNStyleFactory.java +0 -2285
- package/android/src/main/java/org/maplibre/reactnative/components/layer/style/MLRNStyleFunctionParser.java +0 -94
- package/android/src/main/java/org/maplibre/reactnative/components/layer/style/MLRNStyleValue.java +0 -207
- package/android/src/main/java/org/maplibre/reactnative/events/AndroidCallbackEvent.java +0 -34
- package/android/src/main/java/org/maplibre/reactnative/http/RequestHeadersInterceptor.kt +0 -65
- package/android/src/main/res/layout/annotation.xml +0 -17
- package/ios/modules/network/MLRNNetworkHTTPHeaders.h +0 -14
- package/ios/modules/network/MLRNNetworkHTTPHeaders.m +0 -97
- package/lib/commonjs/types/sources/PressableSourceProps.js.map +0 -1
- package/lib/module/types/sources/PressableSourceProps.js.map +0 -1
- package/lib/typescript/commonjs/src/components/annotations/LayerAnnotation.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/annotations/callout/Callout.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/annotations/callout/CalloutNativeComponent.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/annotations/marker/Marker.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/annotations/marker/MarkerViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/annotations/view-annotation/PointAnnotationNativeComponent.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/annotations/view-annotation/ViewAnnotation.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/camera/Camera.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/camera/CameraNativeComponent.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/camera/NativeCameraModule.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/images/Images.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/images/ImagesNativeComponent.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/layer/Layer.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/layer/LayerNativeComponent.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/map/AndroidTextureMapViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/map/Map.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/map/MapViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/map/NativeMapViewModule.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/sources/geojson-source/GeoJSONSource.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/sources/geojson-source/GeoJSONSourceNativeComponent.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/sources/geojson-source/NativeGeoJSONSourceModule.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/sources/image-source/ImageSource.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/sources/image-source/ImageSourceNativeComponent.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/sources/raster-source/RasterSource.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/sources/raster-source/RasterSourceNativeComponent.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/sources/vector-source/NativeVectorSourceModule.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/sources/vector-source/VectorSource.d.ts +0 -66
- package/lib/typescript/commonjs/src/components/sources/vector-source/VectorSource.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/sources/vector-source/VectorSourceNativeComponent.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/user-location/NativeUserLocation.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/user-location/UserLocation.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/user-location/UserLocationNativeComponent.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/user-location/UserLocationPuck.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/user-location/UserLocationPuckHeading.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/hooks/useCurrentPosition.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/hooks/useFrozenId.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/hooks/useNativeBridge.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/modules/location/LocationManager.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/modules/location/NativeLocationModule.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/modules/log/LogManager.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/modules/log/NativeLogModule.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/modules/network/NativeNetworkModule.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/modules/network/NetworkManager.d.ts +0 -56
- package/lib/typescript/commonjs/src/modules/network/NetworkManager.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/modules/offline/NativeOfflineModule.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/modules/offline/OfflineManager.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/modules/static-map/NativeStaticMapModule.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/modules/static-map/StaticMapManager.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/plugin/MapLibrePluginProps.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/plugin/android.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/plugin/ios.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/plugin/withMapLibre.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/Anchor.d.ts +0 -17
- package/lib/typescript/commonjs/src/types/Anchor.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/BaseProps.d.ts +0 -4
- package/lib/typescript/commonjs/src/types/BaseProps.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/LngLat.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/LngLatBounds.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/MapLibreRNStyles.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/PixelPoint.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/PixelPointBounds.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/PressEvent.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/PressEventWithFeatures.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/ViewPadding.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/codegen/UnsafeMixed.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/sources/PressableSourceProps.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/BridgeValue.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/StyleValue.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/animated/Animated.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedCoordinatesArray.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedGeoJSON.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/convertStyleSpec.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/findNodeHandle.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/getNativeFilter.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/getStylePropertyType.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/index.d.ts.map +0 -1
- package/lib/typescript/module/src/components/annotations/LayerAnnotation.d.ts.map +0 -1
- package/lib/typescript/module/src/components/annotations/callout/Callout.d.ts.map +0 -1
- package/lib/typescript/module/src/components/annotations/callout/CalloutNativeComponent.d.ts.map +0 -1
- package/lib/typescript/module/src/components/annotations/marker/Marker.d.ts.map +0 -1
- package/lib/typescript/module/src/components/annotations/marker/MarkerViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/module/src/components/annotations/view-annotation/PointAnnotationNativeComponent.d.ts.map +0 -1
- package/lib/typescript/module/src/components/annotations/view-annotation/ViewAnnotation.d.ts.map +0 -1
- package/lib/typescript/module/src/components/camera/Camera.d.ts.map +0 -1
- package/lib/typescript/module/src/components/camera/CameraNativeComponent.d.ts.map +0 -1
- package/lib/typescript/module/src/components/camera/NativeCameraModule.d.ts.map +0 -1
- package/lib/typescript/module/src/components/images/Images.d.ts.map +0 -1
- package/lib/typescript/module/src/components/images/ImagesNativeComponent.d.ts.map +0 -1
- package/lib/typescript/module/src/components/layer/Layer.d.ts.map +0 -1
- package/lib/typescript/module/src/components/layer/LayerNativeComponent.d.ts.map +0 -1
- package/lib/typescript/module/src/components/map/AndroidTextureMapViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/module/src/components/map/Map.d.ts.map +0 -1
- package/lib/typescript/module/src/components/map/MapViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/module/src/components/map/NativeMapViewModule.d.ts.map +0 -1
- package/lib/typescript/module/src/components/sources/geojson-source/GeoJSONSource.d.ts.map +0 -1
- package/lib/typescript/module/src/components/sources/geojson-source/GeoJSONSourceNativeComponent.d.ts.map +0 -1
- package/lib/typescript/module/src/components/sources/geojson-source/NativeGeoJSONSourceModule.d.ts.map +0 -1
- package/lib/typescript/module/src/components/sources/image-source/ImageSource.d.ts.map +0 -1
- package/lib/typescript/module/src/components/sources/image-source/ImageSourceNativeComponent.d.ts.map +0 -1
- package/lib/typescript/module/src/components/sources/raster-source/RasterSource.d.ts.map +0 -1
- package/lib/typescript/module/src/components/sources/raster-source/RasterSourceNativeComponent.d.ts.map +0 -1
- package/lib/typescript/module/src/components/sources/vector-source/NativeVectorSourceModule.d.ts.map +0 -1
- package/lib/typescript/module/src/components/sources/vector-source/VectorSource.d.ts +0 -66
- package/lib/typescript/module/src/components/sources/vector-source/VectorSource.d.ts.map +0 -1
- package/lib/typescript/module/src/components/sources/vector-source/VectorSourceNativeComponent.d.ts.map +0 -1
- package/lib/typescript/module/src/components/user-location/NativeUserLocation.d.ts.map +0 -1
- package/lib/typescript/module/src/components/user-location/UserLocation.d.ts.map +0 -1
- package/lib/typescript/module/src/components/user-location/UserLocationNativeComponent.d.ts.map +0 -1
- package/lib/typescript/module/src/components/user-location/UserLocationPuck.d.ts.map +0 -1
- package/lib/typescript/module/src/components/user-location/UserLocationPuckHeading.d.ts.map +0 -1
- package/lib/typescript/module/src/hooks/useCurrentPosition.d.ts.map +0 -1
- package/lib/typescript/module/src/hooks/useFrozenId.d.ts.map +0 -1
- package/lib/typescript/module/src/hooks/useNativeBridge.d.ts.map +0 -1
- package/lib/typescript/module/src/index.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/location/LocationManager.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/location/NativeLocationModule.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/log/LogManager.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/log/NativeLogModule.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/network/NativeNetworkModule.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/network/NetworkManager.d.ts +0 -56
- package/lib/typescript/module/src/modules/network/NetworkManager.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/offline/NativeOfflineModule.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/offline/OfflineManager.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/static-map/NativeStaticMapModule.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/static-map/StaticMapManager.d.ts.map +0 -1
- package/lib/typescript/module/src/plugin/MapLibrePluginProps.d.ts.map +0 -1
- package/lib/typescript/module/src/plugin/android.d.ts.map +0 -1
- package/lib/typescript/module/src/plugin/ios.d.ts.map +0 -1
- package/lib/typescript/module/src/plugin/withMapLibre.d.ts.map +0 -1
- package/lib/typescript/module/src/types/Anchor.d.ts +0 -17
- package/lib/typescript/module/src/types/Anchor.d.ts.map +0 -1
- package/lib/typescript/module/src/types/BaseProps.d.ts +0 -4
- package/lib/typescript/module/src/types/BaseProps.d.ts.map +0 -1
- package/lib/typescript/module/src/types/LngLat.d.ts.map +0 -1
- package/lib/typescript/module/src/types/LngLatBounds.d.ts.map +0 -1
- package/lib/typescript/module/src/types/MapLibreRNStyles.d.ts.map +0 -1
- package/lib/typescript/module/src/types/PixelPoint.d.ts.map +0 -1
- package/lib/typescript/module/src/types/PixelPointBounds.d.ts.map +0 -1
- package/lib/typescript/module/src/types/PressEvent.d.ts.map +0 -1
- package/lib/typescript/module/src/types/PressEventWithFeatures.d.ts.map +0 -1
- package/lib/typescript/module/src/types/ViewPadding.d.ts.map +0 -1
- package/lib/typescript/module/src/types/codegen/UnsafeMixed.d.ts.map +0 -1
- package/lib/typescript/module/src/types/sources/PressableSourceProps.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/BridgeValue.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/StyleValue.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/animated/Animated.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/animated/AnimatedCoordinatesArray.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/animated/AnimatedGeoJSON.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/animated/AnimatedRouteCoordinatesArray.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/convertStyleSpec.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/findNodeHandle.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/getNativeFilter.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/getStylePropertyType.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/index.d.ts.map +0 -1
- /package/android/src/main/res/drawable-xxhdpi/{red_marker.png → default_marker.png} +0 -0
- /package/ios/{components/images → utils}/MLRNImageUtils.h +0 -0
- /package/ios/{components/images → utils}/MLRNImageUtils.m +0 -0
- /package/lib/commonjs/types/{sources/PressableSourceProps.js → PressableSourceProps.js} +0 -0
- /package/lib/module/types/{sources/PressableSourceProps.js → PressableSourceProps.js} +0 -0
- /package/lib/typescript/commonjs/{src/components → components}/annotations/LayerAnnotation.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/components → components}/annotations/callout/CalloutNativeComponent.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/components → components}/camera/CameraNativeComponent.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/components → components}/camera/NativeCameraModule.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/components → components}/images/ImagesNativeComponent.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/components → components}/layer/LayerNativeComponent.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/components → components}/map/NativeMapViewModule.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/components → components}/sources/geojson-source/GeoJSONSourceNativeComponent.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/components → components}/sources/geojson-source/NativeGeoJSONSourceModule.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/components → components}/sources/image-source/ImageSourceNativeComponent.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/components → components}/sources/raster-source/RasterSourceNativeComponent.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/components → components}/sources/vector-source/NativeVectorSourceModule.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/components → components}/sources/vector-source/VectorSourceNativeComponent.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/components → components}/user-location/UserLocationNativeComponent.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/components → components}/user-location/UserLocationPuck.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/components → components}/user-location/UserLocationPuckHeading.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/hooks → hooks}/useFrozenId.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/hooks → hooks}/useNativeBridge.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/modules → modules}/location/LocationManager.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/modules → modules}/location/NativeLocationModule.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/modules → modules}/log/NativeLogModule.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/modules → modules}/offline/NativeOfflineModule.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/modules → modules}/offline/OfflinePack.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/modules → modules}/static-map/NativeStaticMapModule.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/plugin → plugin}/android.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/plugin → plugin}/withMapLibre.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/types → types}/LngLat.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/types → types}/PixelPoint.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/types → types}/PixelPointBounds.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/types → types}/codegen/UnsafeMixed.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/utils → utils}/BridgeValue.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/utils → utils}/StyleValue.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/utils → utils}/animated/AnimatedExtractCoordinateFromArray.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/utils → utils}/animated/AnimatedPoint.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/utils → utils}/findNodeHandle.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/utils → utils}/getNativeFilter.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/utils → utils}/getStylePropertyType.d.ts +0 -0
- /package/lib/typescript/commonjs/{src/utils → utils}/index.d.ts +0 -0
- /package/lib/typescript/module/{src/components → components}/annotations/LayerAnnotation.d.ts +0 -0
- /package/lib/typescript/module/{src/components → components}/annotations/callout/CalloutNativeComponent.d.ts +0 -0
- /package/lib/typescript/module/{src/components → components}/camera/CameraNativeComponent.d.ts +0 -0
- /package/lib/typescript/module/{src/components → components}/camera/NativeCameraModule.d.ts +0 -0
- /package/lib/typescript/module/{src/components → components}/images/ImagesNativeComponent.d.ts +0 -0
- /package/lib/typescript/module/{src/components → components}/layer/LayerNativeComponent.d.ts +0 -0
- /package/lib/typescript/module/{src/components → components}/map/NativeMapViewModule.d.ts +0 -0
- /package/lib/typescript/module/{src/components → components}/sources/geojson-source/GeoJSONSourceNativeComponent.d.ts +0 -0
- /package/lib/typescript/module/{src/components → components}/sources/geojson-source/NativeGeoJSONSourceModule.d.ts +0 -0
- /package/lib/typescript/module/{src/components → components}/sources/image-source/ImageSourceNativeComponent.d.ts +0 -0
- /package/lib/typescript/module/{src/components → components}/sources/raster-source/RasterSourceNativeComponent.d.ts +0 -0
- /package/lib/typescript/module/{src/components → components}/sources/vector-source/NativeVectorSourceModule.d.ts +0 -0
- /package/lib/typescript/module/{src/components → components}/sources/vector-source/VectorSourceNativeComponent.d.ts +0 -0
- /package/lib/typescript/module/{src/components → components}/user-location/UserLocationNativeComponent.d.ts +0 -0
- /package/lib/typescript/module/{src/components → components}/user-location/UserLocationPuck.d.ts +0 -0
- /package/lib/typescript/module/{src/components → components}/user-location/UserLocationPuckHeading.d.ts +0 -0
- /package/lib/typescript/module/{src/hooks → hooks}/useFrozenId.d.ts +0 -0
- /package/lib/typescript/module/{src/hooks → hooks}/useNativeBridge.d.ts +0 -0
- /package/lib/typescript/module/{src/modules → modules}/location/LocationManager.d.ts +0 -0
- /package/lib/typescript/module/{src/modules → modules}/location/NativeLocationModule.d.ts +0 -0
- /package/lib/typescript/module/{src/modules → modules}/log/NativeLogModule.d.ts +0 -0
- /package/lib/typescript/module/{src/modules → modules}/offline/NativeOfflineModule.d.ts +0 -0
- /package/lib/typescript/module/{src/modules → modules}/offline/OfflinePack.d.ts +0 -0
- /package/lib/typescript/module/{src/modules → modules}/static-map/NativeStaticMapModule.d.ts +0 -0
- /package/lib/typescript/module/{src/plugin → plugin}/android.d.ts +0 -0
- /package/lib/typescript/module/{src/plugin → plugin}/withMapLibre.d.ts +0 -0
- /package/lib/typescript/module/{src/types → types}/LngLat.d.ts +0 -0
- /package/lib/typescript/module/{src/types → types}/PixelPoint.d.ts +0 -0
- /package/lib/typescript/module/{src/types → types}/PixelPointBounds.d.ts +0 -0
- /package/lib/typescript/module/{src/types → types}/codegen/UnsafeMixed.d.ts +0 -0
- /package/lib/typescript/module/{src/utils → utils}/BridgeValue.d.ts +0 -0
- /package/lib/typescript/module/{src/utils → utils}/StyleValue.d.ts +0 -0
- /package/lib/typescript/module/{src/utils → utils}/animated/AnimatedExtractCoordinateFromArray.d.ts +0 -0
- /package/lib/typescript/module/{src/utils → utils}/animated/AnimatedPoint.d.ts +0 -0
- /package/lib/typescript/module/{src/utils → utils}/findNodeHandle.d.ts +0 -0
- /package/lib/typescript/module/{src/utils → utils}/getNativeFilter.d.ts +0 -0
- /package/lib/typescript/module/{src/utils → utils}/getStylePropertyType.d.ts +0 -0
- /package/lib/typescript/module/{src/utils → utils}/index.d.ts +0 -0
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
package org.maplibre.reactnative.modules
|
|
2
2
|
|
|
3
|
-
import android.util.Log
|
|
4
3
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
5
4
|
import com.facebook.react.module.annotations.ReactModule
|
|
6
|
-
import okhttp3.Dispatcher
|
|
7
|
-
import okhttp3.OkHttpClient
|
|
8
5
|
import org.maplibre.android.MapLibre
|
|
9
|
-
import org.maplibre.android.module.http.HttpRequestUtil
|
|
10
6
|
import org.maplibre.reactnative.NativeNetworkModuleSpec
|
|
11
|
-
import org.maplibre.reactnative.http.RequestHeadersInterceptor
|
|
12
7
|
|
|
13
8
|
@ReactModule(name = MLRNNetworkModule.NAME)
|
|
14
9
|
class MLRNNetworkModule(
|
|
@@ -16,52 +11,15 @@ class MLRNNetworkModule(
|
|
|
16
11
|
) : NativeNetworkModuleSpec(reactContext) {
|
|
17
12
|
companion object {
|
|
18
13
|
const val NAME = "MLRNNetworkModule"
|
|
19
|
-
private var requestHeadersInterceptorAdded = false
|
|
20
14
|
}
|
|
21
15
|
|
|
22
16
|
override fun getName() = NAME
|
|
23
17
|
|
|
24
18
|
private val context: ReactApplicationContext = reactContext
|
|
25
19
|
|
|
26
|
-
override fun addRequestHeader(
|
|
27
|
-
name: String,
|
|
28
|
-
value: String,
|
|
29
|
-
match: String?,
|
|
30
|
-
) {
|
|
31
|
-
context.runOnUiQueueThread {
|
|
32
|
-
if (!requestHeadersInterceptorAdded) {
|
|
33
|
-
Log.i("MLRNNetworkModule", "Add interceptor")
|
|
34
|
-
val httpClient =
|
|
35
|
-
OkHttpClient
|
|
36
|
-
.Builder()
|
|
37
|
-
.addInterceptor(RequestHeadersInterceptor.INSTANCE)
|
|
38
|
-
.dispatcher(getDispatcher())
|
|
39
|
-
.build()
|
|
40
|
-
HttpRequestUtil.setOkHttpClient(httpClient)
|
|
41
|
-
requestHeadersInterceptorAdded = true
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
RequestHeadersInterceptor.INSTANCE.addHeader(name, value, match)
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
override fun removeRequestHeader(name: String) {
|
|
49
|
-
context.runOnUiQueueThread {
|
|
50
|
-
RequestHeadersInterceptor.INSTANCE.removeHeader(name)
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
20
|
override fun setConnected(connected: Boolean) {
|
|
55
21
|
context.runOnUiQueueThread {
|
|
56
22
|
MapLibre.setConnected(connected)
|
|
57
23
|
}
|
|
58
24
|
}
|
|
59
|
-
|
|
60
|
-
private fun getDispatcher(): Dispatcher {
|
|
61
|
-
val dispatcher = Dispatcher()
|
|
62
|
-
// Matches core limit set on
|
|
63
|
-
// https://github.com/mapbox/mapbox-gl-native/blob/master/platform/android/src/http_file_source.cpp#L192
|
|
64
|
-
dispatcher.maxRequestsPerHost = 20
|
|
65
|
-
return dispatcher
|
|
66
|
-
}
|
|
67
25
|
}
|
|
@@ -36,6 +36,8 @@ class MLRNOfflineModule(
|
|
|
36
36
|
private val context: Context = reactContext.applicationContext
|
|
37
37
|
private var progressEventThrottle = 300.0
|
|
38
38
|
|
|
39
|
+
private val regions = HashMap<String, OfflineRegion>()
|
|
40
|
+
|
|
39
41
|
override fun initialize() {
|
|
40
42
|
Handler(Looper.getMainLooper()).post {
|
|
41
43
|
runMigrations()
|
|
@@ -72,12 +74,14 @@ class MLRNOfflineModule(
|
|
|
72
74
|
metadataBytes,
|
|
73
75
|
object : OfflineManager.CreateOfflineRegionCallback {
|
|
74
76
|
override fun onCreate(offlineRegion: OfflineRegion) {
|
|
77
|
+
regions[packId] = offlineRegion
|
|
75
78
|
val pack = fromOfflineRegion(offlineRegion)
|
|
76
79
|
promise.resolve(pack)
|
|
77
80
|
setOfflineRegionObserver(packId, offlineRegion)
|
|
78
81
|
}
|
|
79
82
|
|
|
80
83
|
override fun onError(error: String) {
|
|
84
|
+
promise.reject("createPack", error)
|
|
81
85
|
emitOnError(makeErrorPayload(packId, error))
|
|
82
86
|
Log.e(NAME, "createPack error: $error")
|
|
83
87
|
}
|
|
@@ -165,6 +169,7 @@ class MLRNOfflineModule(
|
|
|
165
169
|
offlineManager.resetDatabase(
|
|
166
170
|
object : OfflineManager.FileSourceCallback {
|
|
167
171
|
override fun onSuccess() {
|
|
172
|
+
clearRegions()
|
|
168
173
|
promise.resolve(null)
|
|
169
174
|
}
|
|
170
175
|
|
|
@@ -231,6 +236,7 @@ class MLRNOfflineModule(
|
|
|
231
236
|
val hasRegion = region != null
|
|
232
237
|
|
|
233
238
|
if (hasRegion) {
|
|
239
|
+
regions[id] = region
|
|
234
240
|
setOfflineRegionObserver(id, region)
|
|
235
241
|
}
|
|
236
242
|
|
|
@@ -254,7 +260,7 @@ class MLRNOfflineModule(
|
|
|
254
260
|
offlineManager.listOfflineRegions(
|
|
255
261
|
object : OfflineManager.ListOfflineRegionsCallback {
|
|
256
262
|
override fun onList(offlineRegions: Array<OfflineRegion>?) {
|
|
257
|
-
val region = getRegionById(id, offlineRegions)
|
|
263
|
+
val region = regions[id] ?: getRegionById(id, offlineRegions)
|
|
258
264
|
|
|
259
265
|
if (region == null) {
|
|
260
266
|
promise.resolve(null)
|
|
@@ -292,7 +298,7 @@ class MLRNOfflineModule(
|
|
|
292
298
|
offlineManager.listOfflineRegions(
|
|
293
299
|
object : OfflineManager.ListOfflineRegionsCallback {
|
|
294
300
|
override fun onList(offlineRegions: Array<OfflineRegion>?) {
|
|
295
|
-
val region = getRegionById(id, offlineRegions)
|
|
301
|
+
val region = regions[id] ?: getRegionById(id, offlineRegions)
|
|
296
302
|
|
|
297
303
|
if (region == null) {
|
|
298
304
|
promise.resolve(null)
|
|
@@ -304,6 +310,7 @@ class MLRNOfflineModule(
|
|
|
304
310
|
region.delete(
|
|
305
311
|
object : OfflineRegion.OfflineRegionDeleteCallback {
|
|
306
312
|
override fun onDelete() {
|
|
313
|
+
regions.remove(id)
|
|
307
314
|
promise.resolve(null)
|
|
308
315
|
}
|
|
309
316
|
|
|
@@ -331,7 +338,7 @@ class MLRNOfflineModule(
|
|
|
331
338
|
offlineManager.listOfflineRegions(
|
|
332
339
|
object : OfflineManager.ListOfflineRegionsCallback {
|
|
333
340
|
override fun onList(offlineRegions: Array<OfflineRegion>?) {
|
|
334
|
-
val offlineRegion = getRegionById(id, offlineRegions)
|
|
341
|
+
val offlineRegion = regions[id] ?: getRegionById(id, offlineRegions)
|
|
335
342
|
|
|
336
343
|
if (offlineRegion == null) {
|
|
337
344
|
promise.reject("pauseRegionDownload", "Unknown offline region")
|
|
@@ -361,7 +368,8 @@ class MLRNOfflineModule(
|
|
|
361
368
|
offlineManager.listOfflineRegions(
|
|
362
369
|
object : OfflineManager.ListOfflineRegionsCallback {
|
|
363
370
|
override fun onList(offlineRegions: Array<OfflineRegion>?) {
|
|
364
|
-
val offlineRegion =
|
|
371
|
+
val offlineRegion =
|
|
372
|
+
regions[id] ?: getRegionById(id, offlineRegions)?.also { regions[id] = it }
|
|
365
373
|
|
|
366
374
|
if (offlineRegion == null) {
|
|
367
375
|
promise.reject("resumeRegionDownload", "Unknown offline region")
|
|
@@ -631,8 +639,23 @@ class MLRNOfflineModule(
|
|
|
631
639
|
return null
|
|
632
640
|
}
|
|
633
641
|
|
|
642
|
+
override fun invalidate() {
|
|
643
|
+
Handler(Looper.getMainLooper()).post {
|
|
644
|
+
clearRegions()
|
|
645
|
+
}
|
|
646
|
+
super.invalidate()
|
|
647
|
+
}
|
|
648
|
+
|
|
634
649
|
private fun activateFileSource() {
|
|
635
650
|
val fileSource = FileSource.getInstance(context)
|
|
636
651
|
fileSource.activate()
|
|
637
652
|
}
|
|
653
|
+
|
|
654
|
+
private fun clearRegions() {
|
|
655
|
+
for (region in regions.values) {
|
|
656
|
+
region.setDownloadState(OfflineRegion.STATE_INACTIVE)
|
|
657
|
+
region.setObserver(null)
|
|
658
|
+
}
|
|
659
|
+
regions.clear()
|
|
660
|
+
}
|
|
638
661
|
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
package org.maplibre.reactnative.modules
|
|
2
|
+
|
|
3
|
+
import android.util.Log
|
|
4
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
5
|
+
import com.facebook.react.module.annotations.ReactModule
|
|
6
|
+
import okhttp3.Dispatcher
|
|
7
|
+
import okhttp3.OkHttpClient
|
|
8
|
+
import org.maplibre.android.module.http.HttpRequestUtil
|
|
9
|
+
import org.maplibre.reactnative.NativeTransformRequestModuleSpec
|
|
10
|
+
|
|
11
|
+
@ReactModule(name = MLRNTransformRequestModule.NAME)
|
|
12
|
+
class MLRNTransformRequestModule(
|
|
13
|
+
reactContext: ReactApplicationContext,
|
|
14
|
+
) : NativeTransformRequestModuleSpec(reactContext) {
|
|
15
|
+
companion object {
|
|
16
|
+
const val NAME = "MLRNTransformRequestModule"
|
|
17
|
+
|
|
18
|
+
private var transformRequestInterceptorAdded = false
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
override fun getName() = NAME
|
|
22
|
+
|
|
23
|
+
override fun initialize() {
|
|
24
|
+
reactApplicationContext.getNativeModule(MLRNLogModule::class.java)?.let { logModule ->
|
|
25
|
+
TransformRequestInterceptor.INSTANCE.jsLogger = { level, tag, message ->
|
|
26
|
+
logModule.onLog(level, tag, message)
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
private fun ensureInterceptorAdded() {
|
|
32
|
+
if (!transformRequestInterceptorAdded) {
|
|
33
|
+
Log.i(NAME, "Add interceptor")
|
|
34
|
+
val httpClient =
|
|
35
|
+
OkHttpClient
|
|
36
|
+
.Builder()
|
|
37
|
+
.addInterceptor(TransformRequestInterceptor.INSTANCE)
|
|
38
|
+
.dispatcher(getDispatcher())
|
|
39
|
+
.build()
|
|
40
|
+
HttpRequestUtil.setOkHttpClient(httpClient)
|
|
41
|
+
transformRequestInterceptorAdded = true
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
override fun addUrlTransform(
|
|
46
|
+
id: String,
|
|
47
|
+
match: String?,
|
|
48
|
+
find: String,
|
|
49
|
+
replace: String,
|
|
50
|
+
) {
|
|
51
|
+
requireValidRegex(match, "addUrlTransform", "match")
|
|
52
|
+
requireValidRegex(find, "addUrlTransform", "find")
|
|
53
|
+
reactApplicationContext.runOnUiQueueThread {
|
|
54
|
+
ensureInterceptorAdded()
|
|
55
|
+
TransformRequestInterceptor.INSTANCE.addUrlTransform(id, match, find, replace)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
override fun removeUrlTransform(id: String) {
|
|
60
|
+
reactApplicationContext.runOnUiQueueThread {
|
|
61
|
+
TransformRequestInterceptor.INSTANCE.removeUrlTransform(id)
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
override fun clearUrlTransforms() {
|
|
66
|
+
reactApplicationContext.runOnUiQueueThread {
|
|
67
|
+
TransformRequestInterceptor.INSTANCE.clearUrlTransforms()
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
override fun addUrlSearchParam(
|
|
72
|
+
id: String,
|
|
73
|
+
match: String?,
|
|
74
|
+
key: String,
|
|
75
|
+
value: String,
|
|
76
|
+
) {
|
|
77
|
+
requireValidRegex(match, "addUrlSearchParam", "match")
|
|
78
|
+
reactApplicationContext.runOnUiQueueThread {
|
|
79
|
+
ensureInterceptorAdded()
|
|
80
|
+
TransformRequestInterceptor.INSTANCE.addUrlSearchParam(id, match, key, value)
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
override fun removeUrlSearchParam(id: String) {
|
|
85
|
+
reactApplicationContext.runOnUiQueueThread {
|
|
86
|
+
TransformRequestInterceptor.INSTANCE.removeUrlSearchParam(id)
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
override fun clearUrlSearchParams() {
|
|
91
|
+
reactApplicationContext.runOnUiQueueThread {
|
|
92
|
+
TransformRequestInterceptor.INSTANCE.clearUrlSearchParams()
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
override fun addHeader(
|
|
97
|
+
id: String,
|
|
98
|
+
match: String?,
|
|
99
|
+
name: String,
|
|
100
|
+
value: String,
|
|
101
|
+
) {
|
|
102
|
+
requireValidRegex(match, "addHeader", "match")
|
|
103
|
+
reactApplicationContext.runOnUiQueueThread {
|
|
104
|
+
ensureInterceptorAdded()
|
|
105
|
+
TransformRequestInterceptor.INSTANCE.addHeader(id, match, name, value)
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
override fun removeHeader(id: String) {
|
|
110
|
+
reactApplicationContext.runOnUiQueueThread {
|
|
111
|
+
TransformRequestInterceptor.INSTANCE.removeHeader(id)
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
override fun clearHeaders() {
|
|
116
|
+
reactApplicationContext.runOnUiQueueThread {
|
|
117
|
+
TransformRequestInterceptor.INSTANCE.clearHeaders()
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
private fun requireValidRegex(
|
|
122
|
+
pattern: String?,
|
|
123
|
+
methodName: String,
|
|
124
|
+
fieldName: String,
|
|
125
|
+
) {
|
|
126
|
+
if (pattern != null) {
|
|
127
|
+
try {
|
|
128
|
+
Regex(pattern)
|
|
129
|
+
} catch (e: Exception) {
|
|
130
|
+
throw IllegalArgumentException(
|
|
131
|
+
"[$NAME] $methodName: invalid $fieldName regex '$pattern': ${e.message}",
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
private fun getDispatcher(): Dispatcher {
|
|
138
|
+
val dispatcher = Dispatcher()
|
|
139
|
+
// Matches core limit set on
|
|
140
|
+
// https://github.com/mapbox/mapbox-gl-native/blob/master/platform/android/src/http_file_source.cpp#L192
|
|
141
|
+
dispatcher.maxRequestsPerHost = 20
|
|
142
|
+
return dispatcher
|
|
143
|
+
}
|
|
144
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
package org.maplibre.reactnative.modules
|
|
2
|
+
|
|
3
|
+
import android.util.Log
|
|
4
|
+
import okhttp3.HttpUrl
|
|
5
|
+
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
|
|
6
|
+
import okhttp3.Interceptor
|
|
7
|
+
import okhttp3.Response
|
|
8
|
+
import java.io.IOException
|
|
9
|
+
import kotlin.collections.iterator
|
|
10
|
+
|
|
11
|
+
data class UrlTransformConfig(
|
|
12
|
+
val matchRegex: Regex?,
|
|
13
|
+
val findRegex: Regex,
|
|
14
|
+
val replace: String,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
data class UrlSearchParamConfig(
|
|
18
|
+
val matchRegex: Regex?,
|
|
19
|
+
val name: String,
|
|
20
|
+
val value: String,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
data class HeaderConfig(
|
|
24
|
+
val matchRegex: Regex?,
|
|
25
|
+
val name: String,
|
|
26
|
+
val value: String,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
class TransformRequestInterceptor : Interceptor {
|
|
30
|
+
private val urlTransforms: LinkedHashMap<String, UrlTransformConfig> = LinkedHashMap()
|
|
31
|
+
private val urlSearchParams: LinkedHashMap<String, UrlSearchParamConfig> = LinkedHashMap()
|
|
32
|
+
private val headers: LinkedHashMap<String, HeaderConfig> = LinkedHashMap()
|
|
33
|
+
|
|
34
|
+
@Volatile
|
|
35
|
+
var jsLogger: ((level: String, tag: String, message: String) -> Unit)? = null
|
|
36
|
+
|
|
37
|
+
private fun debugLog(message: String) {
|
|
38
|
+
if (Log.isLoggable(TAG, Log.DEBUG)) {
|
|
39
|
+
Log.d(TAG, message)
|
|
40
|
+
}
|
|
41
|
+
jsLogger?.invoke("debug", TAG, message)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
private fun errorLog(message: String) {
|
|
45
|
+
Log.e(TAG, message)
|
|
46
|
+
jsLogger?.invoke("error", TAG, message)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
fun addUrlTransform(
|
|
50
|
+
id: String,
|
|
51
|
+
match: String?,
|
|
52
|
+
find: String,
|
|
53
|
+
replace: String,
|
|
54
|
+
) {
|
|
55
|
+
urlTransforms[id] = UrlTransformConfig(match?.let { Regex(it) }, Regex(find), replace)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
fun removeUrlTransform(id: String) {
|
|
59
|
+
urlTransforms.remove(id)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
fun clearUrlTransforms() {
|
|
63
|
+
urlTransforms.clear()
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
fun addUrlSearchParam(
|
|
67
|
+
id: String,
|
|
68
|
+
match: String?,
|
|
69
|
+
name: String,
|
|
70
|
+
value: String,
|
|
71
|
+
) {
|
|
72
|
+
urlSearchParams[id] = UrlSearchParamConfig(match?.let { Regex(it) }, name, value)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
fun removeUrlSearchParam(id: String) {
|
|
76
|
+
urlSearchParams.remove(id)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
fun clearUrlSearchParams() {
|
|
80
|
+
urlSearchParams.clear()
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
fun addHeader(
|
|
84
|
+
id: String,
|
|
85
|
+
match: String?,
|
|
86
|
+
name: String,
|
|
87
|
+
value: String,
|
|
88
|
+
) {
|
|
89
|
+
headers[id] = HeaderConfig(match?.let { Regex(it) }, name, value)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
fun removeHeader(id: String) {
|
|
93
|
+
headers.remove(id)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
fun clearHeaders() {
|
|
97
|
+
headers.clear()
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@Throws(IOException::class)
|
|
101
|
+
override fun intercept(chain: Interceptor.Chain): Response {
|
|
102
|
+
var request = chain.request()
|
|
103
|
+
|
|
104
|
+
val hasConfig = urlTransforms.isNotEmpty() || urlSearchParams.isNotEmpty() || headers.isNotEmpty()
|
|
105
|
+
if (hasConfig) {
|
|
106
|
+
debugLog("Request: ${request.url}")
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// 1. URL transforms
|
|
110
|
+
var currentUrl = request.url.toString()
|
|
111
|
+
for ((transformId, config) in urlTransforms) {
|
|
112
|
+
val urlBeforeTransform = currentUrl
|
|
113
|
+
val shouldApply = config.matchRegex == null || config.matchRegex.containsMatchIn(currentUrl)
|
|
114
|
+
|
|
115
|
+
if (!shouldApply) {
|
|
116
|
+
debugLog(" URL Transform [$transformId]${matchDescription(config.matchRegex)}: SKIPPED (no match)")
|
|
117
|
+
continue
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
val result = config.findRegex.replace(currentUrl, config.replace)
|
|
121
|
+
if (result.toHttpUrlOrNull() == null) {
|
|
122
|
+
errorLog(
|
|
123
|
+
"URL Transform [$transformId]${matchDescription(config.matchRegex)}: produced invalid URL '$result', " +
|
|
124
|
+
"using pre-transform URL",
|
|
125
|
+
)
|
|
126
|
+
} else {
|
|
127
|
+
debugLog(
|
|
128
|
+
" URL Transform [$transformId]${matchDescription(config.matchRegex)}: APPLIED '$urlBeforeTransform' → '$result'",
|
|
129
|
+
)
|
|
130
|
+
currentUrl = result
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// 2. URL search params
|
|
135
|
+
var modifiedUrl: HttpUrl = currentUrl.toHttpUrlOrNull() ?: request.url
|
|
136
|
+
for (entry in urlSearchParams.entries) {
|
|
137
|
+
val config = entry.value
|
|
138
|
+
val shouldApply =
|
|
139
|
+
config.matchRegex == null || config.matchRegex.containsMatchIn(modifiedUrl.toString())
|
|
140
|
+
|
|
141
|
+
if (shouldApply) {
|
|
142
|
+
debugLog(
|
|
143
|
+
" URL Search Param [${entry.key}]${matchDescription(config.matchRegex)}: APPLIED '${config.name}=${config.value}'",
|
|
144
|
+
)
|
|
145
|
+
modifiedUrl =
|
|
146
|
+
modifiedUrl
|
|
147
|
+
.newBuilder()
|
|
148
|
+
.setQueryParameter(config.name, config.value)
|
|
149
|
+
.build()
|
|
150
|
+
} else {
|
|
151
|
+
debugLog(" URL Search Param [${entry.key}]${matchDescription(config.matchRegex)}: SKIPPED (no match)")
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// 3. Headers
|
|
156
|
+
val requestBuilder = request.newBuilder().url(modifiedUrl)
|
|
157
|
+
for (entry in headers.entries) {
|
|
158
|
+
val config = entry.value
|
|
159
|
+
val shouldApply =
|
|
160
|
+
config.matchRegex == null || config.matchRegex.containsMatchIn(modifiedUrl.toString())
|
|
161
|
+
|
|
162
|
+
if (shouldApply) {
|
|
163
|
+
debugLog(" Header [${entry.key}]${matchDescription(config.matchRegex)}: APPLIED '${config.name}: ${config.value}'")
|
|
164
|
+
requestBuilder.header(config.name, config.value)
|
|
165
|
+
} else {
|
|
166
|
+
debugLog(" Header [${entry.key}]${matchDescription(config.matchRegex)}: SKIPPED (no match)")
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (hasConfig) {
|
|
171
|
+
debugLog("Final URL: $modifiedUrl")
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
request = requestBuilder.build()
|
|
175
|
+
return chain.proceed(request)
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
companion object {
|
|
179
|
+
val INSTANCE: TransformRequestInterceptor = TransformRequestInterceptor()
|
|
180
|
+
private const val TAG = "TransformRequestInterceptor"
|
|
181
|
+
|
|
182
|
+
private fun matchDescription(matchRegex: Regex?) = if (matchRegex != null) " (match='${matchRegex.pattern}')" else ""
|
|
183
|
+
}
|
|
184
|
+
}
|
|
@@ -20,8 +20,9 @@
|
|
|
20
20
|
@property (nonatomic, copy) NSDictionary<NSString *, NSNumber *> *anchor;
|
|
21
21
|
@property (nonatomic, copy) NSDictionary<NSString *, NSNumber *> *offset;
|
|
22
22
|
|
|
23
|
-
@property (nonatomic, copy) void (^
|
|
24
|
-
@property (nonatomic, copy) void (^
|
|
23
|
+
@property (nonatomic, copy) void (^reactOnPress)(NSDictionary *event);
|
|
24
|
+
@property (nonatomic, copy) void (^reactOnSelect)(NSDictionary *event);
|
|
25
|
+
@property (nonatomic, copy) void (^reactOnDeselect)(NSDictionary *event);
|
|
25
26
|
@property (nonatomic, copy) void (^reactOnDragStart)(NSDictionary *event);
|
|
26
27
|
@property (nonatomic, copy) void (^reactOnDrag)(NSDictionary *event);
|
|
27
28
|
@property (nonatomic, copy) void (^reactOnDragEnd)(NSDictionary *event);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#import "MLRNPointAnnotation.h"
|
|
2
2
|
#import <React/UIView+React.h>
|
|
3
3
|
#import "MLRNMapTouchEvent.h"
|
|
4
|
+
#import "MLRNMapView.h"
|
|
4
5
|
#import "MLRNUtils.h"
|
|
5
6
|
|
|
6
7
|
const float CENTER_X_OFFSET_BASE = -0.5f;
|
|
@@ -8,6 +9,9 @@ const float CENTER_Y_OFFSET_BASE = -0.5f;
|
|
|
8
9
|
|
|
9
10
|
@implementation MLRNPointAnnotation {
|
|
10
11
|
UITapGestureRecognizer *customViewTap;
|
|
12
|
+
// Finger-to-anchor offset to preserve the touch position relative to the annotation's anchor
|
|
13
|
+
CGPoint _dragFingerOffset;
|
|
14
|
+
BOOL _dragFingerOffsetCaptured;
|
|
11
15
|
}
|
|
12
16
|
|
|
13
17
|
- (id)init {
|
|
@@ -36,6 +40,11 @@ const float CENTER_Y_OFFSET_BASE = -0.5f;
|
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
- (void)reactSetFrame:(CGRect)frame {
|
|
43
|
+
// Skip frame updates while dragging
|
|
44
|
+
if (self.dragState != MLNAnnotationViewDragStateNone) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
39
48
|
if ([_map.annotations containsObject:self]) {
|
|
40
49
|
[_map removeAnnotation:self];
|
|
41
50
|
}
|
|
@@ -54,6 +63,36 @@ const float CENTER_Y_OFFSET_BASE = -0.5f;
|
|
|
54
63
|
[self _setCenterOffset:self.frame];
|
|
55
64
|
}
|
|
56
65
|
|
|
66
|
+
- (void)setCenter:(CGPoint)center {
|
|
67
|
+
// Reset drag offset tracking whenever we're not in a drag
|
|
68
|
+
if (self.dragState == MLNAnnotationViewDragStateNone) {
|
|
69
|
+
_dragFingerOffsetCaptured = NO;
|
|
70
|
+
[super setCenter:center];
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (_map != nil) {
|
|
75
|
+
CGPoint coordPoint = [_map convertCoordinate:self.coordinate toPointToView:_map];
|
|
76
|
+
|
|
77
|
+
// Reject map-redraw resets: MapLibre re-projects annotations from their
|
|
78
|
+
// coordinate on every redraw, snapping the view back mid-drag.
|
|
79
|
+
if (fabs(center.x - coordPoint.x) < 0.5 && fabs(center.y - coordPoint.y) < 0.5) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Capture the finger-to-anchor offset so the view doesn't snap its center
|
|
84
|
+
// to the touch point, preserving where the user grabbed relative to the anchor.
|
|
85
|
+
if (!_dragFingerOffsetCaptured) {
|
|
86
|
+
_dragFingerOffset = CGPointMake(center.x - coordPoint.x, center.y - coordPoint.y);
|
|
87
|
+
_dragFingerOffsetCaptured = YES;
|
|
88
|
+
}
|
|
89
|
+
center.x -= _dragFingerOffset.x;
|
|
90
|
+
center.y -= _dragFingerOffset.y;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[super setCenter:center];
|
|
94
|
+
}
|
|
95
|
+
|
|
57
96
|
- (void)setMap:(MLNMapView *)map {
|
|
58
97
|
if (map == nil) {
|
|
59
98
|
[_map removeAnnotation:self];
|
|
@@ -75,6 +114,9 @@ const float CENTER_Y_OFFSET_BASE = -0.5f;
|
|
|
75
114
|
_reactSelected = reactSelected;
|
|
76
115
|
|
|
77
116
|
if (_map != nil) {
|
|
117
|
+
if ([_map isKindOfClass:[MLRNMapView class]]) {
|
|
118
|
+
((MLRNMapView *)_map).annotationSelected = YES;
|
|
119
|
+
}
|
|
78
120
|
if (_reactSelected) {
|
|
79
121
|
[_map selectAnnotation:self animated:NO completionHandler:nil];
|
|
80
122
|
} else {
|
|
@@ -120,8 +162,22 @@ const float CENTER_Y_OFFSET_BASE = -0.5f;
|
|
|
120
162
|
BOOL hasCustomChildren = (self.reactSubviews.count > 0) || (self.customChildCount > 0);
|
|
121
163
|
|
|
122
164
|
if (!hasCustomChildren) {
|
|
123
|
-
//
|
|
124
|
-
|
|
165
|
+
// Replicate MLNMapView's to allow unified tap/selection behavior.
|
|
166
|
+
NSBundle *mapLibreBundle = [NSBundle bundleForClass:[MLNMapView class]];
|
|
167
|
+
UIImage *pinImage = [UIImage imageNamed:@"default_marker"
|
|
168
|
+
inBundle:mapLibreBundle
|
|
169
|
+
compatibleWithTraitCollection:nil];
|
|
170
|
+
|
|
171
|
+
UIImageView *pinImageView = [[UIImageView alloc] initWithImage:pinImage];
|
|
172
|
+
[pinImageView sizeToFit];
|
|
173
|
+
|
|
174
|
+
MLNAnnotationView *defaultView = [[MLNAnnotationView alloc] initWithReuseIdentifier:nil];
|
|
175
|
+
defaultView.bounds = pinImageView.bounds;
|
|
176
|
+
[defaultView addSubview:pinImageView];
|
|
177
|
+
defaultView.centerOffset = CGVectorMake(0, 0);
|
|
178
|
+
defaultView.enabled = YES;
|
|
179
|
+
[defaultView addGestureRecognizer:customViewTap];
|
|
180
|
+
return defaultView;
|
|
125
181
|
} else {
|
|
126
182
|
// custom view
|
|
127
183
|
self.enabled = YES;
|
|
@@ -133,6 +189,7 @@ const float CENTER_Y_OFFSET_BASE = -0.5f;
|
|
|
133
189
|
}
|
|
134
190
|
}
|
|
135
191
|
[self addGestureRecognizer:customViewTap];
|
|
192
|
+
self.annotation = self;
|
|
136
193
|
return self;
|
|
137
194
|
}
|
|
138
195
|
}
|
|
@@ -143,6 +200,12 @@ const float CENTER_Y_OFFSET_BASE = -0.5f;
|
|
|
143
200
|
}
|
|
144
201
|
|
|
145
202
|
- (void)_handleTap:(UITapGestureRecognizer *)recognizer {
|
|
203
|
+
if ([_map isKindOfClass:[MLRNMapView class]]) {
|
|
204
|
+
((MLRNMapView *)_map).annotationSelected = YES;
|
|
205
|
+
}
|
|
206
|
+
if (self.reactOnPress != nil) {
|
|
207
|
+
self.reactOnPress([self makeEventPayload]);
|
|
208
|
+
}
|
|
146
209
|
[_map selectAnnotation:self animated:NO completionHandler:nil];
|
|
147
210
|
}
|
|
148
211
|
|