@rnmapbox/maps 10.1.0-beta.10 → 10.1.0-beta.13

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 (374) hide show
  1. package/android/src/main/java/com/rnmapbox/rnmbx/components/AbstractMapFeature.kt +2 -0
  2. package/android/src/main/java/com/rnmapbox/rnmbx/components/camera/RNMBXCamera.kt +66 -9
  3. package/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImages.kt +2 -2
  4. package/android/src/main/java/com/rnmapbox/rnmbx/components/location/LocationComponentManager.kt +1 -1
  5. package/android/src/main/java/com/rnmapbox/rnmbx/components/location/UserTrackingMode.kt +1 -0
  6. package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapView.kt +7 -4
  7. package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapViewManager.kt +51 -0
  8. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/layers/RNMBXSkyLayerManager.kt +0 -6
  9. package/android/src/main/java/com/rnmapbox/rnmbx/utils/BitmapUtils.kt +0 -31
  10. package/android/src/main/java/com/rnmapbox/rnmbx/utils/DownloadMapImageTask.kt +28 -67
  11. package/android/src/main/java/com/rnmapbox/rnmbx/utils/extensions/ReadableMap.kt +35 -0
  12. package/android/src/main/mapbox-v11-compat/v11/com/mapbox/rnmbx/v11compat/Image.kt +1 -1
  13. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXMapViewManagerDelegate.java +3 -0
  14. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXMapViewManagerInterface.java +1 -0
  15. package/ios/RNMBX/CustomHttpHeaders.swift +11 -0
  16. package/ios/RNMBX/RNMBXMapView.swift +56 -1
  17. package/ios/RNMBX/RNMBXMapViewManager.m +2 -0
  18. package/ios/install.md +1 -1
  19. package/lib/commonjs/Mapbox.js +2 -2
  20. package/lib/commonjs/Mapbox.js.map +1 -1
  21. package/lib/commonjs/components/AbstractLayer.js +1 -2
  22. package/lib/commonjs/components/AbstractLayer.js.map +1 -1
  23. package/lib/commonjs/components/Annotation.js +2 -3
  24. package/lib/commonjs/components/Annotation.js.map +1 -1
  25. package/lib/commonjs/components/Atmosphere.js +2 -2
  26. package/lib/commonjs/components/Atmosphere.js.map +1 -1
  27. package/lib/commonjs/components/Camera.js +9 -12
  28. package/lib/commonjs/components/Camera.js.map +1 -1
  29. package/lib/commonjs/components/Image.js +2 -2
  30. package/lib/commonjs/components/Image.js.map +1 -1
  31. package/lib/commonjs/components/Light.js +3 -4
  32. package/lib/commonjs/components/Light.js.map +1 -1
  33. package/lib/commonjs/components/MapView.js +2 -5
  34. package/lib/commonjs/components/MapView.js.map +1 -1
  35. package/lib/commonjs/components/NativeUserLocation.js +2 -2
  36. package/lib/commonjs/components/NativeUserLocation.js.map +1 -1
  37. package/lib/commonjs/components/ShapeSource.js +1 -2
  38. package/lib/commonjs/components/ShapeSource.js.map +1 -1
  39. package/lib/commonjs/components/Style.js +2 -2
  40. package/lib/commonjs/components/Style.js.map +1 -1
  41. package/lib/commonjs/components/StyleImport.js +2 -2
  42. package/lib/commonjs/components/StyleImport.js.map +1 -1
  43. package/lib/commonjs/components/SymbolLayer.js +1 -1
  44. package/lib/commonjs/components/SymbolLayer.js.map +1 -1
  45. package/lib/commonjs/components/Terrain.js +2 -2
  46. package/lib/commonjs/components/Terrain.js.map +1 -1
  47. package/lib/commonjs/index.js +2 -2
  48. package/lib/commonjs/index.js.map +1 -1
  49. package/lib/commonjs/index.web.js +2 -2
  50. package/lib/commonjs/index.web.js.map +1 -1
  51. package/lib/commonjs/specs/RNMBXBackgroundLayerNativeComponent.js +1 -0
  52. package/lib/commonjs/specs/RNMBXBackgroundLayerNativeComponent.js.map +1 -1
  53. package/lib/commonjs/specs/RNMBXCameraNativeComponent.js +1 -0
  54. package/lib/commonjs/specs/RNMBXCameraNativeComponent.js.map +1 -1
  55. package/lib/commonjs/specs/RNMBXCircleLayerNativeComponent.js +1 -0
  56. package/lib/commonjs/specs/RNMBXCircleLayerNativeComponent.js.map +1 -1
  57. package/lib/commonjs/specs/RNMBXFillExtrusionLayerNativeComponent.js +1 -0
  58. package/lib/commonjs/specs/RNMBXFillExtrusionLayerNativeComponent.js.map +1 -1
  59. package/lib/commonjs/specs/RNMBXFillLayerNativeComponent.js +1 -0
  60. package/lib/commonjs/specs/RNMBXFillLayerNativeComponent.js.map +1 -1
  61. package/lib/commonjs/specs/RNMBXHeatmapLayerNativeComponent.js +1 -0
  62. package/lib/commonjs/specs/RNMBXHeatmapLayerNativeComponent.js.map +1 -1
  63. package/lib/commonjs/specs/RNMBXLineLayerNativeComponent.js +1 -0
  64. package/lib/commonjs/specs/RNMBXLineLayerNativeComponent.js.map +1 -1
  65. package/lib/commonjs/specs/RNMBXMapViewNativeComponent.js +1 -0
  66. package/lib/commonjs/specs/RNMBXMapViewNativeComponent.js.map +1 -1
  67. package/lib/commonjs/specs/RNMBXRasterLayerNativeComponent.js +1 -0
  68. package/lib/commonjs/specs/RNMBXRasterLayerNativeComponent.js.map +1 -1
  69. package/lib/commonjs/specs/RNMBXSkyLayerNativeComponent.js +1 -0
  70. package/lib/commonjs/specs/RNMBXSkyLayerNativeComponent.js.map +1 -1
  71. package/lib/commonjs/specs/RNMBXSymbolLayerNativeComponent.js +1 -0
  72. package/lib/commonjs/specs/RNMBXSymbolLayerNativeComponent.js.map +1 -1
  73. package/lib/commonjs/utils/Logger.js +1 -2
  74. package/lib/commonjs/utils/Logger.js.map +1 -1
  75. package/lib/module/components/AbstractLayer.js +1 -2
  76. package/lib/module/components/AbstractLayer.js.map +1 -1
  77. package/lib/module/components/Annotation.js +2 -3
  78. package/lib/module/components/Annotation.js.map +1 -1
  79. package/lib/module/components/Camera.js +7 -10
  80. package/lib/module/components/Camera.js.map +1 -1
  81. package/lib/module/components/Light.js +1 -2
  82. package/lib/module/components/Light.js.map +1 -1
  83. package/lib/module/components/MapView.js +2 -5
  84. package/lib/module/components/MapView.js.map +1 -1
  85. package/lib/module/components/ShapeSource.js +1 -2
  86. package/lib/module/components/ShapeSource.js.map +1 -1
  87. package/lib/module/components/SymbolLayer.js +1 -1
  88. package/lib/module/components/SymbolLayer.js.map +1 -1
  89. package/lib/module/specs/RNMBXBackgroundLayerNativeComponent.js +3 -0
  90. package/lib/module/specs/RNMBXBackgroundLayerNativeComponent.js.map +1 -1
  91. package/lib/module/specs/RNMBXCameraNativeComponent.js +3 -0
  92. package/lib/module/specs/RNMBXCameraNativeComponent.js.map +1 -1
  93. package/lib/module/specs/RNMBXCircleLayerNativeComponent.js +3 -0
  94. package/lib/module/specs/RNMBXCircleLayerNativeComponent.js.map +1 -1
  95. package/lib/module/specs/RNMBXFillExtrusionLayerNativeComponent.js +3 -0
  96. package/lib/module/specs/RNMBXFillExtrusionLayerNativeComponent.js.map +1 -1
  97. package/lib/module/specs/RNMBXFillLayerNativeComponent.js +3 -0
  98. package/lib/module/specs/RNMBXFillLayerNativeComponent.js.map +1 -1
  99. package/lib/module/specs/RNMBXHeatmapLayerNativeComponent.js +3 -0
  100. package/lib/module/specs/RNMBXHeatmapLayerNativeComponent.js.map +1 -1
  101. package/lib/module/specs/RNMBXLineLayerNativeComponent.js +3 -0
  102. package/lib/module/specs/RNMBXLineLayerNativeComponent.js.map +1 -1
  103. package/lib/module/specs/RNMBXMapViewNativeComponent.js +3 -0
  104. package/lib/module/specs/RNMBXMapViewNativeComponent.js.map +1 -1
  105. package/lib/module/specs/RNMBXRasterLayerNativeComponent.js +3 -0
  106. package/lib/module/specs/RNMBXRasterLayerNativeComponent.js.map +1 -1
  107. package/lib/module/specs/RNMBXSkyLayerNativeComponent.js +3 -0
  108. package/lib/module/specs/RNMBXSkyLayerNativeComponent.js.map +1 -1
  109. package/lib/module/specs/RNMBXSymbolLayerNativeComponent.js +3 -0
  110. package/lib/module/specs/RNMBXSymbolLayerNativeComponent.js.map +1 -1
  111. package/lib/module/utils/Logger.js +1 -2
  112. package/lib/module/utils/Logger.js.map +1 -1
  113. package/lib/typescript/jest.config.d.ts +4 -0
  114. package/lib/typescript/jest.config.d.ts.map +1 -0
  115. package/lib/typescript/src/Mapbox.d.ts.map +1 -0
  116. package/lib/typescript/src/RNMBXModule.d.ts.map +1 -0
  117. package/lib/typescript/src/components/AbstractLayer.d.ts.map +1 -0
  118. package/lib/typescript/src/components/AbstractSource.d.ts.map +1 -0
  119. package/lib/typescript/src/components/Annotation.d.ts.map +1 -0
  120. package/lib/typescript/src/components/Atmosphere.d.ts.map +1 -0
  121. package/lib/typescript/src/components/BackgroundLayer.d.ts.map +1 -0
  122. package/lib/typescript/src/components/Callout.d.ts.map +1 -0
  123. package/lib/typescript/src/components/Camera.d.ts.map +1 -0
  124. package/lib/typescript/src/components/CircleLayer.d.ts.map +1 -0
  125. package/lib/typescript/src/components/FillExtrusionLayer.d.ts.map +1 -0
  126. package/lib/typescript/src/components/FillLayer.d.ts.map +1 -0
  127. package/lib/typescript/src/components/HeadingIndicator.d.ts.map +1 -0
  128. package/lib/typescript/src/components/HeatmapLayer.d.ts.map +1 -0
  129. package/lib/typescript/src/components/Image.d.ts.map +1 -0
  130. package/lib/typescript/src/components/ImageSource.d.ts.map +1 -0
  131. package/lib/typescript/src/components/Images.d.ts.map +1 -0
  132. package/lib/typescript/src/components/Light.d.ts.map +1 -0
  133. package/lib/typescript/src/components/LineLayer.d.ts.map +1 -0
  134. package/lib/typescript/{components → src/components}/MapView.d.ts +64 -0
  135. package/lib/typescript/src/components/MapView.d.ts.map +1 -0
  136. package/lib/typescript/src/components/MarkerView.d.ts.map +1 -0
  137. package/lib/typescript/src/components/NativeBridgeComponent.d.ts.map +1 -0
  138. package/lib/typescript/src/components/NativeUserLocation.d.ts.map +1 -0
  139. package/lib/typescript/src/components/PointAnnotation.d.ts.map +1 -0
  140. package/lib/typescript/src/components/RasterDemSource.d.ts.map +1 -0
  141. package/lib/typescript/src/components/RasterLayer.d.ts.map +1 -0
  142. package/lib/typescript/src/components/RasterSource.d.ts.map +1 -0
  143. package/lib/typescript/src/components/ShapeSource.d.ts.map +1 -0
  144. package/lib/typescript/src/components/SkyLayer.d.ts.map +1 -0
  145. package/lib/typescript/src/components/Style.d.ts.map +1 -0
  146. package/lib/typescript/src/components/StyleImport.d.ts.map +1 -0
  147. package/lib/typescript/src/components/SymbolLayer.d.ts.map +1 -0
  148. package/lib/typescript/src/components/Terrain.d.ts.map +1 -0
  149. package/lib/typescript/src/components/UserLocation.d.ts.map +1 -0
  150. package/lib/typescript/src/components/VectorSource.d.ts.map +1 -0
  151. package/lib/typescript/src/index.d.ts.map +1 -0
  152. package/lib/typescript/src/modules/location/locationManager.d.ts.map +1 -0
  153. package/lib/typescript/src/modules/offline/OfflineCreatePackOptions.d.ts.map +1 -0
  154. package/lib/typescript/src/modules/offline/OfflinePack.d.ts.map +1 -0
  155. package/lib/typescript/src/modules/offline/offlineManager.d.ts.map +1 -0
  156. package/lib/typescript/src/modules/snapshot/SnapshotOptions.d.ts.map +1 -0
  157. package/lib/typescript/src/modules/snapshot/snapshotManager.d.ts.map +1 -0
  158. package/lib/typescript/src/requestAndroidLocationPermissions.d.ts.map +1 -0
  159. package/lib/typescript/src/specs/NativeMapViewModule.d.ts.map +1 -0
  160. package/lib/typescript/src/specs/RNMBXAndroidTextureMapViewNativeComponent.d.ts.map +1 -0
  161. package/lib/typescript/src/specs/RNMBXAtmosphereNativeComponent.d.ts.map +1 -0
  162. package/lib/typescript/{specs → src/specs}/RNMBXBackgroundLayerNativeComponent.d.ts +7 -6
  163. package/lib/typescript/src/specs/RNMBXBackgroundLayerNativeComponent.d.ts.map +1 -0
  164. package/lib/typescript/{specs → src/specs}/RNMBXCameraNativeComponent.d.ts +12 -11
  165. package/lib/typescript/src/specs/RNMBXCameraNativeComponent.d.ts.map +1 -0
  166. package/lib/typescript/src/specs/RNMBXCircleLayerNativeComponent.d.ts +20 -0
  167. package/lib/typescript/src/specs/RNMBXCircleLayerNativeComponent.d.ts.map +1 -0
  168. package/lib/typescript/{specs → src/specs}/RNMBXFillExtrusionLayerNativeComponent.d.ts +10 -9
  169. package/lib/typescript/src/specs/RNMBXFillExtrusionLayerNativeComponent.d.ts.map +1 -0
  170. package/lib/typescript/src/specs/RNMBXFillLayerNativeComponent.d.ts +20 -0
  171. package/lib/typescript/src/specs/RNMBXFillLayerNativeComponent.d.ts.map +1 -0
  172. package/lib/typescript/src/specs/RNMBXHeatmapLayerNativeComponent.d.ts +20 -0
  173. package/lib/typescript/src/specs/RNMBXHeatmapLayerNativeComponent.d.ts.map +1 -0
  174. package/lib/typescript/src/specs/RNMBXLineLayerNativeComponent.d.ts +20 -0
  175. package/lib/typescript/src/specs/RNMBXLineLayerNativeComponent.d.ts.map +1 -0
  176. package/lib/typescript/{specs → src/specs}/RNMBXMapViewNativeComponent.d.ts +23 -15
  177. package/lib/typescript/src/specs/RNMBXMapViewNativeComponent.d.ts.map +1 -0
  178. package/lib/typescript/src/specs/RNMBXRasterLayerNativeComponent.d.ts +20 -0
  179. package/lib/typescript/src/specs/RNMBXRasterLayerNativeComponent.d.ts.map +1 -0
  180. package/lib/typescript/src/specs/RNMBXSkyLayerNativeComponent.d.ts +19 -0
  181. package/lib/typescript/src/specs/RNMBXSkyLayerNativeComponent.d.ts.map +1 -0
  182. package/lib/typescript/src/specs/RNMBXStyleImportNativeComponent.d.ts.map +1 -0
  183. package/lib/typescript/src/specs/RNMBXSymbolLayerNativeComponent.d.ts +20 -0
  184. package/lib/typescript/src/specs/RNMBXSymbolLayerNativeComponent.d.ts.map +1 -0
  185. package/lib/typescript/{specs → src/specs}/codegenUtils.d.ts +1 -0
  186. package/lib/typescript/src/specs/codegenUtils.d.ts.map +1 -0
  187. package/lib/typescript/src/types/BaseProps.d.ts.map +1 -0
  188. package/lib/typescript/src/types/OnPressEvent.d.ts.map +1 -0
  189. package/lib/typescript/src/types/Position.d.ts.map +1 -0
  190. package/lib/typescript/src/types/index.d.ts.map +1 -0
  191. package/lib/typescript/src/utils/BridgeValue.d.ts.map +1 -0
  192. package/lib/typescript/src/utils/Logger.d.ts.map +1 -0
  193. package/lib/typescript/src/utils/StyleValue.d.ts.map +1 -0
  194. package/lib/typescript/src/utils/animated/Animated.d.ts.map +1 -0
  195. package/lib/typescript/src/utils/checkRequiredProps.d.ts.map +1 -0
  196. package/lib/typescript/src/utils/deprecation.d.ts.map +1 -0
  197. package/lib/typescript/src/utils/filterUtils.d.ts.map +1 -0
  198. package/lib/typescript/src/utils/geoUtils.d.ts.map +1 -0
  199. package/lib/typescript/src/utils/getAnnotationsLayerID.d.ts.map +1 -0
  200. package/lib/typescript/src/utils/index.d.ts.map +1 -0
  201. package/lib/typescript/src/utils/nativeRef.d.ts.map +1 -0
  202. package/lib/typescript/src/utils/styleMap.d.ts.map +1 -0
  203. package/lib/typescript/src/web/MapContext.d.ts.map +1 -0
  204. package/lib/typescript/src/web/components/Camera.d.ts.map +1 -0
  205. package/lib/typescript/src/web/components/MapView.d.ts.map +1 -0
  206. package/lib/typescript/src/web/utils/Logger.d.ts.map +1 -0
  207. package/package.json +10 -25
  208. package/rnmapbox-maps.podspec +3 -0
  209. package/setup-jest.js +19 -4
  210. package/src/components/MapView.tsx +66 -1
  211. package/src/specs/RNMBXBackgroundLayerNativeComponent.ts +9 -6
  212. package/src/specs/RNMBXCameraNativeComponent.ts +14 -11
  213. package/src/specs/RNMBXCircleLayerNativeComponent.ts +11 -8
  214. package/src/specs/RNMBXFillExtrusionLayerNativeComponent.ts +12 -9
  215. package/src/specs/RNMBXFillLayerNativeComponent.ts +11 -8
  216. package/src/specs/RNMBXHeatmapLayerNativeComponent.ts +12 -9
  217. package/src/specs/RNMBXLineLayerNativeComponent.ts +11 -8
  218. package/src/specs/RNMBXMapViewNativeComponent.ts +27 -15
  219. package/src/specs/RNMBXRasterLayerNativeComponent.ts +12 -9
  220. package/src/specs/RNMBXSkyLayerNativeComponent.ts +12 -9
  221. package/src/specs/RNMBXSymbolLayerNativeComponent.ts +12 -9
  222. package/src/specs/codegenUtils.ts +5 -0
  223. package/lib/typescript/Mapbox.d.ts.map +0 -1
  224. package/lib/typescript/RNMBXModule.d.ts.map +0 -1
  225. package/lib/typescript/components/AbstractLayer.d.ts.map +0 -1
  226. package/lib/typescript/components/AbstractSource.d.ts.map +0 -1
  227. package/lib/typescript/components/Annotation.d.ts.map +0 -1
  228. package/lib/typescript/components/Atmosphere.d.ts.map +0 -1
  229. package/lib/typescript/components/BackgroundLayer.d.ts.map +0 -1
  230. package/lib/typescript/components/Callout.d.ts.map +0 -1
  231. package/lib/typescript/components/Camera.d.ts.map +0 -1
  232. package/lib/typescript/components/CircleLayer.d.ts.map +0 -1
  233. package/lib/typescript/components/FillExtrusionLayer.d.ts.map +0 -1
  234. package/lib/typescript/components/FillLayer.d.ts.map +0 -1
  235. package/lib/typescript/components/HeadingIndicator.d.ts.map +0 -1
  236. package/lib/typescript/components/HeatmapLayer.d.ts.map +0 -1
  237. package/lib/typescript/components/Image.d.ts.map +0 -1
  238. package/lib/typescript/components/ImageSource.d.ts.map +0 -1
  239. package/lib/typescript/components/Images.d.ts.map +0 -1
  240. package/lib/typescript/components/Light.d.ts.map +0 -1
  241. package/lib/typescript/components/LineLayer.d.ts.map +0 -1
  242. package/lib/typescript/components/MapView.d.ts.map +0 -1
  243. package/lib/typescript/components/MarkerView.d.ts.map +0 -1
  244. package/lib/typescript/components/NativeBridgeComponent.d.ts.map +0 -1
  245. package/lib/typescript/components/NativeUserLocation.d.ts.map +0 -1
  246. package/lib/typescript/components/PointAnnotation.d.ts.map +0 -1
  247. package/lib/typescript/components/RasterDemSource.d.ts.map +0 -1
  248. package/lib/typescript/components/RasterLayer.d.ts.map +0 -1
  249. package/lib/typescript/components/RasterSource.d.ts.map +0 -1
  250. package/lib/typescript/components/ShapeSource.d.ts.map +0 -1
  251. package/lib/typescript/components/SkyLayer.d.ts.map +0 -1
  252. package/lib/typescript/components/Style.d.ts.map +0 -1
  253. package/lib/typescript/components/StyleImport.d.ts.map +0 -1
  254. package/lib/typescript/components/SymbolLayer.d.ts.map +0 -1
  255. package/lib/typescript/components/Terrain.d.ts.map +0 -1
  256. package/lib/typescript/components/UserLocation.d.ts.map +0 -1
  257. package/lib/typescript/components/VectorSource.d.ts.map +0 -1
  258. package/lib/typescript/index.d.ts.map +0 -1
  259. package/lib/typescript/modules/location/locationManager.d.ts.map +0 -1
  260. package/lib/typescript/modules/offline/OfflineCreatePackOptions.d.ts.map +0 -1
  261. package/lib/typescript/modules/offline/OfflinePack.d.ts.map +0 -1
  262. package/lib/typescript/modules/offline/offlineManager.d.ts.map +0 -1
  263. package/lib/typescript/modules/snapshot/SnapshotOptions.d.ts.map +0 -1
  264. package/lib/typescript/modules/snapshot/snapshotManager.d.ts.map +0 -1
  265. package/lib/typescript/requestAndroidLocationPermissions.d.ts.map +0 -1
  266. package/lib/typescript/specs/NativeMapViewModule.d.ts.map +0 -1
  267. package/lib/typescript/specs/RNMBXAndroidTextureMapViewNativeComponent.d.ts.map +0 -1
  268. package/lib/typescript/specs/RNMBXAtmosphereNativeComponent.d.ts.map +0 -1
  269. package/lib/typescript/specs/RNMBXBackgroundLayerNativeComponent.d.ts.map +0 -1
  270. package/lib/typescript/specs/RNMBXCameraNativeComponent.d.ts.map +0 -1
  271. package/lib/typescript/specs/RNMBXCircleLayerNativeComponent.d.ts +0 -19
  272. package/lib/typescript/specs/RNMBXCircleLayerNativeComponent.d.ts.map +0 -1
  273. package/lib/typescript/specs/RNMBXFillExtrusionLayerNativeComponent.d.ts.map +0 -1
  274. package/lib/typescript/specs/RNMBXFillLayerNativeComponent.d.ts +0 -19
  275. package/lib/typescript/specs/RNMBXFillLayerNativeComponent.d.ts.map +0 -1
  276. package/lib/typescript/specs/RNMBXHeatmapLayerNativeComponent.d.ts +0 -19
  277. package/lib/typescript/specs/RNMBXHeatmapLayerNativeComponent.d.ts.map +0 -1
  278. package/lib/typescript/specs/RNMBXLineLayerNativeComponent.d.ts +0 -19
  279. package/lib/typescript/specs/RNMBXLineLayerNativeComponent.d.ts.map +0 -1
  280. package/lib/typescript/specs/RNMBXMapViewNativeComponent.d.ts.map +0 -1
  281. package/lib/typescript/specs/RNMBXRasterLayerNativeComponent.d.ts +0 -19
  282. package/lib/typescript/specs/RNMBXRasterLayerNativeComponent.d.ts.map +0 -1
  283. package/lib/typescript/specs/RNMBXSkyLayerNativeComponent.d.ts +0 -18
  284. package/lib/typescript/specs/RNMBXSkyLayerNativeComponent.d.ts.map +0 -1
  285. package/lib/typescript/specs/RNMBXStyleImportNativeComponent.d.ts.map +0 -1
  286. package/lib/typescript/specs/RNMBXSymbolLayerNativeComponent.d.ts +0 -19
  287. package/lib/typescript/specs/RNMBXSymbolLayerNativeComponent.d.ts.map +0 -1
  288. package/lib/typescript/specs/codegenUtils.d.ts.map +0 -1
  289. package/lib/typescript/types/BaseProps.d.ts.map +0 -1
  290. package/lib/typescript/types/OnPressEvent.d.ts.map +0 -1
  291. package/lib/typescript/types/Position.d.ts.map +0 -1
  292. package/lib/typescript/types/index.d.ts.map +0 -1
  293. package/lib/typescript/utils/BridgeValue.d.ts.map +0 -1
  294. package/lib/typescript/utils/Logger.d.ts.map +0 -1
  295. package/lib/typescript/utils/StyleValue.d.ts.map +0 -1
  296. package/lib/typescript/utils/animated/Animated.d.ts.map +0 -1
  297. package/lib/typescript/utils/checkRequiredProps.d.ts.map +0 -1
  298. package/lib/typescript/utils/deprecation.d.ts.map +0 -1
  299. package/lib/typescript/utils/filterUtils.d.ts.map +0 -1
  300. package/lib/typescript/utils/geoUtils.d.ts.map +0 -1
  301. package/lib/typescript/utils/getAnnotationsLayerID.d.ts.map +0 -1
  302. package/lib/typescript/utils/index.d.ts.map +0 -1
  303. package/lib/typescript/utils/nativeRef.d.ts.map +0 -1
  304. package/lib/typescript/utils/styleMap.d.ts.map +0 -1
  305. package/lib/typescript/web/MapContext.d.ts.map +0 -1
  306. package/lib/typescript/web/components/Camera.d.ts.map +0 -1
  307. package/lib/typescript/web/components/MapView.d.ts.map +0 -1
  308. package/lib/typescript/web/utils/Logger.d.ts.map +0 -1
  309. /package/lib/typescript/{Mapbox.d.ts → src/Mapbox.d.ts} +0 -0
  310. /package/lib/typescript/{RNMBXModule.d.ts → src/RNMBXModule.d.ts} +0 -0
  311. /package/lib/typescript/{components → src/components}/AbstractLayer.d.ts +0 -0
  312. /package/lib/typescript/{components → src/components}/AbstractSource.d.ts +0 -0
  313. /package/lib/typescript/{components → src/components}/Annotation.d.ts +0 -0
  314. /package/lib/typescript/{components → src/components}/Atmosphere.d.ts +0 -0
  315. /package/lib/typescript/{components → src/components}/BackgroundLayer.d.ts +0 -0
  316. /package/lib/typescript/{components → src/components}/Callout.d.ts +0 -0
  317. /package/lib/typescript/{components → src/components}/Camera.d.ts +0 -0
  318. /package/lib/typescript/{components → src/components}/CircleLayer.d.ts +0 -0
  319. /package/lib/typescript/{components → src/components}/FillExtrusionLayer.d.ts +0 -0
  320. /package/lib/typescript/{components → src/components}/FillLayer.d.ts +0 -0
  321. /package/lib/typescript/{components → src/components}/HeadingIndicator.d.ts +0 -0
  322. /package/lib/typescript/{components → src/components}/HeatmapLayer.d.ts +0 -0
  323. /package/lib/typescript/{components → src/components}/Image.d.ts +0 -0
  324. /package/lib/typescript/{components → src/components}/ImageSource.d.ts +0 -0
  325. /package/lib/typescript/{components → src/components}/Images.d.ts +0 -0
  326. /package/lib/typescript/{components → src/components}/Light.d.ts +0 -0
  327. /package/lib/typescript/{components → src/components}/LineLayer.d.ts +0 -0
  328. /package/lib/typescript/{components → src/components}/MarkerView.d.ts +0 -0
  329. /package/lib/typescript/{components → src/components}/NativeBridgeComponent.d.ts +0 -0
  330. /package/lib/typescript/{components → src/components}/NativeUserLocation.d.ts +0 -0
  331. /package/lib/typescript/{components → src/components}/PointAnnotation.d.ts +0 -0
  332. /package/lib/typescript/{components → src/components}/RasterDemSource.d.ts +0 -0
  333. /package/lib/typescript/{components → src/components}/RasterLayer.d.ts +0 -0
  334. /package/lib/typescript/{components → src/components}/RasterSource.d.ts +0 -0
  335. /package/lib/typescript/{components → src/components}/ShapeSource.d.ts +0 -0
  336. /package/lib/typescript/{components → src/components}/SkyLayer.d.ts +0 -0
  337. /package/lib/typescript/{components → src/components}/Style.d.ts +0 -0
  338. /package/lib/typescript/{components → src/components}/StyleImport.d.ts +0 -0
  339. /package/lib/typescript/{components → src/components}/SymbolLayer.d.ts +0 -0
  340. /package/lib/typescript/{components → src/components}/Terrain.d.ts +0 -0
  341. /package/lib/typescript/{components → src/components}/UserLocation.d.ts +0 -0
  342. /package/lib/typescript/{components → src/components}/VectorSource.d.ts +0 -0
  343. /package/lib/typescript/{index.d.ts → src/index.d.ts} +0 -0
  344. /package/lib/typescript/{modules → src/modules}/location/locationManager.d.ts +0 -0
  345. /package/lib/typescript/{modules → src/modules}/offline/OfflineCreatePackOptions.d.ts +0 -0
  346. /package/lib/typescript/{modules → src/modules}/offline/OfflinePack.d.ts +0 -0
  347. /package/lib/typescript/{modules → src/modules}/offline/offlineManager.d.ts +0 -0
  348. /package/lib/typescript/{modules → src/modules}/snapshot/SnapshotOptions.d.ts +0 -0
  349. /package/lib/typescript/{modules → src/modules}/snapshot/snapshotManager.d.ts +0 -0
  350. /package/lib/typescript/{requestAndroidLocationPermissions.d.ts → src/requestAndroidLocationPermissions.d.ts} +0 -0
  351. /package/lib/typescript/{specs → src/specs}/NativeMapViewModule.d.ts +0 -0
  352. /package/lib/typescript/{specs → src/specs}/RNMBXAndroidTextureMapViewNativeComponent.d.ts +0 -0
  353. /package/lib/typescript/{specs → src/specs}/RNMBXAtmosphereNativeComponent.d.ts +0 -0
  354. /package/lib/typescript/{specs → src/specs}/RNMBXStyleImportNativeComponent.d.ts +0 -0
  355. /package/lib/typescript/{types → src/types}/BaseProps.d.ts +0 -0
  356. /package/lib/typescript/{types → src/types}/OnPressEvent.d.ts +0 -0
  357. /package/lib/typescript/{types → src/types}/Position.d.ts +0 -0
  358. /package/lib/typescript/{types → src/types}/index.d.ts +0 -0
  359. /package/lib/typescript/{utils → src/utils}/BridgeValue.d.ts +0 -0
  360. /package/lib/typescript/{utils → src/utils}/Logger.d.ts +0 -0
  361. /package/lib/typescript/{utils → src/utils}/StyleValue.d.ts +0 -0
  362. /package/lib/typescript/{utils → src/utils}/animated/Animated.d.ts +0 -0
  363. /package/lib/typescript/{utils → src/utils}/checkRequiredProps.d.ts +0 -0
  364. /package/lib/typescript/{utils → src/utils}/deprecation.d.ts +0 -0
  365. /package/lib/typescript/{utils → src/utils}/filterUtils.d.ts +0 -0
  366. /package/lib/typescript/{utils → src/utils}/geoUtils.d.ts +0 -0
  367. /package/lib/typescript/{utils → src/utils}/getAnnotationsLayerID.d.ts +0 -0
  368. /package/lib/typescript/{utils → src/utils}/index.d.ts +0 -0
  369. /package/lib/typescript/{utils → src/utils}/nativeRef.d.ts +0 -0
  370. /package/lib/typescript/{utils → src/utils}/styleMap.d.ts +0 -0
  371. /package/lib/typescript/{web → src/web}/MapContext.d.ts +0 -0
  372. /package/lib/typescript/{web → src/web}/components/Camera.d.ts +0 -0
  373. /package/lib/typescript/{web → src/web}/components/MapView.d.ts +0 -0
  374. /package/lib/typescript/{web → src/web}/utils/Logger.d.ts +0 -0
@@ -15,6 +15,8 @@ abstract class AbstractMapFeature(context: Context?) : ReactViewGroup(context) {
15
15
  protected var mMapView: RNMBXMapView? = null;
16
16
  private var mWithMapViewCallbacks: Array<((RNMBXMapView) -> Unit)>? = null;
17
17
 
18
+ open var requiresStyleLoad = true;
19
+
18
20
  open fun addToMap(mapView: RNMBXMapView) {
19
21
  mMapView = mapView;
20
22
  mWithMapViewCallbacks?.forEach { it(mapView) }
@@ -40,6 +40,8 @@ class RNMBXCamera(private val mContext: Context, private val mManager: RNMBXCame
40
40
  AbstractMapFeature(
41
41
  mContext
42
42
  ) {
43
+ override var requiresStyleLoad = false
44
+
43
45
  private var hasSentFirstRegion = false
44
46
  private var mDefaultStop: CameraStop? = null
45
47
  private var mCameraStop: CameraStop? = null
@@ -317,21 +319,77 @@ class RNMBXCamera(private val mContext: Context, private val mManager: RNMBXCame
317
319
  when (status) {
318
320
  ViewportStatus.Idle -> return null
319
321
  is ViewportStatus.State ->
320
- return toFollowUserMode(status)
322
+ return toFollowUserMode(status.state)
321
323
  is ViewportStatus.Transition ->
322
324
  return toFollowUserMode(status.toState)
323
325
  }
324
326
  }
325
327
 
328
+ fun toUserTrackingMode(state: ViewportState): Int {
329
+ when (state) {
330
+ is FollowPuckViewportState -> {
331
+ return when (state.options.bearing) {
332
+ is FollowPuckViewportStateBearing.SyncWithLocationPuck -> {
333
+ val location = mMapView?.mapView?.location2
334
+ if (location?.puckBearingEnabled == true) {
335
+ when (location.puckBearingSource) {
336
+
337
+ PuckBearingSource.HEADING -> {
338
+ UserTrackingMode.FollowWithHeading
339
+ }
340
+ PuckBearingSource.COURSE -> {
341
+ UserTrackingMode.FollowWithCourse
342
+ }
343
+ else -> {
344
+ UserTrackingMode.FOLLOW
345
+ }
346
+ }
347
+ } else {
348
+ UserTrackingMode.FOLLOW
349
+ }
350
+ }
351
+
352
+ is FollowPuckViewportStateBearing.Constant ->
353
+ UserTrackingMode.FOLLOW
354
+
355
+ else -> {
356
+ Logger.w(LOG_TAG, "Unexpected bearing: ${state.options.bearing}")
357
+ UserTrackingMode.FOLLOW
358
+ }
359
+ }
360
+ }
361
+
362
+ is OverviewViewportState -> {
363
+ return UserTrackingMode.NONE
364
+ }
365
+
366
+ else -> {
367
+ return UserTrackingMode.NONE // TODO
368
+ }
369
+ }
370
+ }
371
+
372
+ fun toUserTrackingMode(status: ViewportStatus): Int {
373
+ return when (status) {
374
+ ViewportStatus.Idle -> UserTrackingMode.NONE
375
+ is ViewportStatus.State ->
376
+ toUserTrackingMode(status.state)
377
+
378
+ is ViewportStatus.Transition ->
379
+ toUserTrackingMode(status.toState)
380
+ }
381
+ }
382
+
326
383
  fun toReadableMap(status: ViewportStatus): ReadableMap {
327
- when (status) {
328
- ViewportStatus.Idle -> return writableMapOf("state" to "idle")
384
+ return when (status) {
385
+ ViewportStatus.Idle -> writableMapOf("state" to "idle")
329
386
  is ViewportStatus.State ->
330
- return writableMapOf(
387
+ writableMapOf(
331
388
  "state" to status.toString()
332
389
  )
390
+
333
391
  is ViewportStatus.Transition ->
334
- return writableMapOf(
392
+ writableMapOf(
335
393
  "transition" to status.toString()
336
394
  )
337
395
  }
@@ -344,12 +402,11 @@ class RNMBXCamera(private val mContext: Context, private val mManager: RNMBXCame
344
402
  toStatus: ViewportStatus,
345
403
  reason: ViewportStatusChangeReason
346
404
  ) {
347
- if (reason == ViewportStatusChangeReason.USER_INTERACTION) {
405
+ if (reason == ViewportStatusChangeReason.USER_INTERACTION || reason == ViewportStatusChangeReason.TRANSITION_SUCCEEDED) {
348
406
  val followUserLocation = toFollowUserLocation(toStatus)
349
407
 
350
-
351
-
352
- mManager.handleEvent(MapUserTrackingModeEvent(this@RNMBXCamera, UserTrackingMode.NONE,
408
+ val mode = toUserTrackingMode(toStatus)
409
+ mManager.handleEvent(MapUserTrackingModeEvent(this@RNMBXCamera, mode,
353
410
  writableMapOf(
354
411
  "followUserMode" to toFollowUserMode(toStatus),
355
412
  "followUserLocation" to followUserLocation,
@@ -228,8 +228,8 @@ class RNMBXImages(context: Context, private val mManager: RNMBXImagesManager) :
228
228
  var maxY = info.stretchY.maxOfOrNull { max(it.first, it.second) } ?: 0.0f
229
229
  var maxX = info.stretchX.maxOfOrNull { max(it.first, it.second) } ?: 0.0f
230
230
  if (info.content != null) {
231
- maxX = max(max(info.content.left,info.content.right), maxX)
232
- maxY = max(max(info.content.top,info.content.bottom), maxY)
231
+ maxX = max(max(info.content.left, info.content.right), maxX)
232
+ maxY = max(max(info.content.top, info.content.bottom), maxY)
233
233
  }
234
234
  return emptyImage(ceil(maxX).toInt()+1, ceil(maxY).toInt()+1)
235
235
  } else {
@@ -67,7 +67,7 @@ class LocationComponentManager(mapView: RNMBXMapView, context: Context) {
67
67
 
68
68
  private fun applyStateChanges(map: RNMBXMapView, oldState: State, newState: State, fullUpdate: Boolean) {
69
69
  val mapView = map.mapView
70
- if (map.getLifecycleState() != Lifecycle.State.STARTED) {
70
+ if (map.getLifecycleState() != Lifecycle.State.STARTED && map.getLifecycleState() != Lifecycle.State.INITIALIZED) {
71
71
  // In case lifecycle was already stopped, so we're part of shutdown, do not call updateSettings as it'll just restart
72
72
  // the loationComponent that will not be stopped. See https://github.com/mapbox/mapbox-maps-android/issues/2017
73
73
  if (!newState.enabled) {
@@ -25,6 +25,7 @@ object UserTrackingMode {
25
25
  FOLLOW -> return "normal"
26
26
  FollowWithCourse -> return "course"
27
27
  FollowWithHeading -> return "compass"
28
+ NONE -> return null
28
29
  }
29
30
  return null
30
31
  }
@@ -478,7 +478,7 @@ open class RNMBXMapView(private val mContext: Context, var mManager: RNMBXMapVie
478
478
  }
479
479
  }
480
480
 
481
- val addToMap = styleLoaded
481
+ val addToMap = styleLoaded || (feature?.requiresStyleLoad == false)
482
482
 
483
483
  var entry = FeatureEntry(feature, childView, false)
484
484
  if (addToMap) {
@@ -541,11 +541,13 @@ open class RNMBXMapView(private val mContext: Context, var mManager: RNMBXMapVie
541
541
  }
542
542
  }
543
543
 
544
- private fun addFeaturesToMap() {
544
+ private fun addFeaturesToMap(styleLoaded: Boolean = false) {
545
545
  mFeatures.forEach {
546
546
  if (!it.addedToMap) {
547
- it.feature?.addToMap(this)
548
- it.addedToMap = true
547
+ if (styleLoaded || it.feature?.requiresStyleLoad == false) {
548
+ it.feature?.addToMap(this)
549
+ it.addedToMap = true
550
+ }
549
551
  }
550
552
  }
551
553
  }
@@ -654,6 +656,7 @@ open class RNMBXMapView(private val mContext: Context, var mManager: RNMBXMapVie
654
656
  }
655
657
  }
656
658
  )
659
+ addFeaturesToMap(false)
657
660
  }
658
661
  }
659
662
  }
@@ -23,6 +23,8 @@ import com.rnmapbox.rnmbx.utils.ConvertUtils
23
23
  import com.rnmapbox.rnmbx.utils.ExpressionParser
24
24
  import com.rnmapbox.rnmbx.utils.Logger
25
25
  import com.rnmapbox.rnmbx.utils.ViewTagResolver
26
+ import com.rnmapbox.rnmbx.utils.extensions.getAndLogIfNotBoolean
27
+ import com.rnmapbox.rnmbx.utils.extensions.getAndLogIfNotDouble
26
28
  import com.rnmapbox.rnmbx.utils.extensions.toCoordinate
27
29
  import com.rnmapbox.rnmbx.utils.extensions.toRectF
28
30
  import com.rnmapbox.rnmbx.utils.extensions.toScreenCoordinate
@@ -139,6 +141,55 @@ open class RNMBXMapViewManager(context: ReactApplicationContext, val viewTagReso
139
141
  mapView.setReactLocalizeLabels(locale, layerIds)
140
142
  }
141
143
 
144
+ @ReactProp(name = "gestureSettings")
145
+ override fun setGestureSettings(mapView: RNMBXMapView, settings: Dynamic) {
146
+ mapView.getMapboxMap().gesturesPlugin {
147
+ val map = settings.asMap()
148
+ this.updateSettings {
149
+ map.getAndLogIfNotBoolean("doubleTapToZoomInEnabled", LOG_TAG)?.let {
150
+ this.doubleTapToZoomInEnabled = it
151
+ }
152
+ map.getAndLogIfNotBoolean("doubleTouchToZoomOutEnabled", LOG_TAG)?.let {
153
+ this.doubleTouchToZoomOutEnabled = it
154
+ }
155
+ map.getAndLogIfNotBoolean("pinchPanEnabled", LOG_TAG)?.let {
156
+ this.pinchScrollEnabled = it
157
+ }
158
+ map.getAndLogIfNotBoolean("pinchZoomEnabled", LOG_TAG)?.let {
159
+ this.pinchToZoomEnabled = it
160
+ }
161
+ map.getAndLogIfNotBoolean("pinchZoomDecelerationEnabled", LOG_TAG)?.let {
162
+ this.pinchToZoomDecelerationEnabled = it
163
+ }
164
+ map.getAndLogIfNotBoolean("pitchEnabled", LOG_TAG)?.let {
165
+ this.pitchEnabled = it
166
+ }
167
+ map.getAndLogIfNotBoolean("quickZoomEnabled", LOG_TAG)?.let {
168
+ this.quickZoomEnabled = it
169
+ }
170
+ map.getAndLogIfNotBoolean("rotateEnabled", LOG_TAG)?.let {
171
+ this.rotateEnabled = it
172
+ }
173
+ map.getAndLogIfNotBoolean("rotateDecelerationEnabled", LOG_TAG)?.let {
174
+ this.rotateDecelerationEnabled = it
175
+ }
176
+ map.getAndLogIfNotBoolean("panEnabled", LOG_TAG)?.let {
177
+ this.scrollEnabled = it
178
+ }
179
+ map.getAndLogIfNotDouble("panDecelerationFactor", LOG_TAG)?.let {
180
+ this.scrollDecelerationEnabled = it > 0.0
181
+ }
182
+ map.getAndLogIfNotBoolean("simultaneousRotateAndPinchToZoomEnabled", LOG_TAG)?.let {
183
+ this.simultaneousRotateAndPinchToZoomEnabled = it
184
+ }
185
+ map.getAndLogIfNotDouble("zoomAnimationAmount", LOG_TAG)?.let {
186
+ this.zoomAnimationAmount = it.toFloat()
187
+ }
188
+ }
189
+ }
190
+
191
+ }
192
+
142
193
  @ReactProp(name = "styleURL")
143
194
  override fun setStyleURL(mapView: RNMBXMapView, styleURL:Dynamic) {
144
195
  mapView.setReactStyleURL(styleURL.asString())
@@ -61,12 +61,6 @@ class RNMBXSkyLayerManager : ViewGroupManager<RNMBXSkyLayer>(),
61
61
  layer.setReactStyle(style.asMap())
62
62
  }
63
63
 
64
- // not available
65
- // @ReactProp(name = "sourceLayerID")
66
- // override fun setSourceLayerId(layer: RNMBXSkyLayer, sourceLayerID: Dynamic) {
67
- // layer.setSourceLayerID(sourceLayerID.asString())
68
- // }
69
-
70
64
  @ReactProp(name = "filter")
71
65
  override fun setFilter(layer: RNMBXSkyLayer, filterList: Dynamic) {
72
66
  layer.setFilter(filterList.asArray())
@@ -33,10 +33,6 @@ object BitmapUtils {
33
33
  }
34
34
  }
35
35
 
36
- fun getBitmapFromURL(url: String?): Bitmap? {
37
- return getBitmapFromURL(url, null)
38
- }
39
-
40
36
  fun toImage(bitmap: Bitmap): Image {
41
37
  if (bitmap.config != Bitmap.Config.ARGB_8888) {
42
38
  throw RuntimeException("Only ARGB_8888 bitmap config is supported!")
@@ -71,33 +67,6 @@ object BitmapUtils {
71
67
  }
72
68
  }
73
69
 
74
- fun getBitmapFromURL(url: String?, options: BitmapFactory.Options?): Bitmap? {
75
- var bitmap = getImage(url)
76
- if (bitmap != null) {
77
- return bitmap
78
- }
79
- try {
80
- val bitmapStream = URL(url).openStream()
81
- bitmap = BitmapFactory.decodeStream(bitmapStream, null, options)
82
- bitmapStream.close()
83
- addImage(url, bitmap)
84
- } catch (e: Exception) {
85
- Log.w(LOG_TAG, e.localizedMessage)
86
- bitmap =
87
- Bitmap.createBitmap(1, 1, Bitmap.Config.ALPHA_8) // Returns a transparent bitmap
88
- }
89
- return bitmap
90
- }
91
-
92
- fun getBitmapFromResource(
93
- context: Context,
94
- resourceName: String?,
95
- options: BitmapFactory.Options?
96
- ): Bitmap {
97
- val resources = context.resources
98
- val resID = resources.getIdentifier(resourceName, "drawable", context.packageName)
99
- return BitmapFactory.decodeResource(resources, resID, options)
100
- }
101
70
 
102
71
  @Throws(IOException::class)
103
72
  fun createImgTempFile(context: Context, image: Image): String? {
@@ -4,11 +4,9 @@ import android.content.Context
4
4
  import android.graphics.Bitmap
5
5
  import com.mapbox.maps.Style
6
6
  import com.mapbox.maps.MapboxMap
7
- import com.rnmapbox.rnmbx.utils.DownloadMapImageTask.OnAllImagesLoaded
8
7
  import android.os.AsyncTask
9
8
  import com.rnmapbox.rnmbx.utils.ImageEntry
10
9
  import android.util.DisplayMetrics
11
- import com.rnmapbox.rnmbx.utils.DownloadMapImageTask
12
10
  import android.graphics.BitmapFactory
13
11
  import android.net.Uri
14
12
  import android.util.Log
@@ -22,11 +20,8 @@ import com.facebook.imagepipeline.image.CloseableStaticBitmap
22
20
  import com.facebook.imagepipeline.request.ImageRequestBuilder
23
21
  import com.facebook.react.views.imagehelper.ImageSource
24
22
  import com.rnmapbox.rnmbx.components.images.ImageInfo
25
- import com.rnmapbox.rnmbx.components.images.addBitmapImage
26
23
  import java.io.File
27
24
  import java.lang.ref.WeakReference
28
- import java.util.AbstractMap
29
- import java.util.ArrayList
30
25
  import java.util.HashMap
31
26
  import com.rnmapbox.rnmbx.v11compat.image.*
32
27
 
@@ -54,64 +49,40 @@ class DownloadMapImageTask(context: Context, map: MapboxMap, callback: OnAllImag
54
49
  if (uri.startsWith("/")) {
55
50
  uri = Uri.fromFile(File(uri)).toString()
56
51
  }
57
- if (uri.startsWith("http://") || uri.startsWith("https://") ||
58
- uri.startsWith("file://") || uri.startsWith("asset://") || uri.startsWith("data:")
59
- ) {
60
- val source = ImageSource(context, uri)
61
- val request = ImageRequestBuilder.newBuilderWithSource(source.uri)
62
- .setRotationOptions(RotationOptions.autoRotate())
63
- .build()
64
- val dataSource =
65
- Fresco.getImagePipeline().fetchDecodedImage(request, mCallerContext)
66
- var result: CloseableReference<CloseableImage>? = null
67
- try {
68
- result = DataSources.waitForFinalResult(dataSource)
69
- if (result != null) {
70
- val image = result.get()
71
- if (image is CloseableStaticBitmap) {
72
- val bitmap =
73
- image.underlyingBitmap // Copy the bitmap to make sure it doesn't get recycled when we release
74
- // the fresco reference.
75
- .copy(Bitmap.Config.ARGB_8888, true)
76
- bitmap.density =
77
- (DisplayMetrics.DENSITY_DEFAULT.toDouble() * imageEntry.getScaleOr(
78
- 1.0
79
- )).toInt()
80
- images.add(
81
- DownloadedImage(name=key, bitmap=bitmap, info=imageEntry.info)
82
- )
83
- } else {
84
- FLog.e(LOG_TAG, "Failed to load bitmap from: $uri")
85
- }
52
+ val source = ImageSource(context, uri)
53
+ val request = ImageRequestBuilder.newBuilderWithSource(source.uri)
54
+ .setRotationOptions(RotationOptions.autoRotate())
55
+ .build()
56
+ val dataSource =
57
+ Fresco.getImagePipeline().fetchDecodedImage(request, mCallerContext)
58
+ var result: CloseableReference<CloseableImage>? = null
59
+ try {
60
+ result = DataSources.waitForFinalResult(dataSource)
61
+ if (result != null) {
62
+ val image = result.get()
63
+ if (image is CloseableStaticBitmap) {
64
+ val bitmap =
65
+ image.underlyingBitmap // Copy the bitmap to make sure it doesn't get recycled when we release
66
+ // the fresco reference.
67
+ .copy(Bitmap.Config.ARGB_8888, true)
68
+ Log.e("RNMBXImageManager", "downloadImage: $key $uri $image ${image.width}x${image.height}")
69
+ bitmap.density = DisplayMetrics.DENSITY_DEFAULT
70
+ images.add(
71
+ DownloadedImage(name=key, bitmap=bitmap, info=imageEntry.info)
72
+ )
86
73
  } else {
87
74
  FLog.e(LOG_TAG, "Failed to load bitmap from: $uri")
88
75
  }
89
- } catch (e: Throwable) {
90
- Log.w(LOG_TAG, e.localizedMessage)
91
- } finally {
92
- dataSource.close()
93
- if (result != null) {
94
- CloseableReference.closeSafely(result)
95
- }
96
- }
97
- } else {
98
- // local asset required from JS require('image.png') or import icon from 'image.png' while in release mode
99
- val bitmap = BitmapUtils.getBitmapFromResource(
100
- context,
101
- uri,
102
- getBitmapOptions(metrics, imageEntry.info.scale)
103
- )
104
- if (bitmap != null) {
105
- images.add(
106
- DownloadedImage(
107
- name=key,
108
- bitmap=bitmap,
109
- info=imageEntry.info
110
- )
111
- )
112
76
  } else {
113
77
  FLog.e(LOG_TAG, "Failed to load bitmap from: $uri")
114
78
  }
79
+ } catch (e: Throwable) {
80
+ Log.w(LOG_TAG, e.localizedMessage)
81
+ } finally {
82
+ dataSource.close()
83
+ if (result != null) {
84
+ CloseableReference.closeSafely(result)
85
+ }
115
86
  }
116
87
  }
117
88
  return images
@@ -134,16 +105,6 @@ class DownloadMapImageTask(context: Context, map: MapboxMap, callback: OnAllImag
134
105
  mCallback?.onAllImagesLoaded()
135
106
  }
136
107
 
137
- private fun getBitmapOptions(metrics: DisplayMetrics, scale: Double?): BitmapFactory.Options {
138
- val options = BitmapFactory.Options()
139
- options.inScreenDensity = metrics.densityDpi
140
- options.inTargetDensity = metrics.densityDpi
141
- if (scale != null) {
142
- options.inDensity = (DisplayMetrics.DENSITY_DEFAULT.toDouble() * scale).toInt()
143
- }
144
- return options
145
- }
146
-
147
108
  companion object {
148
109
  const val LOG_TAG = "DownloadMapImageTask"
149
110
  }
@@ -2,6 +2,7 @@ package com.rnmapbox.rnmbx.utils.extensions
2
2
 
3
3
  import com.facebook.react.bridge.ReadableMap
4
4
  import com.facebook.react.bridge.ReadableType
5
+ import com.rnmapbox.rnmbx.utils.Logger
5
6
 
6
7
  fun ReadableMap.forEach(action: (String, Any) -> Unit) {
7
8
  val iterator = this.entryIterator
@@ -17,3 +18,37 @@ fun ReadableMap.getIfDouble(key: String): Double? {
17
18
  null
18
19
  }
19
20
  }
21
+
22
+ fun ReadableMap.getIfBoolean(key: String): Boolean? {
23
+ return if (hasKey(key) && (getType(key) == ReadableType.Boolean)) {
24
+ getBoolean(key)
25
+ } else {
26
+ null
27
+ }
28
+ }
29
+
30
+ fun ReadableMap.getAndLogIfNotBoolean(key: String, tag:String = "RNMBXReadableMap"): Boolean? {
31
+ return if (hasKey(key)) {
32
+ if (getType(key) == ReadableType.Boolean) {
33
+ getBoolean(key)
34
+ } else {
35
+ Logger.e("RNMBXReadableMap", "$key is expected to be a boolean but was: ${getType(key)}")
36
+ null
37
+ }
38
+ } else {
39
+ null
40
+ }
41
+ }
42
+
43
+ fun ReadableMap.getAndLogIfNotDouble(key: String, tag: String = "RNMBXReadableMap"): Double? {
44
+ return if (hasKey(key)) {
45
+ if (getType(key) == ReadableType.Number) {
46
+ getDouble(key)
47
+ } else {
48
+ Logger.e("RNMBXReadableMap", "$key is expected to be a double but was: ${getType(key)}")
49
+ null
50
+ }
51
+ } else {
52
+ null
53
+ }
54
+ }
@@ -65,4 +65,4 @@ fun emptyImage(width: Int, height: Int): Image {
65
65
  return Image(
66
66
  width, height, DataRef.allocateNative(width * height * 4)
67
67
  )
68
- }
68
+ }
@@ -79,6 +79,9 @@ public class RNMBXMapViewManagerDelegate<T extends View, U extends BaseViewManag
79
79
  case "styleURL":
80
80
  mViewManager.setStyleURL(view, new DynamicFromObject(value));
81
81
  break;
82
+ case "gestureSettings":
83
+ mViewManager.setGestureSettings(view, new DynamicFromObject(value));
84
+ break;
82
85
  case "scaleBarViewMargins":
83
86
  mViewManager.setScaleBarViewMargins(view, new DynamicFromObject(value));
84
87
  break;
@@ -32,6 +32,7 @@ public interface RNMBXMapViewManagerInterface<T extends View> {
32
32
  void setProjection(T view, Dynamic value);
33
33
  void setLocalizeLabels(T view, Dynamic value);
34
34
  void setStyleURL(T view, Dynamic value);
35
+ void setGestureSettings(T view, Dynamic value);
35
36
  void setScaleBarViewMargins(T view, Dynamic value);
36
37
  void setAttributionViewMargins(T view, Dynamic value);
37
38
  void setAttributionViewPosition(T view, Dynamic value);
@@ -1,6 +1,17 @@
1
1
  import MapboxMaps
2
2
 
3
3
  class CustomHttpHeaders : HttpServiceInterceptorInterface {
4
+ #if RNMBX_11
5
+ func onRequest(for request: HttpRequest, continuation: @escaping HttpServiceInterceptorRequestContinuation) {
6
+ let request = onRequest(for: request)
7
+ continuation(HttpRequestOrResponse.fromHttpRequest(request))
8
+ }
9
+
10
+ func onResponse(for response: HttpResponse, continuation: @escaping HttpServiceInterceptorResponseContinuation) {
11
+ continuation(response)
12
+ }
13
+ #endif
14
+
4
15
  static var shared : CustomHttpHeaders = {
5
16
  let headers = CustomHttpHeaders()
6
17
  headers.install()
@@ -255,7 +255,9 @@ open class RNMBXMapView : MapView {
255
255
  @objc public func setReactProjection(_ value: String?) {
256
256
  if let value = value {
257
257
  let projection = StyleProjection(name: value == "globe" ? .globe : .mercator)
258
- try! self.mapboxMap.style.setProjection(projection)
258
+ logged("RNMBXMapView.setReactProjection") {
259
+ try self.mapboxMap.style.setProjection(projection)
260
+ }
259
261
  }
260
262
  }
261
263
 
@@ -272,6 +274,59 @@ open class RNMBXMapView : MapView {
272
274
  }
273
275
  }
274
276
 
277
+ @objc public func setReactGestureSettings(_ value: NSDictionary?) {
278
+ if let value = value, let gestures = self.mapView.gestures {
279
+ var options = gestures.options
280
+ if let doubleTapToZoomInEnabled = value["doubleTapToZoomInEnabled"] as? NSNumber {
281
+ options.doubleTapToZoomInEnabled = doubleTapToZoomInEnabled.boolValue
282
+ }
283
+ if let doubleTouchToZoomOutEnabled = value["doubleTouchToZoomOutEnabled"] as? NSNumber {
284
+ options.doubleTouchToZoomOutEnabled = doubleTouchToZoomOutEnabled.boolValue
285
+ }
286
+ if let pinchScrollEnabled = value["pinchPanEnabled"] as? NSNumber {
287
+ options.pinchPanEnabled = pinchScrollEnabled.boolValue
288
+ }
289
+ if let pinchZoomEnabled = value["pinchZoomEnabled"] as? NSNumber {
290
+ options.pinchZoomEnabled = pinchZoomEnabled.boolValue
291
+ }
292
+ /* android only
293
+ if let pinchZoomDecelerationEnabled = value["pinchZoomDecelerationEnabled"] as? NSNumber {
294
+ options.pinchZoomDecelerationEnabled = pinchZoomDecelerationEnabled.boolValue
295
+ }
296
+ */
297
+ if let pitchEnabled = value["pitchEnabled"] as? NSNumber {
298
+ options.pitchEnabled = pitchEnabled.boolValue
299
+ }
300
+ if let quickZoomEnabled = value["quickZoomEnabled"] as? NSNumber {
301
+ options.quickZoomEnabled = quickZoomEnabled.boolValue
302
+ }
303
+ if let rotateEnabled = value["rotateEnabled"] as? NSNumber {
304
+ options.rotateEnabled = rotateEnabled.boolValue
305
+ }
306
+ /* android only
307
+ if let rotateDecelerationEnabled = value["rotateDecelerationEnabled"] as? NSNumber {
308
+ options.rotateDecelerationEnabled = rotateDecelerationEnabled.boolValue
309
+ }*/
310
+ if let panEnabled = value["panEnabled"] as? NSNumber {
311
+ options.panEnabled = panEnabled.boolValue
312
+ }
313
+ if let panDecelerationFactor = value["panDecelerationFactor"] as? NSNumber {
314
+ options.panDecelerationFactor = panDecelerationFactor.CGFloat
315
+ }
316
+ #if RNMBX_11
317
+ if let simultaneousRotateAndPinchZoomEnabled = value["simultaneousRotateAndPinchZoomEnabled"] as? NSNumber {
318
+ options.simultaneousRotateAndPinchZoomEnabled = simultaneousRotateAndPinchZoomEnabled.boolValue
319
+ }
320
+ #endif
321
+ /* android only
322
+ if let zoomAnimationAmount = value["zoomAnimationAmount"] as? NSNumber {
323
+ options.zoomAnimationAmount = zoomAnimationAmount.CGFloat
324
+ }*/
325
+ if options != gestures.options {
326
+ gestures.options = options
327
+ }
328
+ }
329
+ }
275
330
 
276
331
  @objc public func setReactAttributionEnabled(_ value: Bool) {
277
332
  mapView.ornaments.options.attributionButton.visibility = value ? .visible : .hidden
@@ -29,6 +29,8 @@ RCT_REMAP_VIEW_PROPERTY(pitchEnabled, reactPitchEnabled, BOOL)
29
29
  RCT_REMAP_VIEW_PROPERTY(projection, reactProjection, NSString)
30
30
  RCT_REMAP_VIEW_PROPERTY(localizeLabels, reactLocalizeLabels, NSDictionary)
31
31
 
32
+ RCT_REMAP_VIEW_PROPERTY(gestureSettings, reactGestureSettings, NSDictionary)
33
+
32
34
  RCT_REMAP_VIEW_PROPERTY(styleURL, reactStyleURL, NSString)
33
35
  RCT_REMAP_VIEW_PROPERTY(onPress, reactOnPress, RCTBubblingEventBlock)
34
36
  RCT_REMAP_VIEW_PROPERTY(onLongPress, reactOnLongPress, RCTBubblingEventBlock)
package/ios/install.md CHANGED
@@ -90,7 +90,7 @@ Add the following to your Podfile:
90
90
 
91
91
  ```ruby
92
92
  $RNMapboxMapsUseV11 = true # use 11 version
93
- $RNMapboxMapsVersion = '= 11.0.0-beta.3'
93
+ $RNMapboxMapsVersion = '= 11.0.0-beta.5'
94
94
  ```
95
95
 
96
96
 
@@ -361,8 +361,8 @@ var _Logger = _interopRequireDefault(require("./utils/Logger"));
361
361
  var _requestAndroidLocationPermissions = require("./requestAndroidLocationPermissions");
362
362
  var _getAnnotationsLayerID = require("./utils/getAnnotationsLayerID");
363
363
  var _deprecation = require("./utils/deprecation");
364
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
365
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
364
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
365
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
366
366
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
367
367
  /** @deprecated This will be removed in a future release. Use `AnimatedPoint` instead. */
368
368
  const AnimatedMapPoint = exports.AnimatedMapPoint = (0, _deprecation.deprecatedClass)(_classes.AnimatedPoint, 'AnimatedMapPoint is deprecated please use AnimatedPoint');