@rnmapbox/maps 10.1.39 → 10.1.41-rc.2

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.
Files changed (233) hide show
  1. package/android/build.gradle +14 -2
  2. package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXMarkerView.kt +1 -1
  3. package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXMarkerViewManager.kt +11 -1
  4. package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXPointAnnotationManager.kt +7 -1
  5. package/android/src/main/java/com/rnmapbox/rnmbx/components/camera/RNMBXCameraManager.kt +25 -4
  6. package/android/src/main/java/com/rnmapbox/rnmbx/components/camera/RNMBXCameraModule.kt +65 -2
  7. package/android/src/main/java/com/rnmapbox/rnmbx/components/camera/RNMBXViewport.kt +4 -4
  8. package/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImagesManager.kt +30 -4
  9. package/android/src/main/java/com/rnmapbox/rnmbx/components/location/RNMBXCustomLocationProviderManager.kt +4 -0
  10. package/android/src/main/java/com/rnmapbox/rnmbx/components/location/RNMBXNativeUserLocation.kt +1 -1
  11. package/android/src/main/java/com/rnmapbox/rnmbx/components/location/RNMBXNativeUserLocationManager.kt +8 -2
  12. package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapViewManager.kt +59 -10
  13. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/RNMBXStyleImportManager.kt +6 -1
  14. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/RNMBXStyleValue.kt +9 -5
  15. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/layers/RNMBXModelLayer.kt +5 -1
  16. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/layers/RNMBXModelLayerManager.kt +1 -0
  17. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXRasterSourceManager.kt +3 -2
  18. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXShapeSourceManager.kt +19 -4
  19. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXTileSourceManager.kt +8 -3
  20. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXVectorSourceManager.kt +7 -1
  21. package/android/src/main/java/com/rnmapbox/rnmbx/modules/RNMBXLocationModule.kt +7 -5
  22. package/android/src/main/java/com/rnmapbox/rnmbx/utils/extensions/Dynamic.kt +27 -3
  23. package/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/Annotation.kt +5 -1
  24. package/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXCameraModuleSpec.java +8 -0
  25. package/ios/RNMBX/RNMBXCamera.swift +64 -3
  26. package/ios/RNMBX/RNMBXCameraModule.mm +26 -1
  27. package/ios/RNMBX/RNMBXMarkerViewComponentView.mm +11 -16
  28. package/ios/RNMBX/RNMBXShapeSource.swift +2 -4
  29. package/ios/RNMBX/RNMBXShapeSourceComponentView.mm +1 -1
  30. package/ios/RNMBX/RNMBXShapeSourceViewManager.m +1 -1
  31. package/ios/RNMBX/RNMBXVectorSourceComponentView.mm +1 -1
  32. package/ios/install.md +1 -1
  33. package/lib/commonjs/components/Camera.js +29 -1
  34. package/lib/commonjs/components/Camera.js.map +1 -1
  35. package/lib/commonjs/components/NativeBridgeComponent.js +41 -0
  36. package/lib/commonjs/components/NativeBridgeComponent.js.map +1 -0
  37. package/lib/commonjs/modules/location/locationManager.js +3 -1
  38. package/lib/commonjs/modules/location/locationManager.js.map +1 -1
  39. package/lib/commonjs/plugin/build/generateCode.js +5 -6
  40. package/lib/commonjs/plugin/install.md +2 -2
  41. package/lib/commonjs/specs/NativeMapViewModule.js +10 -0
  42. package/lib/commonjs/specs/NativeMapViewModule.js.map +1 -0
  43. package/lib/commonjs/specs/NativeRNMBXCameraModule.js +10 -0
  44. package/lib/commonjs/specs/NativeRNMBXCameraModule.js.map +1 -0
  45. package/lib/commonjs/specs/NativeRNMBXChangeLineOffsetsShapeAnimatorModule.js +10 -0
  46. package/lib/commonjs/specs/NativeRNMBXChangeLineOffsetsShapeAnimatorModule.js.map +1 -0
  47. package/lib/commonjs/specs/NativeRNMBXImageModule.js +10 -0
  48. package/lib/commonjs/specs/NativeRNMBXImageModule.js.map +1 -0
  49. package/lib/commonjs/specs/NativeRNMBXLocationModule.js +9 -0
  50. package/lib/commonjs/specs/NativeRNMBXLocationModule.js.map +1 -0
  51. package/lib/commonjs/specs/NativeRNMBXMovePointShapeAnimatorModule.js +10 -0
  52. package/lib/commonjs/specs/NativeRNMBXMovePointShapeAnimatorModule.js.map +1 -0
  53. package/lib/commonjs/specs/NativeRNMBXPointAnnotationModule.js +10 -0
  54. package/lib/commonjs/specs/NativeRNMBXPointAnnotationModule.js.map +1 -0
  55. package/lib/commonjs/specs/NativeRNMBXShapeSourceModule.js +10 -0
  56. package/lib/commonjs/specs/NativeRNMBXShapeSourceModule.js.map +1 -0
  57. package/lib/commonjs/specs/NativeRNMBXTileStoreModule.js +11 -0
  58. package/lib/commonjs/specs/NativeRNMBXTileStoreModule.js.map +1 -0
  59. package/lib/commonjs/specs/NativeRNMBXViewportModule.js +10 -0
  60. package/lib/commonjs/specs/NativeRNMBXViewportModule.js.map +1 -0
  61. package/lib/commonjs/utils/NativeCommands.js +50 -0
  62. package/lib/commonjs/utils/NativeCommands.js.map +1 -0
  63. package/lib/{module/utils/nativeRef.ts → commonjs/utils/nativeRef.js} +8 -9
  64. package/lib/commonjs/utils/nativeRef.js.map +1 -0
  65. package/lib/module/components/Camera.js +29 -1
  66. package/lib/module/components/Camera.js.map +1 -1
  67. package/lib/module/components/NativeBridgeComponent.js +37 -0
  68. package/lib/module/components/NativeBridgeComponent.js.map +1 -0
  69. package/lib/module/modules/location/locationManager.js +3 -1
  70. package/lib/module/modules/location/locationManager.js.map +1 -1
  71. package/lib/module/specs/NativeMapViewModule.js +7 -0
  72. package/lib/module/specs/NativeMapViewModule.js.map +1 -0
  73. package/lib/module/specs/NativeRNMBXCameraModule.js +8 -0
  74. package/lib/module/specs/NativeRNMBXCameraModule.js.map +1 -0
  75. package/lib/module/specs/NativeRNMBXChangeLineOffsetsShapeAnimatorModule.js +8 -0
  76. package/lib/module/specs/NativeRNMBXChangeLineOffsetsShapeAnimatorModule.js.map +1 -0
  77. package/lib/module/specs/NativeRNMBXImageModule.js +7 -0
  78. package/lib/module/specs/NativeRNMBXImageModule.js.map +1 -0
  79. package/lib/module/specs/NativeRNMBXLocationModule.js +5 -0
  80. package/lib/module/specs/NativeRNMBXLocationModule.js.map +1 -0
  81. package/lib/module/specs/NativeRNMBXMovePointShapeAnimatorModule.js +8 -0
  82. package/lib/module/specs/NativeRNMBXMovePointShapeAnimatorModule.js.map +1 -0
  83. package/lib/module/specs/NativeRNMBXPointAnnotationModule.js +7 -0
  84. package/lib/module/specs/NativeRNMBXPointAnnotationModule.js.map +1 -0
  85. package/lib/module/specs/NativeRNMBXShapeSourceModule.js +7 -0
  86. package/lib/module/specs/NativeRNMBXShapeSourceModule.js.map +1 -0
  87. package/lib/module/specs/NativeRNMBXTileStoreModule.js +10 -0
  88. package/lib/module/specs/NativeRNMBXTileStoreModule.js.map +1 -0
  89. package/lib/module/specs/NativeRNMBXViewportModule.js +8 -0
  90. package/lib/module/specs/NativeRNMBXViewportModule.js.map +1 -0
  91. package/lib/module/utils/NativeCommands.js +45 -0
  92. package/lib/module/utils/NativeCommands.js.map +1 -0
  93. package/lib/{commonjs/utils/nativeRef.ts → module/utils/nativeRef.js} +4 -9
  94. package/lib/module/utils/nativeRef.js.map +1 -0
  95. package/lib/typescript/src/Mapbox.d.ts +0 -1
  96. package/lib/typescript/src/Mapbox.d.ts.map +1 -1
  97. package/lib/typescript/src/RNMBXModule.d.ts +1 -1
  98. package/lib/typescript/src/RNMBXModule.d.ts.map +1 -1
  99. package/lib/typescript/src/components/AbstractLayer.d.ts.map +1 -1
  100. package/lib/typescript/src/components/Camera.d.ts +20 -0
  101. package/lib/typescript/src/components/Camera.d.ts.map +1 -1
  102. package/lib/typescript/src/components/HeadingIndicator.d.ts.map +1 -1
  103. package/lib/typescript/src/components/Light.d.ts.map +1 -1
  104. package/lib/typescript/src/components/MapView.d.ts +4 -3
  105. package/lib/typescript/src/components/MapView.d.ts.map +1 -1
  106. package/lib/typescript/src/components/NativeBridgeComponent.d.ts +4 -4
  107. package/lib/typescript/src/components/NativeBridgeComponent.d.ts.map +1 -1
  108. package/lib/typescript/src/components/PointAnnotation.d.ts +4 -3
  109. package/lib/typescript/src/components/PointAnnotation.d.ts.map +1 -1
  110. package/lib/typescript/src/components/ShapeSource.d.ts +4 -3
  111. package/lib/typescript/src/components/ShapeSource.d.ts.map +1 -1
  112. package/lib/typescript/src/components/Style.d.ts.map +1 -1
  113. package/lib/typescript/src/modules/location/locationManager.d.ts.map +1 -1
  114. package/lib/typescript/src/specs/NativeMapViewModule.d.ts +0 -1
  115. package/lib/typescript/src/specs/NativeMapViewModule.d.ts.map +1 -1
  116. package/lib/typescript/src/specs/NativeRNMBXCameraModule.d.ts +3 -3
  117. package/lib/typescript/src/specs/NativeRNMBXCameraModule.d.ts.map +1 -1
  118. package/lib/typescript/src/specs/NativeRNMBXChangeLineOffsetsShapeAnimatorModule.d.ts +0 -1
  119. package/lib/typescript/src/specs/NativeRNMBXChangeLineOffsetsShapeAnimatorModule.d.ts.map +1 -1
  120. package/lib/typescript/src/specs/NativeRNMBXImageModule.d.ts +0 -1
  121. package/lib/typescript/src/specs/NativeRNMBXImageModule.d.ts.map +1 -1
  122. package/lib/typescript/src/specs/NativeRNMBXLocationModule.d.ts +0 -1
  123. package/lib/typescript/src/specs/NativeRNMBXLocationModule.d.ts.map +1 -1
  124. package/lib/typescript/src/specs/NativeRNMBXMovePointShapeAnimatorModule.d.ts +0 -1
  125. package/lib/typescript/src/specs/NativeRNMBXMovePointShapeAnimatorModule.d.ts.map +1 -1
  126. package/lib/typescript/src/specs/NativeRNMBXPointAnnotationModule.d.ts +0 -1
  127. package/lib/typescript/src/specs/NativeRNMBXPointAnnotationModule.d.ts.map +1 -1
  128. package/lib/typescript/src/specs/NativeRNMBXShapeSourceModule.d.ts +0 -1
  129. package/lib/typescript/src/specs/NativeRNMBXShapeSourceModule.d.ts.map +1 -1
  130. package/lib/typescript/src/specs/NativeRNMBXTileStoreModule.d.ts +0 -1
  131. package/lib/typescript/src/specs/NativeRNMBXTileStoreModule.d.ts.map +1 -1
  132. package/lib/typescript/src/specs/NativeRNMBXViewportModule.d.ts +0 -1
  133. package/lib/typescript/src/specs/NativeRNMBXViewportModule.d.ts.map +1 -1
  134. package/lib/typescript/src/specs/RNMBXAtmosphereNativeComponent.d.ts.map +1 -1
  135. package/lib/typescript/src/specs/RNMBXBackgroundLayerNativeComponent.d.ts +0 -1
  136. package/lib/typescript/src/specs/RNMBXBackgroundLayerNativeComponent.d.ts.map +1 -1
  137. package/lib/typescript/src/specs/RNMBXCalloutNativeComponent.d.ts.map +1 -1
  138. package/lib/typescript/src/specs/RNMBXCameraNativeComponent.d.ts +0 -1
  139. package/lib/typescript/src/specs/RNMBXCameraNativeComponent.d.ts.map +1 -1
  140. package/lib/typescript/src/specs/RNMBXCircleLayerNativeComponent.d.ts +0 -1
  141. package/lib/typescript/src/specs/RNMBXCircleLayerNativeComponent.d.ts.map +1 -1
  142. package/lib/typescript/src/specs/RNMBXCustomLocationProviderNativeComponent.d.ts +0 -1
  143. package/lib/typescript/src/specs/RNMBXCustomLocationProviderNativeComponent.d.ts.map +1 -1
  144. package/lib/typescript/src/specs/RNMBXFillExtrusionLayerNativeComponent.d.ts +0 -1
  145. package/lib/typescript/src/specs/RNMBXFillExtrusionLayerNativeComponent.d.ts.map +1 -1
  146. package/lib/typescript/src/specs/RNMBXFillLayerNativeComponent.d.ts +0 -1
  147. package/lib/typescript/src/specs/RNMBXFillLayerNativeComponent.d.ts.map +1 -1
  148. package/lib/typescript/src/specs/RNMBXHeatmapLayerNativeComponent.d.ts +0 -1
  149. package/lib/typescript/src/specs/RNMBXHeatmapLayerNativeComponent.d.ts.map +1 -1
  150. package/lib/typescript/src/specs/RNMBXImageNativeComponent.d.ts +0 -1
  151. package/lib/typescript/src/specs/RNMBXImageNativeComponent.d.ts.map +1 -1
  152. package/lib/typescript/src/specs/RNMBXImageSourceNativeComponent.d.ts.map +1 -1
  153. package/lib/typescript/src/specs/RNMBXImagesNativeComponent.d.ts +0 -1
  154. package/lib/typescript/src/specs/RNMBXImagesNativeComponent.d.ts.map +1 -1
  155. package/lib/typescript/src/specs/RNMBXLightNativeComponent.d.ts.map +1 -1
  156. package/lib/typescript/src/specs/RNMBXLineLayerNativeComponent.d.ts +0 -1
  157. package/lib/typescript/src/specs/RNMBXLineLayerNativeComponent.d.ts.map +1 -1
  158. package/lib/typescript/src/specs/RNMBXMapViewNativeComponent.d.ts +0 -1
  159. package/lib/typescript/src/specs/RNMBXMapViewNativeComponent.d.ts.map +1 -1
  160. package/lib/typescript/src/specs/RNMBXMarkerViewContentNativeComponent.d.ts.map +1 -1
  161. package/lib/typescript/src/specs/RNMBXMarkerViewNativeComponent.d.ts +0 -1
  162. package/lib/typescript/src/specs/RNMBXMarkerViewNativeComponent.d.ts.map +1 -1
  163. package/lib/typescript/src/specs/RNMBXModelLayerNativeComponent.d.ts +0 -1
  164. package/lib/typescript/src/specs/RNMBXModelLayerNativeComponent.d.ts.map +1 -1
  165. package/lib/typescript/src/specs/RNMBXModelsNativeComponent.d.ts.map +1 -1
  166. package/lib/typescript/src/specs/RNMBXNativeUserLocationNativeComponent.d.ts.map +1 -1
  167. package/lib/typescript/src/specs/RNMBXPointAnnotationNativeComponent.d.ts +0 -1
  168. package/lib/typescript/src/specs/RNMBXPointAnnotationNativeComponent.d.ts.map +1 -1
  169. package/lib/typescript/src/specs/RNMBXRasterDemSourceNativeComponent.d.ts +0 -1
  170. package/lib/typescript/src/specs/RNMBXRasterDemSourceNativeComponent.d.ts.map +1 -1
  171. package/lib/typescript/src/specs/RNMBXRasterLayerNativeComponent.d.ts +0 -1
  172. package/lib/typescript/src/specs/RNMBXRasterLayerNativeComponent.d.ts.map +1 -1
  173. package/lib/typescript/src/specs/RNMBXRasterSourceNativeComponent.d.ts +0 -1
  174. package/lib/typescript/src/specs/RNMBXRasterSourceNativeComponent.d.ts.map +1 -1
  175. package/lib/typescript/src/specs/RNMBXShapeSourceNativeComponent.d.ts +0 -1
  176. package/lib/typescript/src/specs/RNMBXShapeSourceNativeComponent.d.ts.map +1 -1
  177. package/lib/typescript/src/specs/RNMBXSkyLayerNativeComponent.d.ts +0 -1
  178. package/lib/typescript/src/specs/RNMBXSkyLayerNativeComponent.d.ts.map +1 -1
  179. package/lib/typescript/src/specs/RNMBXStyleImportNativeComponent.d.ts.map +1 -1
  180. package/lib/typescript/src/specs/RNMBXSymbolLayerNativeComponent.d.ts +0 -1
  181. package/lib/typescript/src/specs/RNMBXSymbolLayerNativeComponent.d.ts.map +1 -1
  182. package/lib/typescript/src/specs/RNMBXTerrainNativeComponent.d.ts.map +1 -1
  183. package/lib/typescript/src/specs/RNMBXVectorSourceNativeComponent.d.ts +0 -1
  184. package/lib/typescript/src/specs/RNMBXVectorSourceNativeComponent.d.ts.map +1 -1
  185. package/lib/typescript/src/specs/RNMBXViewportNativeComponent.d.ts +0 -1
  186. package/lib/typescript/src/specs/RNMBXViewportNativeComponent.d.ts.map +1 -1
  187. package/lib/typescript/src/specs/codegenUtils.d.ts +1 -2
  188. package/lib/typescript/src/specs/codegenUtils.d.ts.map +1 -1
  189. package/lib/typescript/src/utils/BridgeValue.d.ts.map +1 -1
  190. package/lib/typescript/src/utils/NativeCommands.d.ts +0 -1
  191. package/lib/typescript/src/utils/NativeCommands.d.ts.map +1 -1
  192. package/lib/typescript/src/utils/getAnnotationsLayerID.d.ts +1 -1
  193. package/lib/typescript/src/utils/getAnnotationsLayerID.d.ts.map +1 -1
  194. package/lib/typescript/src/web/MapContext.d.ts +1 -1
  195. package/lib/typescript/src/web/MapContext.d.ts.map +1 -1
  196. package/lib/typescript/src/web/components/Camera.d.ts +2 -2
  197. package/lib/typescript/src/web/components/Camera.d.ts.map +1 -1
  198. package/package.json +5 -5
  199. package/plugin/build/generateCode.js +5 -6
  200. package/plugin/install.md +2 -2
  201. package/rnmapbox-maps.podspec +1 -1
  202. package/src/components/Camera.tsx +83 -1
  203. package/src/modules/location/locationManager.ts +3 -1
  204. package/src/specs/NativeRNMBXCameraModule.ts +16 -3
  205. package/src/specs/codegenUtils.ts +1 -1
  206. package/src/web/components/Camera.tsx +1 -1
  207. package/CHANGELOG.md +0 -390
  208. package/android/.gitignore +0 -9
  209. package/android/.npmignore +0 -9
  210. package/lib/commonjs/components/NativeBridgeComponent.tsx +0 -67
  211. package/lib/commonjs/specs/NativeMapViewModule.ts +0 -54
  212. package/lib/commonjs/specs/NativeRNMBXCameraModule.ts +0 -36
  213. package/lib/commonjs/specs/NativeRNMBXChangeLineOffsetsShapeAnimatorModule.ts +0 -37
  214. package/lib/commonjs/specs/NativeRNMBXImageModule.ts +0 -10
  215. package/lib/commonjs/specs/NativeRNMBXLocationModule.ts +0 -32
  216. package/lib/commonjs/specs/NativeRNMBXMovePointShapeAnimatorModule.ts +0 -20
  217. package/lib/commonjs/specs/NativeRNMBXPointAnnotationModule.ts +0 -12
  218. package/lib/commonjs/specs/NativeRNMBXShapeSourceModule.ts +0 -23
  219. package/lib/commonjs/specs/NativeRNMBXTileStoreModule.ts +0 -27
  220. package/lib/commonjs/specs/NativeRNMBXViewportModule.ts +0 -41
  221. package/lib/commonjs/utils/NativeCommands.ts +0 -89
  222. package/lib/module/components/NativeBridgeComponent.tsx +0 -67
  223. package/lib/module/specs/NativeMapViewModule.ts +0 -54
  224. package/lib/module/specs/NativeRNMBXCameraModule.ts +0 -36
  225. package/lib/module/specs/NativeRNMBXChangeLineOffsetsShapeAnimatorModule.ts +0 -37
  226. package/lib/module/specs/NativeRNMBXImageModule.ts +0 -10
  227. package/lib/module/specs/NativeRNMBXLocationModule.ts +0 -32
  228. package/lib/module/specs/NativeRNMBXMovePointShapeAnimatorModule.ts +0 -20
  229. package/lib/module/specs/NativeRNMBXPointAnnotationModule.ts +0 -12
  230. package/lib/module/specs/NativeRNMBXShapeSourceModule.ts +0 -23
  231. package/lib/module/specs/NativeRNMBXTileStoreModule.ts +0 -27
  232. package/lib/module/specs/NativeRNMBXViewportModule.ts +0 -41
  233. package/lib/module/utils/NativeCommands.ts +0 -89
@@ -61,7 +61,13 @@ const nativeAnimationMode = (
61
61
 
62
62
  // Native module types.
63
63
 
64
- type NativeAnimationMode = 'flight' | 'ease' | 'linear' | 'none' | 'move';
64
+ type FLIGHT = 1;
65
+ type EASE = 2;
66
+ type LINEAR = 3;
67
+ type MOVE = 4;
68
+ type NONE = 5;
69
+
70
+ type NativeAnimationMode = FLIGHT | EASE | LINEAR | MOVE | NONE;
65
71
 
66
72
  interface NativeCameraProps extends CameraFollowConfig {
67
73
  testID?: string;
@@ -100,6 +106,31 @@ export interface CameraRef {
100
106
  flyTo: (centerCoordinate: Position, animationDuration?: number) => void;
101
107
  moveTo: (centerCoordinate: Position, animationDuration?: number) => void;
102
108
  zoomTo: (zoomLevel: number, animationDuration?: number) => void;
109
+ moveBy: (
110
+ props:
111
+ | { x: number; y: number }
112
+ | {
113
+ x: number;
114
+ y: number;
115
+ animationMode: 'easeTo' | 'linearTo';
116
+ animationDuration: number;
117
+ },
118
+ ) => void;
119
+ scaleBy: (
120
+ props:
121
+ | {
122
+ x: number;
123
+ y: number;
124
+ scaleFactor: number;
125
+ }
126
+ | {
127
+ x: number;
128
+ y: number;
129
+ scaleFactor: number;
130
+ animationMode: 'easeTo' | 'linearTo';
131
+ animationDuration: number;
132
+ },
133
+ ) => void;
103
134
  }
104
135
 
105
136
  export type CameraStop = {
@@ -520,6 +551,35 @@ export const Camera = memo(
520
551
  };
521
552
  const zoomTo = useCallback(_zoomTo, [setCamera]);
522
553
 
554
+ const moveBy: CameraRef['moveBy'] = useCallback(
555
+ (
556
+ moveProps,
557
+ ) => {
558
+ commands.call<void>('moveBy', [
559
+ moveProps.x,
560
+ moveProps.y,
561
+ 'animationMode' in moveProps ? nativeAnimationMode(moveProps.animationMode) : nativeAnimationMode('linearTo'),
562
+ 'animationDuration' in moveProps ? moveProps.animationDuration : 0,
563
+ ]);
564
+ },
565
+ [commands],
566
+ );
567
+
568
+ const scaleBy: CameraRef['scaleBy'] = useCallback(
569
+ (
570
+ scaleProps
571
+ ) => {
572
+ commands.call<void>('scaleBy', [
573
+ scaleProps.x,
574
+ scaleProps.y,
575
+ 'animationMode' in scaleProps ? nativeAnimationMode(scaleProps.animationMode) : nativeAnimationMode('linearTo'),
576
+ 'animationDuration' in scaleProps ? scaleProps.animationDuration : 0,
577
+ scaleProps.scaleFactor,
578
+ ]);
579
+ },
580
+ [commands],
581
+ );
582
+
523
583
  useImperativeHandle(ref, () => ({
524
584
  /**
525
585
  * Sets any camera properties, with default fallbacks if unspecified.
@@ -580,6 +640,28 @@ export const Camera = memo(
580
640
  * @param {number} animationDuration The transition duration
581
641
  */
582
642
  zoomTo,
643
+ /**
644
+ * Move the map by a given screen coordinate offset with optional animation.
645
+ * Can be used to get the Android Auto (onScroll) or Carplay(mapTemplate didUpdatePanGestureWithTranslation) pan gesture applied, for these to work properly do not specify animationDuration.
646
+ *
647
+ * @param {number} x screen coordinate offset
648
+ * @param {number} y screen coordinate offset
649
+ * @param {NativeAnimationMode} animationMode mode used for the animation
650
+ * @param {number} animationDuration The transition duration
651
+ * @param {number} scaleFactor scale factor value > 0.0 and < 2.0 when 1.0 means no scaling, > 1.0 zoom in and < 1.0 zoom out
652
+ */
653
+ moveBy,
654
+ /**
655
+ * Scale the map with optional animation.
656
+ * Can be used to get Android Auto pinch gesture (onScale with scaleFactor > 0.0 and < 2.0) or Android Auto double tap (onScale with scaleFactor == 2.0) applied.
657
+ *
658
+ * @param {number} x center screen coordinate
659
+ * @param {number} y center screen coordinate
660
+ * @param {number} scaleFactor scale factor value > 0.0 and < 2.0 when 1.0 means no scaling, > 1.0 zoom in and < 1.0 zoom out
661
+ * @param {NativeAnimationMode} animationMode mode used for the animation
662
+ * @param {number} animationDuration The transition duration
663
+ */
664
+ scaleBy,
583
665
  }));
584
666
 
585
667
  return (
@@ -171,8 +171,10 @@ export class LocationManager {
171
171
 
172
172
  if (!this._isListening) {
173
173
  MapboxGLLocationManager.start(validDisplacement);
174
+ //Determine if TurboModules (new architecture) are available.
175
+ const isTurbo: boolean = typeof MapboxGLLocationManager.onLocationUpdate === 'function';
174
176
 
175
- if (Platform.OS === 'ios') {
177
+ if (Platform.OS === 'ios' || !isTurbo) {
176
178
  this.subscription = LocationModuleEventEmitter.addListener(
177
179
  MapboxGL.LocationCallbackName.Update,
178
180
  this._onUpdate,
@@ -15,7 +15,7 @@ interface NativeCameraStop {
15
15
  paddingTop?: number;
16
16
  paddingBottom?: number;
17
17
  duration?: number;
18
- mode?: NativeAnimationMode;
18
+ mode?: number;
19
19
  }
20
20
 
21
21
  type Stop =
@@ -24,13 +24,26 @@ type Stop =
24
24
  }
25
25
  | NativeCameraStop;
26
26
 
27
- type NativeAnimationMode = 'flight' | 'ease' | 'linear' | 'none' | 'move';
28
-
29
27
  // eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-unused-vars
30
28
  type ObjectOr<T> = Object;
31
29
 
32
30
  export interface Spec extends TurboModule {
33
31
  updateCameraStop(viewRef: ViewRef, stop: ObjectOr<Stop>): Promise<void>;
32
+ moveBy: (
33
+ viewRef: ViewRef,
34
+ x: number,
35
+ y: number,
36
+ animationMode: number,
37
+ animationDuration: number,
38
+ ) => Promise<void>;
39
+ scaleBy: (
40
+ viewRef: ViewRef,
41
+ x: number,
42
+ y: number,
43
+ animationMode: number,
44
+ animationDuration: number,
45
+ scaleFactor: number,
46
+ ) => Promise<void>;
34
47
  }
35
48
 
36
49
  export default TurboModuleRegistry.getEnforcing<Spec>('RNMBXCameraModule');
@@ -25,5 +25,5 @@ export type NativeCameraStop = {
25
25
  paddingTop?: Double;
26
26
  paddingBottom?: Double;
27
27
  duration?: Double;
28
- mode?: string;
28
+ mode?: number;
29
29
  } | null;
@@ -52,7 +52,7 @@ class Camera
52
52
  'centerCoordinate' | 'zoomLevel' | 'minZoomLevel' | 'maxZoomLevel'
53
53
  >
54
54
  >
55
- implements Omit<CameraRef, 'setCamera'>
55
+ implements Omit<CameraRef, 'setCamera' | 'moveBy' | 'scaleBy'>
56
56
  {
57
57
  context!: ContextType<typeof MapContext>;
58
58
 
package/CHANGELOG.md DELETED
@@ -1,390 +0,0 @@
1
- Please check `https://github.com/rnmapbox/maps/releases` for all release logs. We no longer maintain this file.
2
-
3
- ### Release notes for 10.1.0
4
-
5
- - fabric support (should cover all functionality, but some stuff might be broken)
6
- - v11 support, including api for new features like style config, slot and ModelLayers
7
- - deprecate `UserLocation#renderMode`, to use native user location, use the new component `LocationPuck`
8
- - deprecate `Camera#onUserTrackingModeChange`, use `Viewport#onStatusChanged` instead
9
- - lot of smaller bugfixes/features
10
-
11
-
12
- ### UNRELEASED/10.0.0-beta.10
13
-
14
- #### Breaking changes:
15
-
16
- The setup was changed - see install instructions for more details. In a nuthsell:
17
-
18
- - On both android/ios to select mapbox implementation use `RNMapboxMapsImpl`/`$RNMapboxMapsImpl` variable which can be one of (`maplibre`,`mapbox`(aka v10),`mapbox-gl`)
19
- - Default implementation is `maplibre` as it requires not further setup. _WARNING_ using mapbox styles from `maplibre` has different pricing than mapbox native sdk-s.
20
- - On Podfile `$RNMBGL.(pre|post)_install` was changed `$RNMapboxMaps.(pre|post)_install`
21
- - Package name was changed from `@react-native-mapbox-gl/maps` to `@rnmapbox/maps`. If you just testing with the v10 version you can use something like [babel-plugin-transform-rename-import](https://www.npmjs.com/package/babel-plugin-transform-rename-import) to keep using the old imports for a while.
22
- - `MapboxGL.setAccessToken` now requires `MapboxGL.setWellKnownTileServer` on maplibre.
23
-
24
- #### Changes:
25
-
26
- - Convert Camera component to TypeScript and update related documentation generation and tests ([#2057](https://github.com/rnmapbox/maps/pull/2057))
27
- - Implement clustering properties to ShapeSource ([#1745](https://github.com/react-native-mapbox-gl/maps/pull/1745))
28
- - Initial Mapbox V10 support ([#1750](https://github.com/rnmapbox/maps/pull/1750))
29
- - Updated MapLibre on Android to 9.5.2 ([#1780](https://github.com/rnmapbox/maps/pull/1780))
30
-
31
- ## 8.6.0-beta.0
32
-
33
- fix: add TypeScript type for MapViews's preferredFramesPerSecond prop ([#1717](https://github.com/rnmapbox/maps/pull/1717))
34
- fix(example): update `/example` project (iOS only) to work with ARM-based Macs ([#1703](https://github.com/rnmapbox/maps/pull/1703))
35
- fix(iOS): correct import of UIView+React.h header ([#1672](https://github.com/rnmapbox/maps/pull/1672))
36
-
37
- ---
38
-
39
- ## 8.5.0
40
-
41
- build: update install guide and `/example` project for android dependencies ([#1640](https://github.com/rnmapbox/maps/pull/1640))
42
- build(turf): update to version 6.5.0 ([#1638](https://github.com/rnmapbox/maps/pull/1638))
43
- fix(Camera) fix `zoomTo` method and expand Fit example ([#1631](https://github.com/rnmapbox/maps/pull/1631))
44
- ci: two scripts for linting with and without fix ([#1630](https://github.com/rnmapbox/maps/pull/1630))
45
- feat(Camera) add an optional `allowUpdates` boolean prop ([#1619](https://github.com/rnmapbox/maps/pull/1619))
46
- refactor(example): remove unused modules and scripts ([#1618](https://github.com/rnmapbox/maps/pull/1618))
47
- fix(react-native): update api to get rid of EventEmitter warnings ([#1615](https://github.com/rnmapbox/maps/pull/1615))
48
- fix(Camera) persist zoom when changing from `bounds` to `centerCoordinate`, fix zero padding not causing map to update, create unified example showcasing bounds/centerCoordinate/zoom/padding ([#1614](https://github.com/rnmapbox/maps/pull/1614))
49
- Update MapLibre to 5.12.1 on iOS ([#1596](https://github.com/rnmapbox/maps/pull/1596))
50
- Update ShapeSource methods to make it usable with any cluster ( Use cluster itself instead of cluster_id as first argument for getClusterExpansionZoom/getClusterLeaves/getClusterChildren methods. Version < 9 methods still supports passing cluster_id as a first argument but a deprecation warning will be shown. ) ([#1499](https://github.com/rnmapbox/maps/pull/1499))
51
-
52
- ---
53
-
54
- ## 8.4.0
55
-
56
- fix(iOS): pin mapLibre back to `5.12.0` ([#1589](https://github.com/rnmapbox/maps/pull/1589))
57
- chore: improve GH workflows ([#1588](https://github.com/rnmapbox/maps/pull/1588))
58
- build(deps): bump @expo/config-plugins from 3.1.0 to 4.0.3 ([#1585](https://github.com/rnmapbox/maps/pull/1585))
59
- chore(pre-commit): run lint on TS files, change PR template ([#1584](https://github.com/rnmapbox/maps/pull/1584))
60
- feat(example): update vertical alignment example ([#1579](https://github.com/rnmapbox/maps/pull/1579))
61
- fix incorrect anchor calculation for PointAnnotation on iOS ([#1576](https://github.com/rnmapbox/maps/pull/1576))
62
- style(eslint): align root and example with the same configuration ([#1575](https://github.com/rnmapbox/maps/pull/1575))
63
- fix(mapLibre): support version `5.12.0` upwards ([#1571](https://github.com/rnmapbox/maps/pull/1571))
64
- build: upgrade to RN `0.66` ([#1570](https://github.com/rnmapbox/maps/pull/1570))
65
- build(android): add telemetry dependency to default build setup ([#1550](https://github.com/rnmapbox/maps/pull/1550))
66
- feat(camera): Enable `padding` as a root-level prop on the camera, with `bounds.padding*` as fallbacks ([#1538](https://github.com/rnmapbox/maps/pull/1538/files))
67
- fix: revert pinned mapLibre version to `5.11.0` ([8a2b00e67ba6398f3f6e6f52e98b0f0cea437e4d](https://github.com/rnmapbox/maps/commit/8a2b00e67ba6398f3f6e6f52e98b0f0cea437e4d))
68
-
69
- ---
70
-
71
- ## 8.3.0
72
-
73
- Fix TypeScript type for Callout's textStyle prop ([#1450](https://github.com/rnmapbox/maps/pull/1450))
74
- Build(ios): pin maplibre version to 5.12.0 ([#1454](https://github.com/rnmapbox/maps/pull/1454))
75
- Update geoUtils helpers types to correspond with `turf/helpers` ([#1455](https://github.com/rnmapbox/maps/pull/1455))
76
- Fix crash with missing okhttp dependency ([#1452](https://github.com/rnmapbox/maps/pull/1452))
77
- Move from react-native-testing-library => @testing-library/react-native ([#1453](https://github.com/rnmapbox/maps/pull/1453))
78
- Feat(camera): maxBounds/(min|max)ZoomLevel can be updated dynamically ([#1462](https://github.com/rnmapbox/maps/pull/1462))
79
- Refactor(example): clean up folder structure ([#1464](https://github.com/rnmapbox/maps/pull/1464))
80
- Fix lineGradient showing wrong colors ([#1471](https://github.com/rnmapbox/maps/pull/1471))
81
- Support tintColor on Android ([#1465](https://github.com/rnmapbox/maps/pull/1465))
82
- Feat(android): dynamically update tintColor & add example ([#1469](https://github.com/rnmapbox/maps/pull/1469)
83
- Examples: align install steps with yarn, ignore created env files ([#1484](https://github.com/rnmapbox/maps/pull/1484)
84
- Fix(plugin): Exclude arm64 architectures for simulator builds ([#1490](https://github.com/rnmapbox/maps/pull/1490)
85
- Feat(android): dynamically update tintColor & add example ([#1469](https://github.com/rnmapbox/maps/pull/1469))
86
- Docs: make background in example pngs transparent ([#1483](https://github.com/rnmapbox/maps/pull/1483))
87
- Style: run yarn lint ([#1486](https://github.com/rnmapbox/maps/pull/1486))
88
- Test: add unit tests for component light ([#1489](https://github.com/rnmapbox/maps/pull/1489))
89
- Feat: add Adds getClusterChildren method to ShapeSource ([#1495](https://github.com/rnmapbox/maps/pull/1495))
90
-
91
- ## 8.2.1
92
-
93
- fix issue when publishing to npm with `prepare` script
94
-
95
- ## 8.2.0
96
-
97
- getClusterLeaves method for ShapeSource ([#1411](https://github.com/rnmapbox/maps/pull/1411))
98
- Add logoPosition props to `MapView` to position the mapbox logo ([#1396](https://github.com/rnmapbox/maps/pull/1396))
99
- Add compatibility with React 17/ npm7 ([#1387](https://github.com/rnmapbox/maps/pull/1387))
100
- Add Expo config plugin ([#1388](https://github.com/rnmapbox/maps/pull/1388))
101
- Android: Bump `okhttp` to `4.9.0` ([#1390](https://github.com/rnmapbox/maps/pull/1390))
102
- Support dynamically changing local JSON in styleURL ([#1399](https://github.com/rnmapbox/maps/pull/1399))
103
- Add missing types to `SymbolLayerStyle` & `ImagesProps` ([#1360](https://github.com/rnmapbox/maps/pull/1360))
104
- Fix error while updating coordinates of RNMBXImageSource ([#1310](https://github.com/rnmapbox/maps/pull/1310))
105
-
106
- ## 8.2.0-beta2
107
-
108
- Add types for `Logger` class ([#1316](https://github.com/rnmapbox/maps/pull/1316))
109
- Enable linear easing on map camera ([#1281](https://github.com/rnmapbox/maps/pull/1281))
110
- Allow MapLibre as an option ([#1311](https://github.com/rnmapbox/maps/pull/1311))
111
- Fix native UserLocation on Android ([#1284](https://github.com/rnmapbox/maps/pull/1284))
112
- Add getClusterExpansionZoom to ShapeSource ([#1279](https://github.com/rnmapbox/maps/pull/1279))
113
- Add type definition for AnimatedPoint ([#1280](https://github.com/rnmapbox/maps/pull/1280))
114
-
115
- ## 8.2.0-beta1
116
-
117
- ### Breaking changes:
118
-
119
- Use `pre_install` hook to support non `use_frameworks!` usage #1262. Please add the following to your `Podfile`:
120
-
121
- ```ruby
122
- pre_install do |installer|
123
- $RNMBGL.pre_install(installer)
124
- ...
125
- end
126
- ```
127
-
128
- and
129
-
130
- ```ruby
131
- post_install do |installer|
132
- $RNMBGL.post_install(installer)
133
- ...
134
- end
135
- ```
136
-
137
- ### Other changes:
138
-
139
- - Add course to the location events #1209
140
- - Fix heading indicator alignment #1215
141
- - App crash when ProGuard is set to true #1184
142
- - [iOS] Implemented ShapeSource.features(...) method #1140
143
- - style json support on styleURL #1102
144
- - Fix: onUpdate not called when renderMode is native #1135
145
-
146
- ## 8.1.0
147
-
148
- - By default [use 5.9.0 Mapbox on iOS as 8.1.0rc8 and before](https://github.com/rnmapbox/maps/pull/1120)
149
- - Fix [crash during styleURL change on adroid](https://github.com/rnmapbox/maps/pull/1119)
150
- - Fix [warning Sending LogEvent with no listeners registered.](https://github.com/rnmapbox/maps/pull/1108)
151
- - Fix [race in close map and icon image download](https://github.com/rnmapbox/maps/pull/1089)
152
- - Fix [android padding](https://github.com/rnmapbox/maps/pull/1087)
153
- - Android [custom mapboxgl version](https://github.com/rnmapbox/maps/pull/1088)
154
- - Fix [support 6.\* of MapboxGL IOS by setting `$ReactNativeMapboxGLIOSVersion = "6.2.1"` in Podfile](https://github.com/rnmapbox/maps/pull/1044)
155
- - Fix [map rendered at (0,0,0,0) on iOS](https://github.com/rnmapbox/maps/pull/1084)
156
- - Fix [edge Padding + auto limit padding on iOS](https://github.com/rnmapbox/maps/pull/1057)
157
- - Fix [coordinate 0,0 was considered invalid on IOS](https://github.com/rnmapbox/maps/pull/1076)
158
- - Fix [refresh on PointAnnotation on Android](https://github.com/rnmapbox/maps/pull/1062)
159
- - Fix [Image source coordinates update on the fly](https://github.com/rnmapbox/maps/pull/1036/files)
160
- - Upgrade to [ios 5.9.0](https://github.com/mapbox/mapbox-gl-native-ios/releases/tag/ios-v5.9.0)
161
- - Upgrade to [android 9.1.0](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v9.1.0)
162
- - Set default Mapbox logging verbosity to warning. (Change it using Logger.setLogLevel('verbose'))
163
- - Error/Warn mapbox log messages are treated as redbox/yellowbox errors/warnings. (Override it using Logger.setLoggerCallback(log => { return true })
164
- - Native user location [#825](https://github.com/rnmapbox/maps/pull/825)
165
-
166
- ## 8.1.0-rc11
167
-
168
- - By default [use 5.9.0 Mapbox on iOS as 8.1.0rc8 and before](https://github.com/rnmapbox/maps/pull/1120)
169
- - Fix [crash during styleURL change on adroid](https://github.com/rnmapbox/maps/pull/1119)
170
- - Fix [warning Sending LogEvent with no listeners registered.](https://github.com/rnmapbox/maps/pull/1108)
171
- - Fix [race in close map and icon image download](https://github.com/rnmapbox/maps/pull/1089)
172
- - Fix [android padding](https://github.com/rnmapbox/maps/pull/1087)
173
- - Android [custom mapboxgl version](https://github.com/rnmapbox/maps/pull/1088)
174
- - Fix [support 6.\* of MapboxGL IOS by setting `$ReactNativeMapboxGLIOSVersion = "6.2.1"` in Podfile](https://github.com/rnmapbox/maps/pull/1044)
175
- - Fix [map rendered at (0,0,0,0) on iOS](https://github.com/rnmapbox/maps/pull/1084)
176
- - Fix [edge Padding + auto limit padding on iOS](https://github.com/rnmapbox/maps/pull/1057)
177
- - Fix [coordinate 0,0 was considered invalid on IOS](https://github.com/rnmapbox/maps/pull/1076)
178
- - Fix [refresh on PointAnnotation on Android](https://github.com/rnmapbox/maps/pull/1062)
179
- - Fix [Image source coordinates update on the fly](https://github.com/rnmapbox/maps/pull/1036/files)
180
- - Upgrade to [ios 5.9.0](https://github.com/mapbox/mapbox-gl-native-ios/releases/tag/ios-v5.9.0)
181
- - Upgrade to [android 9.1.0](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v9.1.0)
182
- - Set default Mapbox logging verbosity to warning. (Change it using Logger.setLogLevel('verbose'))
183
- - Error/Warn mapbox log messages are treated as redbox/yellowbox errors/warnings. (Override it using Logger.setLoggerCallback(log => { return true })
184
- - Native user location [#825](https://github.com/rnmapbox/maps/pull/825)
185
-
186
- ## 8.1.0-rc10
187
-
188
- - By default [use 5.9.0 Mapbox on iOS as 8.1.0rc8 and before](https://github.com/rnmapbox/maps/pull/1120)
189
- - Fix [crash during styleURL change on adroid](https://github.com/rnmapbox/maps/pull/1119)
190
- - Fix [warning Sending LogEvent with no listeners registered.](https://github.com/rnmapbox/maps/pull/1108)
191
- - Fix [race in close map and icon image download](https://github.com/rnmapbox/maps/pull/1089)
192
- - Fix [android padding](https://github.com/rnmapbox/maps/pull/1087)
193
- - Android [custom mapboxgl version](https://github.com/rnmapbox/maps/pull/1088)
194
- - Fix [support 6.\* of MapboxGL IOS by setting `$ReactNativeMapboxGLIOSVersion = "6.2.1"` in Podfile](https://github.com/rnmapbox/maps/pull/1044)
195
- - Fix [map rendered at (0,0,0,0) on iOS](https://github.com/rnmapbox/maps/pull/1084)
196
- - Fix [edge Padding + auto limit padding on iOS](https://github.com/rnmapbox/maps/pull/1057)
197
- - Fix [coordinate 0,0 was considered invalid on IOS](https://github.com/rnmapbox/maps/pull/1076)
198
- - Fix [refresh on PointAnnotation on Android](https://github.com/rnmapbox/maps/pull/1062)
199
- - Fix [Image source coordinates update on the fly](https://github.com/rnmapbox/maps/pull/1036/files)
200
- - Upgrade to [ios 5.9.0](https://github.com/mapbox/mapbox-gl-native-ios/releases/tag/ios-v5.9.0)
201
- - Upgrade to [android 9.1.0](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v9.1.0)
202
- - Set default Mapbox logging verbosity to warning. (Change it using Logger.setLogLevel('verbose'))
203
- - Error/Warn mapbox log messages are treated as redbox/yellowbox errors/warnings. (Override it using Logger.setLoggerCallback(log => { return true })
204
- - Native user location [#825](https://github.com/rnmapbox/maps/pull/825)
205
-
206
- ## 8.1.0.rc10
207
-
208
- - By default [use 5.9.0 Mapbox on iOS as 8.1.0rc8 and before](https://github.com/rnmapbox/maps/pull/1120)
209
- - Fix [crash during styleURL change on adroid](https://github.com/rnmapbox/maps/pull/1119)
210
- - Fix [warning Sending LogEvent with no listeners registered.](https://github.com/rnmapbox/maps/pull/1108)
211
-
212
- ## 8.1.0.rc9
213
-
214
- - Fix [race in close map and icon image download](https://github.com/rnmapbox/maps/pull/1089)
215
-
216
- ## 8.1.0.rc8
217
-
218
- - Fix [android padding](https://github.com/rnmapbox/maps/pull/1087)
219
- - Android [custome mapboxgl version](https://github.com/rnmapbox/maps/pull/1088)
220
-
221
- ## 8.1.0.rc7
222
-
223
- - Fix [map rendered at (0,0,0,0) on iOS](https://github.com/rnmapbox/maps/pull/1084)
224
-
225
- ## 8.1.0.rc6
226
-
227
- - Fix [edge Padding + auto limit padding on iOS](https://github.com/rnmapbox/maps/pull/1057)
228
- - Fix [coordinate 0,0 was considered invalid on IOS](https://github.com/rnmapbox/maps/pull/1076)
229
- - Fix [refresh on PointAnnotation on Android](https://github.com/rnmapbox/maps/pull/1062)
230
-
231
- ## 8.1.0.rc5
232
-
233
- - Fix [support 6.\* of MapboxGL IOS by setting `$ReactNativeMapboxGLIOSVersion = "6.2.1"` in Podfile](https://github.com/rnmapbox/maps/pull/1044)
234
- - Fix [Image source coordinates update on the fly](https://github.com/rnmapbox/maps/pull/1036/files)
235
-
236
- ## 8.1.0.rc4
237
-
238
- ## 8.1.0.rc3
239
-
240
- - Fix [android crashes](https://github.com/rnmapbox/maps/pull/963)
241
- - Fix [android padding addition](https://github.com/rnmapbox/maps/pull/973)
242
- - Fix [iOS interface for getAccessToken() on Android](https://github.com/rnmapbox/maps/pull/954)
243
-
244
- ## 8.1.0.rc2
245
-
246
- - Fix [camera padding on android](https://github.com/rnmapbox/maps/pull/941)
247
- - Allow [zPosition on iOS](https://github.com/rnmapbox/maps/pull/942) in PointAnnotation child views.
248
- - Added [InvalidatePack](https://github.com/rnmapbox/maps/pull/929)
249
- - Allow to [customize iOS framework version used](https://github.com/rnmapbox/maps/pull/940)
250
-
251
- ## 8.1.0.rc1
252
-
253
- - Added [invalidateAmbientCache](https://github.com/rnmapbox/maps/pull/899)
254
- - Implemented [ShapeSource#features](https://github.com/rnmapbox/maps/pull/911)
255
-
256
- ## 8.1.0.beta
257
-
258
- - Upgrade to [ios 5.8.0](https://github.com/mapbox/mapbox-gl-native-ios/releases/tag/ios-v5.8.0)
259
- - Upgrade to [android 9.1.0](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v9.1.0)
260
- - Set default Mapbox logging verbosity to warning. (Change it using Logger.setLogLevel('verbose'))
261
- - Error/Warn mapbox log messages are treated as redbox/yellowbox errors/warnings. (Override it using Logger.setLoggerCallback(log => { return true })
262
- - Native user location [#825](https://github.com/rnmapbox/maps/pull/825)
263
-
264
- ## 8.0.0
265
-
266
- ### Breaking changes - [#610](https://github.com/rnmapbox/maps/issues/610)
267
-
268
- - iOS mapbox libraries updated to [5.7.0](https://github.com/mapbox/mapbox-gl-native-ios/releases/tag/ios-v5.7.0) android libraries updated to [9.0.0](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v9.0.0)
269
- - ShapeSource#images is now removed (deprecated in 7.\*), use Images#images instead. Also special `assets` inside `images` is now deprecated, use `nativeAssetImages` istead.
270
- - iOS now defaults to non `use_frameworks!`, if you want to continue to use `use_frameworks!` please see our iOS installation guidelines
271
- - [Images#onImagesMissing](docs/Images.md)
272
- - Android code migrated to AndroidX, RN 60.0+ is recommended.
273
- - geoUtils is now private, please use [turf-js](https://turfjs.org/) instead
274
- - VectorSource/SymbolSource#onPress sends ({features, point, coordinates}) instead of single feature in `event.nativeEvent.payload`. [PR#700](https://github.com/rnmapbox/maps/pull/700)
275
-
276
- ### Changes:
277
-
278
- - added [MarkerView](docs/MarkerView.md)
279
- - added AnimatedShape and AnimatedCoordinatesArray [PR#702](https://github.com/rnmapbox/maps/pull/702)
280
-
281
- ## 7.2.0
282
-
283
- - Upstream changes in Mapbox iOS SDK 5.6.0 has made installing the SDK as an embedded framework difficult. We have therefore discontinued supporting manual installations. To update, follow the iOS installation instructions using cocoapods.
284
-
285
- ## 7.0.0
286
-
287
- ### Breaking changes:
288
-
289
- - iOS mapbox libraries updated to [5.5.0](https://github.com/mapbox/mapbox-gl-native/releases/tag/ios-v5.3.2) android libraries updated to [8.2.1](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.2.1)
290
- - `StyleSheet.create` removed.
291
- Mapbox styles are now just a map no need for `StyleSheet.create`.
292
- `StylesSheet.identity` also removed, use expressions array instead:
293
-
294
- ```jsx
295
- mapboxStyle=MapboxGL.Stylesheet.create({..., fillColor: MapboxGL.Stylesheet.identity('color') ...})
296
- ...
297
- <MapView
298
- ...
299
- <FillLayer style={mapboxStyle}... />
300
- </MapView>
301
- ```
302
-
303
- is now:
304
-
305
- ```jsx
306
- mapboxStyle={..., fillColor: ['get', 'color'] ...}
307
- ...
308
- <MapView
309
- ...
310
- <FillLayer style={mapboxStyle}... />
311
- </MapView>
312
- ```
313
-
314
- See [docs/StyleSheet.md](docs/StyleSheet.md) for more examples
315
-
316
- - `isTelemetryEnabled` removed (as no longer supported on android) [#1](https://github.com/mfazekas/maps/pull/1)
317
- - MapView#flyTo, MapView#bitBounds, MapView#flyTo, MapView#moveTo, MapView#zoomTo, MapView#setCamera moved to Camera. There is also experimantal properties, to replace those. See [docs/Camera.md](docs/Camera.md)
318
- - Camera related properties on `MapView` now have to be specified on a camera object:
319
-
320
- ```jsx
321
- <MapView
322
- zoomLevel={8}
323
- centerCoordinate={[-111.8678, 40.2866]}
324
- ...
325
- >
326
- ...
327
- </MapView>
328
- ```
329
-
330
- is now:
331
-
332
- ```jsx
333
- <MapView
334
- ...
335
- >
336
- <Camera
337
- zoomLevel={8}
338
- centerCoordinate={[-111.8678, 40.2866]}
339
- />
340
- </MapView>
341
- ```
342
-
343
- See [docs/Camera.md](docs/Camera.md) for more examples
344
-
345
- - User tracking properties moved from `MapView` to `Camera`
346
-
347
- ```jsx
348
- <MapView
349
- userTrackingMode={UserTrackingModes.Follow}
350
- ...
351
- >
352
- ...
353
- </MapView>
354
- ```
355
-
356
- is now:
357
-
358
- ```jsx
359
- <MapView
360
- ...
361
- >
362
- <Camera
363
- followUserLocation=true
364
- followUserMode="normal"
365
- />
366
- </MapView>
367
- ```
368
-
369
- The following properties were changed:
370
-
371
- - MapView#userTrackingMode is now Camera#followUserMode and Camera#followUserLocation
372
- - followUserMode is now a string with ('normal','compass','course'), and UserTrackingModes enum is deprecated
373
- - MapView#onUserTrackingModeChange is now Camera#onUserTrackingModeChange and payload contains followUserMode and followUserLocation.
374
-
375
- - ShapeSource#images was depreacted, use Images#images instead.
376
-
377
- ```jsx
378
- <MapView
379
- ...
380
- >
381
- ...
382
- <Images images={{pin, dot}} />
383
- ...
384
- <ShapeSource ... >
385
- <SymbolLayer ...>
386
- </ShapeSource>
387
- </MapView>
388
- ```
389
-
390
- - TODO document all changes
@@ -1,9 +0,0 @@
1
- *.iml
2
- .gradle
3
- /local.properties
4
- /.idea/workspace.xml
5
- /.idea/libraries
6
- .DS_Store
7
- /build
8
- /captures
9
- .externalNativeBuild
@@ -1,9 +0,0 @@
1
- *.iml
2
- .gradle
3
- /local.properties
4
- /.idea/workspace.xml
5
- /.idea/libraries
6
- .DS_Store
7
- /build
8
- /captures
9
- .externalNativeBuild
@@ -1,67 +0,0 @@
1
- import React from 'react';
2
- import { TurboModule } from 'react-native';
3
-
4
- import { type NativeArg, runNativeMethod } from '../utils';
5
-
6
- export type RNMBEvent<PayloadType = { [key: string]: string }> = {
7
- payload: PayloadType;
8
- type: string;
9
- };
10
-
11
- const NativeBridgeComponent = <
12
- Props extends object,
13
- BaseComponent extends new (...ags: any[]) => React.Component<Props>,
14
- >(
15
- Base: BaseComponent,
16
- turboModule: TurboModule,
17
- ) =>
18
- class extends Base {
19
- _turboModule: TurboModule;
20
- _preRefMapMethodQueue: Array<{
21
- method: { name: string; args: NativeArg[] };
22
- resolver: (value: NativeArg) => void;
23
- }>;
24
-
25
- constructor(...args: any[]) {
26
- super(...args);
27
-
28
- this._turboModule = turboModule;
29
- this._preRefMapMethodQueue = [];
30
- }
31
-
32
- async _runPendingNativeMethods<RefType>(nativeRef: RefType) {
33
- if (nativeRef) {
34
- while (this._preRefMapMethodQueue.length > 0) {
35
- const item = this._preRefMapMethodQueue.pop();
36
-
37
- if (item && item.method && item.resolver) {
38
- const res = await this._runNativeMethod(
39
- item.method.name,
40
- nativeRef,
41
- item.method.args,
42
- );
43
- item.resolver(res);
44
- }
45
- }
46
- }
47
- }
48
-
49
- _runNativeMethod<RefType, ReturnType = NativeArg>(
50
- methodName: string,
51
- nativeRef: RefType | undefined,
52
- args: NativeArg[] = [],
53
- ): Promise<ReturnType> {
54
- if (!nativeRef) {
55
- return new Promise<ReturnType>((resolve) => {
56
- this._preRefMapMethodQueue.push({
57
- method: { name: methodName, args },
58
- resolver: resolve as (args: NativeArg) => void,
59
- });
60
- });
61
- }
62
-
63
- return runNativeMethod(this._turboModule, methodName, nativeRef, args);
64
- }
65
- };
66
-
67
- export default NativeBridgeComponent;