@rnmapbox/maps 10.0.0-beta.49 → 10.0.0-beta.53

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 (416) hide show
  1. package/android/.gitignore +9 -0
  2. package/android/.npmignore +9 -0
  3. package/android/rctmgl/.gitignore +1 -0
  4. package/android/rctmgl/.npmignore +1 -0
  5. package/android/rctmgl/src/main/java-mapboxgl/common/com/mapbox/rctmgl/modules/RCTMGLModule.java +2 -1
  6. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/modules/RCTMGLModule.kt +3 -1
  7. package/index.d.ts +1 -1
  8. package/ios/RCTMGL/MGLModule.m +2 -1
  9. package/ios/RCTMGL-v10/MGLModule.m +3 -1
  10. package/ios/RCTMGL-v10/MGLModule.swift +15 -2
  11. package/javascript/components/AbstractLayer.tsx +2 -1
  12. package/javascript/components/Camera.tsx +1 -2
  13. package/javascript/index.js +2 -2
  14. package/javascript/requestAndroidLocationPermissions.ts +1 -2
  15. package/javascript/utils/{MapboxStyles.ts → MapboxStyles.d.ts} +0 -0
  16. package/javascript/utils/StyleValue.ts +3 -8
  17. package/lib/commonjs/classes/AnimatedCoordinatesArray.js +165 -0
  18. package/lib/commonjs/classes/AnimatedCoordinatesArray.js.map +1 -0
  19. package/lib/commonjs/classes/AnimatedExtractCoordinateFromArray.js +44 -0
  20. package/lib/commonjs/classes/AnimatedExtractCoordinateFromArray.js.map +1 -0
  21. package/lib/commonjs/classes/AnimatedPoint.js +117 -0
  22. package/lib/commonjs/classes/AnimatedPoint.js.map +1 -0
  23. package/lib/commonjs/classes/AnimatedRouteCoordinatesArray.js +155 -0
  24. package/lib/commonjs/classes/AnimatedRouteCoordinatesArray.js.map +1 -0
  25. package/lib/commonjs/classes/AnimatedShape.js +78 -0
  26. package/lib/commonjs/classes/AnimatedShape.js.map +1 -0
  27. package/lib/commonjs/classes/index.d.js +17 -0
  28. package/lib/commonjs/classes/index.d.js.map +1 -0
  29. package/lib/commonjs/classes/index.js +61 -0
  30. package/lib/commonjs/classes/index.js.map +1 -0
  31. package/lib/commonjs/components/AbstractLayer.js +61 -0
  32. package/lib/commonjs/components/AbstractLayer.js.map +1 -0
  33. package/lib/commonjs/components/AbstractSource.js +26 -0
  34. package/lib/commonjs/components/AbstractSource.js.map +1 -0
  35. package/lib/commonjs/components/Atmosphere.js +26 -0
  36. package/lib/commonjs/components/Atmosphere.js.map +1 -0
  37. package/lib/commonjs/components/BackgroundLayer.js +82 -0
  38. package/lib/commonjs/components/BackgroundLayer.js.map +1 -0
  39. package/lib/commonjs/components/Callout.js +119 -0
  40. package/lib/commonjs/components/Callout.js.map +1 -0
  41. package/lib/commonjs/components/Camera.js +336 -0
  42. package/lib/commonjs/components/Camera.js.map +1 -0
  43. package/lib/commonjs/components/CircleLayer.js +87 -0
  44. package/lib/commonjs/components/CircleLayer.js.map +1 -0
  45. package/lib/commonjs/components/FillExtrusionLayer.js +89 -0
  46. package/lib/commonjs/components/FillExtrusionLayer.js.map +1 -0
  47. package/lib/commonjs/components/FillLayer.js +89 -0
  48. package/lib/commonjs/components/FillLayer.js.map +1 -0
  49. package/lib/commonjs/components/HeadingIndicator.js +33 -0
  50. package/lib/commonjs/components/HeadingIndicator.js.map +1 -0
  51. package/lib/commonjs/components/HeatmapLayer.js +90 -0
  52. package/lib/commonjs/components/HeatmapLayer.js.map +1 -0
  53. package/lib/commonjs/components/ImageSource.js +66 -0
  54. package/lib/commonjs/components/ImageSource.js.map +1 -0
  55. package/lib/commonjs/components/Images.js +98 -0
  56. package/lib/commonjs/components/Images.js.map +1 -0
  57. package/lib/commonjs/components/Light.js +51 -0
  58. package/lib/commonjs/components/Light.js.map +1 -0
  59. package/lib/commonjs/components/LineLayer.js +89 -0
  60. package/lib/commonjs/components/LineLayer.js.map +1 -0
  61. package/lib/commonjs/components/MapView.js +740 -0
  62. package/lib/commonjs/components/MapView.js.map +1 -0
  63. package/lib/commonjs/components/MarkerView.js +102 -0
  64. package/lib/commonjs/components/MarkerView.js.map +1 -0
  65. package/lib/commonjs/components/NativeBridgeComponent.js +85 -0
  66. package/lib/commonjs/components/NativeBridgeComponent.js.map +1 -0
  67. package/lib/commonjs/components/NativeUserLocation.js +41 -0
  68. package/lib/commonjs/components/NativeUserLocation.js.map +1 -0
  69. package/lib/commonjs/components/PointAnnotation.js +121 -0
  70. package/lib/commonjs/components/PointAnnotation.js.map +1 -0
  71. package/lib/commonjs/components/RasterDemSource.js +95 -0
  72. package/lib/commonjs/components/RasterDemSource.js.map +1 -0
  73. package/lib/commonjs/components/RasterLayer.js +85 -0
  74. package/lib/commonjs/components/RasterLayer.js.map +1 -0
  75. package/lib/commonjs/components/RasterSource.js +112 -0
  76. package/lib/commonjs/components/RasterSource.js.map +1 -0
  77. package/lib/commonjs/components/ShapeSource.js +193 -0
  78. package/lib/commonjs/components/ShapeSource.js.map +1 -0
  79. package/lib/commonjs/components/SkyLayer.js +73 -0
  80. package/lib/commonjs/components/SkyLayer.js.map +1 -0
  81. package/lib/commonjs/components/Style.js +269 -0
  82. package/lib/commonjs/components/Style.js.map +1 -0
  83. package/lib/commonjs/components/SymbolLayer.js +49 -0
  84. package/lib/commonjs/components/SymbolLayer.js.map +1 -0
  85. package/lib/commonjs/components/Terrain.js +37 -0
  86. package/lib/commonjs/components/Terrain.js.map +1 -0
  87. package/lib/commonjs/components/UserLocation.js +255 -0
  88. package/lib/commonjs/components/UserLocation.js.map +1 -0
  89. package/lib/commonjs/components/VectorSource.js +175 -0
  90. package/lib/commonjs/components/VectorSource.js.map +1 -0
  91. package/lib/commonjs/components/annotations/Annotation.js +105 -0
  92. package/lib/commonjs/components/annotations/Annotation.js.map +1 -0
  93. package/lib/commonjs/global.d.js +2 -0
  94. package/lib/commonjs/global.d.js.map +1 -0
  95. package/lib/commonjs/index.js +331 -0
  96. package/lib/commonjs/index.js.map +1 -0
  97. package/lib/commonjs/index.web.js +27 -0
  98. package/lib/commonjs/index.web.js.map +1 -0
  99. package/lib/commonjs/modules/location/locationManager.js +85 -0
  100. package/lib/commonjs/modules/location/locationManager.js.map +1 -0
  101. package/lib/commonjs/modules/offline/OfflineCreatePackOptions.js +45 -0
  102. package/lib/commonjs/modules/offline/OfflineCreatePackOptions.js.map +1 -0
  103. package/lib/commonjs/modules/offline/OfflinePack.js +41 -0
  104. package/lib/commonjs/modules/offline/OfflinePack.js.map +1 -0
  105. package/lib/commonjs/modules/offline/offlineManager.js +356 -0
  106. package/lib/commonjs/modules/offline/offlineManager.js.map +1 -0
  107. package/lib/commonjs/modules/snapshot/SnapshotOptions.js +60 -0
  108. package/lib/commonjs/modules/snapshot/SnapshotOptions.js.map +1 -0
  109. package/lib/commonjs/modules/snapshot/snapshotManager.js +68 -0
  110. package/lib/commonjs/modules/snapshot/snapshotManager.js.map +1 -0
  111. package/lib/commonjs/requestAndroidLocationPermissions.js +25 -0
  112. package/lib/commonjs/requestAndroidLocationPermissions.js.map +1 -0
  113. package/lib/commonjs/types/index.js +6 -0
  114. package/lib/commonjs/types/index.js.map +1 -0
  115. package/lib/commonjs/utils/BridgeValue.js +66 -0
  116. package/lib/commonjs/utils/BridgeValue.js.map +1 -0
  117. package/lib/commonjs/utils/Logger.js +119 -0
  118. package/lib/commonjs/utils/Logger.js.map +1 -0
  119. package/lib/commonjs/utils/MapboxStyles.d.js +183 -0
  120. package/lib/commonjs/utils/MapboxStyles.d.js.map +1 -0
  121. package/lib/commonjs/utils/StyleValue.js +41 -0
  122. package/lib/commonjs/utils/StyleValue.js.map +1 -0
  123. package/lib/commonjs/utils/animated/Animated.js +33 -0
  124. package/lib/commonjs/utils/animated/Animated.js.map +1 -0
  125. package/lib/commonjs/utils/deprecation.js +40 -0
  126. package/lib/commonjs/utils/deprecation.js.map +1 -0
  127. package/lib/commonjs/utils/filterUtils.js +13 -0
  128. package/lib/commonjs/utils/filterUtils.js.map +1 -0
  129. package/lib/commonjs/utils/geoUtils.d.js +2 -0
  130. package/lib/commonjs/utils/geoUtils.d.js.map +1 -0
  131. package/lib/commonjs/utils/geoUtils.js +65 -0
  132. package/lib/commonjs/utils/geoUtils.js.map +1 -0
  133. package/lib/commonjs/utils/index.d.js +2 -0
  134. package/lib/commonjs/utils/index.d.js.map +1 -0
  135. package/lib/commonjs/utils/index.js +122 -0
  136. package/lib/commonjs/utils/index.js.map +1 -0
  137. package/lib/commonjs/utils/styleMap.js +1530 -0
  138. package/lib/commonjs/utils/styleMap.js.map +1 -0
  139. package/lib/commonjs/web/MapContext.js +12 -0
  140. package/lib/commonjs/web/MapContext.js.map +1 -0
  141. package/lib/commonjs/web/MapboxModule.js +21 -0
  142. package/lib/commonjs/web/MapboxModule.js.map +1 -0
  143. package/lib/commonjs/web/UnimplementedComponent.js +16 -0
  144. package/lib/commonjs/web/UnimplementedComponent.js.map +1 -0
  145. package/lib/commonjs/web/components/Camera.js +48 -0
  146. package/lib/commonjs/web/components/Camera.js.map +1 -0
  147. package/lib/commonjs/web/components/MapView.js +67 -0
  148. package/lib/commonjs/web/components/MapView.js.map +1 -0
  149. package/lib/commonjs/web/index.js +41 -0
  150. package/lib/commonjs/web/index.js.map +1 -0
  151. package/lib/commonjs/web/utils/Logger.js +100 -0
  152. package/lib/commonjs/web/utils/Logger.js.map +1 -0
  153. package/lib/module/classes/AnimatedCoordinatesArray.js +158 -0
  154. package/lib/module/classes/AnimatedCoordinatesArray.js.map +1 -0
  155. package/lib/module/classes/AnimatedExtractCoordinateFromArray.js +37 -0
  156. package/lib/module/classes/AnimatedExtractCoordinateFromArray.js.map +1 -0
  157. package/lib/module/classes/AnimatedPoint.js +110 -0
  158. package/lib/module/classes/AnimatedPoint.js.map +1 -0
  159. package/lib/module/classes/AnimatedRouteCoordinatesArray.js +148 -0
  160. package/lib/module/classes/AnimatedRouteCoordinatesArray.js.map +1 -0
  161. package/lib/module/classes/AnimatedShape.js +71 -0
  162. package/lib/module/classes/AnimatedShape.js.map +1 -0
  163. package/lib/module/classes/index.d.js +6 -0
  164. package/lib/module/classes/index.d.js.map +1 -0
  165. package/lib/module/classes/index.js +6 -0
  166. package/lib/module/classes/index.js.map +1 -0
  167. package/lib/module/components/AbstractLayer.js +54 -0
  168. package/lib/module/components/AbstractLayer.js.map +1 -0
  169. package/lib/module/components/AbstractSource.js +18 -0
  170. package/lib/module/components/AbstractSource.js.map +1 -0
  171. package/lib/module/components/Atmosphere.js +16 -0
  172. package/lib/module/components/Atmosphere.js.map +1 -0
  173. package/lib/module/components/BackgroundLayer.js +73 -0
  174. package/lib/module/components/BackgroundLayer.js.map +1 -0
  175. package/lib/module/components/Callout.js +110 -0
  176. package/lib/module/components/Callout.js.map +1 -0
  177. package/lib/module/components/Camera.js +326 -0
  178. package/lib/module/components/Camera.js.map +1 -0
  179. package/lib/module/components/CircleLayer.js +78 -0
  180. package/lib/module/components/CircleLayer.js.map +1 -0
  181. package/lib/module/components/FillExtrusionLayer.js +80 -0
  182. package/lib/module/components/FillExtrusionLayer.js.map +1 -0
  183. package/lib/module/components/FillLayer.js +80 -0
  184. package/lib/module/components/FillLayer.js.map +1 -0
  185. package/lib/module/components/HeadingIndicator.js +25 -0
  186. package/lib/module/components/HeadingIndicator.js.map +1 -0
  187. package/lib/module/components/HeatmapLayer.js +81 -0
  188. package/lib/module/components/HeatmapLayer.js.map +1 -0
  189. package/lib/module/components/ImageSource.js +57 -0
  190. package/lib/module/components/ImageSource.js.map +1 -0
  191. package/lib/module/components/Images.js +89 -0
  192. package/lib/module/components/Images.js.map +1 -0
  193. package/lib/module/components/Light.js +42 -0
  194. package/lib/module/components/Light.js.map +1 -0
  195. package/lib/module/components/LineLayer.js +80 -0
  196. package/lib/module/components/LineLayer.js.map +1 -0
  197. package/lib/module/components/MapView.js +730 -0
  198. package/lib/module/components/MapView.js.map +1 -0
  199. package/lib/module/components/MarkerView.js +93 -0
  200. package/lib/module/components/MarkerView.js.map +1 -0
  201. package/lib/module/components/NativeBridgeComponent.js +78 -0
  202. package/lib/module/components/NativeBridgeComponent.js.map +1 -0
  203. package/lib/module/components/NativeUserLocation.js +33 -0
  204. package/lib/module/components/NativeUserLocation.js.map +1 -0
  205. package/lib/module/components/PointAnnotation.js +112 -0
  206. package/lib/module/components/PointAnnotation.js.map +1 -0
  207. package/lib/module/components/RasterDemSource.js +86 -0
  208. package/lib/module/components/RasterDemSource.js.map +1 -0
  209. package/lib/module/components/RasterLayer.js +76 -0
  210. package/lib/module/components/RasterLayer.js.map +1 -0
  211. package/lib/module/components/RasterSource.js +103 -0
  212. package/lib/module/components/RasterSource.js.map +1 -0
  213. package/lib/module/components/ShapeSource.js +184 -0
  214. package/lib/module/components/ShapeSource.js.map +1 -0
  215. package/lib/module/components/SkyLayer.js +64 -0
  216. package/lib/module/components/SkyLayer.js.map +1 -0
  217. package/lib/module/components/Style.js +259 -0
  218. package/lib/module/components/Style.js.map +1 -0
  219. package/lib/module/components/SymbolLayer.js +40 -0
  220. package/lib/module/components/SymbolLayer.js.map +1 -0
  221. package/lib/module/components/Terrain.js +27 -0
  222. package/lib/module/components/Terrain.js.map +1 -0
  223. package/lib/module/components/UserLocation.js +246 -0
  224. package/lib/module/components/UserLocation.js.map +1 -0
  225. package/lib/module/components/VectorSource.js +166 -0
  226. package/lib/module/components/VectorSource.js.map +1 -0
  227. package/lib/module/components/annotations/Annotation.js +97 -0
  228. package/lib/module/components/annotations/Annotation.js.map +1 -0
  229. package/lib/module/global.d.js +2 -0
  230. package/lib/module/global.d.js.map +1 -0
  231. package/lib/module/index.js +105 -0
  232. package/lib/module/index.js.map +1 -0
  233. package/lib/module/index.web.js +3 -0
  234. package/lib/module/index.web.js.map +1 -0
  235. package/lib/module/modules/location/locationManager.js +77 -0
  236. package/lib/module/modules/location/locationManager.js.map +1 -0
  237. package/lib/module/modules/offline/OfflineCreatePackOptions.js +38 -0
  238. package/lib/module/modules/offline/OfflineCreatePackOptions.js.map +1 -0
  239. package/lib/module/modules/offline/OfflinePack.js +34 -0
  240. package/lib/module/modules/offline/OfflinePack.js.map +1 -0
  241. package/lib/module/modules/offline/offlineManager.js +347 -0
  242. package/lib/module/modules/offline/offlineManager.js.map +1 -0
  243. package/lib/module/modules/snapshot/SnapshotOptions.js +53 -0
  244. package/lib/module/modules/snapshot/SnapshotOptions.js.map +1 -0
  245. package/lib/module/modules/snapshot/snapshotManager.js +60 -0
  246. package/lib/module/modules/snapshot/snapshotManager.js.map +1 -0
  247. package/lib/module/requestAndroidLocationPermissions.js +19 -0
  248. package/lib/module/requestAndroidLocationPermissions.js.map +1 -0
  249. package/lib/module/types/index.js +2 -0
  250. package/lib/module/types/index.js.map +1 -0
  251. package/lib/module/utils/BridgeValue.js +59 -0
  252. package/lib/module/utils/BridgeValue.js.map +1 -0
  253. package/lib/module/utils/Logger.js +112 -0
  254. package/lib/module/utils/Logger.js.map +1 -0
  255. package/lib/module/utils/MapboxStyles.d.js +179 -0
  256. package/lib/module/utils/MapboxStyles.d.js.map +1 -0
  257. package/lib/module/utils/StyleValue.js +34 -0
  258. package/lib/module/utils/StyleValue.js.map +1 -0
  259. package/lib/module/utils/animated/Animated.js +25 -0
  260. package/lib/module/utils/animated/Animated.js.map +1 -0
  261. package/lib/module/utils/deprecation.js +33 -0
  262. package/lib/module/utils/deprecation.js.map +1 -0
  263. package/lib/module/utils/filterUtils.js +7 -0
  264. package/lib/module/utils/filterUtils.js.map +1 -0
  265. package/lib/module/utils/geoUtils.d.js +2 -0
  266. package/lib/module/utils/geoUtils.d.js.map +1 -0
  267. package/lib/module/utils/geoUtils.js +50 -0
  268. package/lib/module/utils/geoUtils.js.map +1 -0
  269. package/lib/module/utils/index.d.js +2 -0
  270. package/lib/module/utils/index.d.js.map +1 -0
  271. package/lib/module/utils/index.js +99 -0
  272. package/lib/module/utils/index.js.map +1 -0
  273. package/lib/module/utils/styleMap.js +1505 -0
  274. package/lib/module/utils/styleMap.js.map +1 -0
  275. package/lib/module/web/MapContext.js +4 -0
  276. package/lib/module/web/MapContext.js.map +1 -0
  277. package/lib/module/web/MapboxModule.js +13 -0
  278. package/lib/module/web/MapboxModule.js.map +1 -0
  279. package/lib/module/web/UnimplementedComponent.js +8 -0
  280. package/lib/module/web/UnimplementedComponent.js.map +1 -0
  281. package/lib/module/web/components/Camera.js +40 -0
  282. package/lib/module/web/components/Camera.js.map +1 -0
  283. package/lib/module/web/components/MapView.js +60 -0
  284. package/lib/module/web/components/MapView.js.map +1 -0
  285. package/lib/module/web/index.js +16 -0
  286. package/lib/module/web/index.js.map +1 -0
  287. package/lib/module/web/utils/Logger.js +93 -0
  288. package/lib/module/web/utils/Logger.js.map +1 -0
  289. package/lib/typescript/components/AbstractLayer.d.ts +28 -0
  290. package/lib/typescript/components/AbstractLayer.d.ts.map +1 -0
  291. package/lib/typescript/components/AbstractSource.d.ts +9 -0
  292. package/lib/typescript/components/AbstractSource.d.ts.map +1 -0
  293. package/lib/typescript/components/Atmosphere.d.ts +9 -0
  294. package/lib/typescript/components/Atmosphere.d.ts.map +1 -0
  295. package/lib/typescript/components/Camera.d.ts +119 -0
  296. package/lib/typescript/components/Camera.d.ts.map +1 -0
  297. package/lib/typescript/components/HeadingIndicator.d.ts +7 -0
  298. package/lib/typescript/components/HeadingIndicator.d.ts.map +1 -0
  299. package/lib/typescript/components/MarkerView.d.ts +52 -0
  300. package/lib/typescript/components/MarkerView.d.ts.map +1 -0
  301. package/lib/typescript/components/NativeBridgeComponent.d.ts +50 -0
  302. package/lib/typescript/components/NativeBridgeComponent.d.ts.map +1 -0
  303. package/lib/typescript/components/PointAnnotation.d.ts +162 -0
  304. package/lib/typescript/components/PointAnnotation.d.ts.map +1 -0
  305. package/lib/typescript/components/ShapeSource.d.ts +222 -0
  306. package/lib/typescript/components/ShapeSource.d.ts.map +1 -0
  307. package/lib/typescript/components/SymbolLayer.d.ts +65 -0
  308. package/lib/typescript/components/SymbolLayer.d.ts.map +1 -0
  309. package/lib/typescript/components/Terrain.d.ts +20 -0
  310. package/lib/typescript/components/Terrain.d.ts.map +1 -0
  311. package/lib/typescript/requestAndroidLocationPermissions.d.ts +2 -0
  312. package/lib/typescript/requestAndroidLocationPermissions.d.ts.map +1 -0
  313. package/lib/typescript/types/index.d.ts +16 -0
  314. package/lib/typescript/types/index.d.ts.map +1 -0
  315. package/lib/typescript/utils/BridgeValue.d.ts +46 -0
  316. package/lib/typescript/utils/BridgeValue.d.ts.map +1 -0
  317. package/lib/typescript/utils/StyleValue.d.ts +10 -0
  318. package/lib/typescript/utils/StyleValue.d.ts.map +1 -0
  319. package/lib/typescript/utils/deprecation.d.ts +12 -0
  320. package/lib/typescript/utils/deprecation.d.ts.map +1 -0
  321. package/lib/typescript/utils/filterUtils.d.ts +2 -0
  322. package/lib/typescript/utils/filterUtils.d.ts.map +1 -0
  323. package/lib/typescript/utils/styleMap.d.ts +1489 -0
  324. package/lib/typescript/utils/styleMap.d.ts.map +1 -0
  325. package/lib/typescript/web/MapContext.d.ts +7 -0
  326. package/lib/typescript/web/MapContext.d.ts.map +1 -0
  327. package/lib/typescript/web/components/Camera.d.ts +18 -0
  328. package/lib/typescript/web/components/Camera.d.ts.map +1 -0
  329. package/lib/typescript/web/components/MapView.d.ts +20 -0
  330. package/lib/typescript/web/components/MapView.d.ts.map +1 -0
  331. package/lib/typescript/web/utils/Logger.d.ts +48 -0
  332. package/lib/typescript/web/utils/Logger.d.ts.map +1 -0
  333. package/package.json +38 -6
  334. package/plugin/jest.config.js +1 -0
  335. package/plugin/src/withMapbox.ts +365 -0
  336. package/plugin/tsconfig.json +9 -0
  337. package/.eslintrc.js +0 -111
  338. package/.gitattributes +0 -1
  339. package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -112
  340. package/.github/ISSUE_TEMPLATE/bug_setup.md +0 -23
  341. package/.github/ISSUE_TEMPLATE/feature.md +0 -15
  342. package/.github/dependabot.yml +0 -42
  343. package/.github/label-actions.yml +0 -26
  344. package/.github/pull_request_template.md +0 -27
  345. package/.github/stale.yml +0 -11
  346. package/.github/workflows/android-actions.yml +0 -56
  347. package/.github/workflows/bump-version.yml +0 -54
  348. package/.github/workflows/ios-actions.yml +0 -81
  349. package/.github/workflows/label-actions.yml +0 -17
  350. package/.github/workflows/on-push.yml +0 -131
  351. package/.github/workflows/publish.yml +0 -29
  352. package/.husky/pre-commit +0 -5
  353. package/.nvmrc +0 -2
  354. package/.prettierrc.js +0 -4
  355. package/.sonarcloud.properties +0 -15
  356. package/CONTRIBUTING.md +0 -30
  357. package/README-v10.md +0 -86
  358. package/RELEASE.md +0 -28
  359. package/app.plugin.js +0 -1
  360. package/babel.config.js +0 -9
  361. package/docs/Annotation.md +0 -39
  362. package/docs/Annotations.md +0 -20
  363. package/docs/Atmosphere.md +0 -265
  364. package/docs/BackgroundLayer.md +0 -166
  365. package/docs/Callout.md +0 -15
  366. package/docs/Camera.md +0 -152
  367. package/docs/CircleLayer.md +0 -470
  368. package/docs/CustomHttpHeaders.md +0 -89
  369. package/docs/FillExtrusionLayer.md +0 -346
  370. package/docs/FillLayer.md +0 -310
  371. package/docs/GettingStarted.md +0 -87
  372. package/docs/HeadingIndicator.md +0 -10
  373. package/docs/HeatmapLayer.md +0 -215
  374. package/docs/ImageSource.md +0 -13
  375. package/docs/Images.md +0 -12
  376. package/docs/Light.md +0 -159
  377. package/docs/LineLayer.md +0 -606
  378. package/docs/Logger.md +0 -22
  379. package/docs/MapView.md +0 -228
  380. package/docs/MapboxGL.md +0 -83
  381. package/docs/MarkerView.md +0 -26
  382. package/docs/NativeUserLocation.md +0 -11
  383. package/docs/OfflineManager.md +0 -264
  384. package/docs/PointAnnotation.md +0 -42
  385. package/docs/RasterDemSource.md +0 -15
  386. package/docs/RasterLayer.md +0 -357
  387. package/docs/RasterSource.md +0 -19
  388. package/docs/ShapeSource.md +0 -106
  389. package/docs/SkyLayer.md +0 -259
  390. package/docs/Style.md +0 -12
  391. package/docs/StyleSheet.md +0 -226
  392. package/docs/SymbolLayer.md +0 -1659
  393. package/docs/Terrain.md +0 -77
  394. package/docs/UserLocation.md +0 -39
  395. package/docs/VectorSource.md +0 -49
  396. package/docs/docs.json +0 -6571
  397. package/docs/snapshotManager.md +0 -55
  398. package/scripts/.eslintrc.js +0 -12
  399. package/scripts/autogenHelpers/DocJSONBuilder.js +0 -458
  400. package/scripts/autogenHelpers/JSDocNodeTree.js +0 -134
  401. package/scripts/autogenHelpers/MarkdownBuilder.js +0 -38
  402. package/scripts/autogenHelpers/globals.js +0 -518
  403. package/scripts/autogenerate.js +0 -545
  404. package/scripts/download-style-spec.sh +0 -15
  405. package/scripts/templates/MapboxStyles.ts.ejs +0 -97
  406. package/scripts/templates/RCTMGLStyle.h.ejs +0 -34
  407. package/scripts/templates/RCTMGLStyle.m.ejs +0 -106
  408. package/scripts/templates/RCTMGLStyle.swift.ejs +0 -116
  409. package/scripts/templates/RCTMGLStyleFactory.java.ejs +0 -108
  410. package/scripts/templates/RCTMGLStyleFactoryv10.java.ejs +0 -116
  411. package/scripts/templates/component.md.ejs +0 -122
  412. package/scripts/templates/index.d.ts.ejs +0 -56
  413. package/scripts/templates/styleMap.ts.ejs +0 -118
  414. package/setup-jest.js +0 -125
  415. package/style-spec/v8.json +0 -6727
  416. package/tsconfig.json +0 -24
@@ -0,0 +1,730 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
+ import React from 'react';
4
+ import PropTypes from 'prop-types';
5
+ import { View, StyleSheet, NativeModules, requireNativeComponent } from 'react-native';
6
+ import { debounce } from 'debounce';
7
+ import { makePoint, makeLatLngBounds } from '../utils/geoUtils';
8
+ import { isFunction, isNumber, toJSONString, isAndroid, viewPropTypes, ornamentPositionPropType } from '../utils';
9
+ import { getFilter } from '../utils/filterUtils';
10
+ import Logger from '../utils/Logger';
11
+ import NativeBridgeComponent from './NativeBridgeComponent';
12
+ const MapboxGL = NativeModules.MGLModule;
13
+ if (MapboxGL == null) {
14
+ console.error('Native part of Mapbox React Native libraries were not registered properly, double check our native installation guides.');
15
+ }
16
+ export const NATIVE_MODULE_NAME = 'RCTMGLMapView';
17
+ export const ANDROID_TEXTURE_NATIVE_MODULE_NAME = 'RCTMGLAndroidTextureMapView';
18
+ const styles = StyleSheet.create({
19
+ matchParent: {
20
+ flex: 1
21
+ }
22
+ });
23
+ const defaultStyleURL = MapboxGL.StyleURL.Street;
24
+
25
+ /**
26
+ * MapView backed by Mapbox Native GL
27
+ */
28
+ class MapView extends NativeBridgeComponent(React.Component, NATIVE_MODULE_NAME) {
29
+ constructor(props) {
30
+ super(props);
31
+ this.logger = Logger.sharedInstance();
32
+ this.logger.start();
33
+ this.state = {
34
+ isReady: null,
35
+ region: null,
36
+ width: 0,
37
+ height: 0,
38
+ isUserInteraction: false
39
+ };
40
+ this._onPress = this._onPress.bind(this);
41
+ this._onLongPress = this._onLongPress.bind(this);
42
+ this._onChange = this._onChange.bind(this);
43
+ this._onLayout = this._onLayout.bind(this);
44
+
45
+ // debounced map change methods
46
+ this._onDebouncedRegionWillChange = debounce(this._onRegionWillChange.bind(this), props.regionWillChangeDebounceTime, true);
47
+ this._onDebouncedRegionDidChange = debounce(this._onRegionDidChange.bind(this), props.regionDidChangeDebounceTime);
48
+ }
49
+ componentDidMount() {
50
+ this._setHandledMapChangedEvents(this.props);
51
+ }
52
+ componentWillUnmount() {
53
+ this._onDebouncedRegionWillChange.clear();
54
+ this._onDebouncedRegionDidChange.clear();
55
+ this.logger.stop();
56
+ }
57
+ UNSAFE_componentWillReceiveProps(nextProps) {
58
+ this._setHandledMapChangedEvents(nextProps);
59
+ }
60
+ _setHandledMapChangedEvents(props) {
61
+ if (isAndroid() || MapboxGL.MapboxV10) {
62
+ const events = [];
63
+ function addIfHasHandler(name) {
64
+ if (props[`on${name}`] != null) {
65
+ if (MapboxGL.EventTypes[name] == null) {
66
+ console.warn(`rnmapbox maps: ${name} is not supported`);
67
+ } else {
68
+ events.push(MapboxGL.EventTypes[name]);
69
+ return true;
70
+ }
71
+ }
72
+ return false;
73
+ }
74
+ addIfHasHandler('RegionWillChange');
75
+ addIfHasHandler('RegionIsChanging');
76
+ addIfHasHandler('RegionDidChange');
77
+ addIfHasHandler('UserLocationUpdate');
78
+ addIfHasHandler('WillStartLoadingMap');
79
+ addIfHasHandler('DidFinishLoadingMap');
80
+ addIfHasHandler('DidFailLoadingMap');
81
+ addIfHasHandler('WillStartRenderingFrame');
82
+ addIfHasHandler('DidFinishRenderingFrame');
83
+ addIfHasHandler('DidFinishRenderingFrameFully');
84
+ addIfHasHandler('WillStartRenderingMap');
85
+ addIfHasHandler('DidFinishRenderingMap');
86
+ addIfHasHandler('DidFinishRenderingMapFully');
87
+ addIfHasHandler('DidFinishLoadingStyle');
88
+ if (addIfHasHandler('MapIdle')) {
89
+ console.warn('onMapIdle is deprecated and will be removed in next beta - please use onRegionDidChange');
90
+ if (props.onRegionDidChange) {
91
+ console.warn('rnmapbox/maps: only one of MapView.onRegionDidChange or onMapIdle is supported');
92
+ }
93
+ }
94
+ if (addIfHasHandler('CameraChanged')) {
95
+ console.warn('onCameraChanged is deprecated and will be removed in next beta - please use onRegionIsChanging');
96
+ if (props.onRegionIsChanging) {
97
+ console.warn('rnmapbox/maps: only one of MapView.onRegionIsChanging or onCameraChanged is supported');
98
+ }
99
+ }
100
+ if (props.onRegionWillChange) {
101
+ console.warn('onRegionWillChange is deprecated and will be removed in v10 - please use onRegionIsChanging');
102
+ }
103
+ this._runNativeCommand('setHandledMapChangedEvents', this._nativeRef, [events]);
104
+ }
105
+ }
106
+
107
+ /**
108
+ * Converts a geographic coordinate to a point in the given view’s coordinate system.
109
+ *
110
+ * @example
111
+ * const pointInView = await this._map.getPointInView([-37.817070, 144.949901]);
112
+ *
113
+ * @param {Array<Number>} coordinate - A point expressed in the map view's coordinate system.
114
+ * @return {Array}
115
+ */
116
+ async getPointInView(coordinate) {
117
+ const res = await this._runNativeCommand('getPointInView', this._nativeRef, [coordinate]);
118
+ return res.pointInView;
119
+ }
120
+
121
+ /**
122
+ * Converts a point in the given view’s coordinate system to a geographic coordinate.
123
+ *
124
+ * @example
125
+ * const coordinate = await this._map.getCoordinateFromView([100, 100]);
126
+ *
127
+ * @param {Array<Number>} point - A point expressed in the given view’s coordinate system.
128
+ * @return {Array}
129
+ */
130
+ async getCoordinateFromView(point) {
131
+ const res = await this._runNativeCommand('getCoordinateFromView', this._nativeRef, [point]);
132
+ return res.coordinateFromView;
133
+ }
134
+
135
+ /**
136
+ * The coordinate bounds (ne, sw) visible in the user’s viewport.
137
+ *
138
+ * @example
139
+ * const visibleBounds = await this._map.getVisibleBounds();
140
+ *
141
+ * @return {Array}
142
+ */
143
+ async getVisibleBounds() {
144
+ const res = await this._runNativeCommand('getVisibleBounds', this._nativeRef);
145
+ return res.visibleBounds;
146
+ }
147
+
148
+ /**
149
+ * Returns an array of rendered map features that intersect with a given point.
150
+ *
151
+ * @example
152
+ * this._map.queryRenderedFeaturesAtPoint([30, 40], ['==', 'type', 'Point'], ['id1', 'id2'])
153
+ *
154
+ * @param {Array<Number>} coordinate - A point expressed in the map view’s coordinate system.
155
+ * @param {Array=} filter - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array.
156
+ * @param {Array=} layerIDs - A array of layer id's to filter the features by
157
+ * @return {FeatureCollection}
158
+ */
159
+ async queryRenderedFeaturesAtPoint(coordinate) {
160
+ let filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
161
+ let layerIDs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
162
+ if (!coordinate || coordinate.length < 2) {
163
+ throw new Error('Must pass in valid coordinate[lng, lat]');
164
+ }
165
+ const res = await this._runNativeCommand('queryRenderedFeaturesAtPoint', this._nativeRef, [coordinate, getFilter(filter), layerIDs]);
166
+ if (isAndroid()) {
167
+ return JSON.parse(res.data);
168
+ }
169
+ return res.data;
170
+ }
171
+
172
+ /**
173
+ * Returns an array of rendered map features that intersect with the given rectangle,
174
+ * restricted to the given style layers and filtered by the given predicate. In v10,
175
+ * passing an empty array will query the entire visible bounds of the map.
176
+ *
177
+ * @example
178
+ * this._map.queryRenderedFeaturesInRect([30, 40, 20, 10], ['==', 'type', 'Point'], ['id1', 'id2'])
179
+ *
180
+ * @param {Array<Number>} bbox - A rectangle expressed in the map view’s coordinate system. For v10, this can be an empty array to query the visible map area.
181
+ * @param {Array=} filter - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array.
182
+ * @param {Array=} layerIDs - A array of layer id's to filter the features by
183
+ * @return {FeatureCollection}
184
+ */
185
+ async queryRenderedFeaturesInRect(bbox) {
186
+ let filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
187
+ let layerIDs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
188
+ if (bbox != null && (bbox.length === 4 || MapboxGL.MapboxV10 && bbox.length === 0)) {
189
+ const res = await this._runNativeCommand('queryRenderedFeaturesInRect', this._nativeRef, [bbox, getFilter(filter), layerIDs]);
190
+ if (isAndroid()) {
191
+ return JSON.parse(res.data);
192
+ }
193
+ return res.data;
194
+ } else {
195
+ throw new Error('Must pass in a valid bounding box: [top, right, bottom, left]. An empty array [] is also acceptable in v10.');
196
+ }
197
+ }
198
+
199
+ /**
200
+ * Map camera will perform updates based on provided config. Deprecated use Camera#setCamera.
201
+ */
202
+ setCamera() {
203
+ console.warn('MapView.setCamera is deprecated - please use Camera#setCamera');
204
+ }
205
+
206
+ /**
207
+ * Takes snapshot of map with current tiles and returns a URI to the image
208
+ * @param {Boolean} writeToDisk If true will create a temp file, otherwise it is in base64
209
+ * @return {String}
210
+ */
211
+ async takeSnap() {
212
+ let writeToDisk = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
213
+ const res = await this._runNativeCommand('takeSnap', this._nativeRef, [writeToDisk]);
214
+ return res.uri;
215
+ }
216
+
217
+ /**
218
+ * Returns the current zoom of the map view.
219
+ *
220
+ * @example
221
+ * const zoom = await this._map.getZoom();
222
+ *
223
+ * @return {Number}
224
+ */
225
+
226
+ async getZoom() {
227
+ const res = await this._runNativeCommand('getZoom', this._nativeRef);
228
+ return res.zoom;
229
+ }
230
+
231
+ /**
232
+ * Returns the map's geographical centerpoint
233
+ *
234
+ * @example
235
+ * const center = await this._map.getCenter();
236
+ *
237
+ * @return {Array<Number>} Coordinates
238
+ */
239
+ async getCenter() {
240
+ const res = await this._runNativeCommand('getCenter', this._nativeRef);
241
+ return res.center;
242
+ }
243
+
244
+ /**
245
+ * Queries the currently loaded data for elevation at a geographical location.
246
+ * The elevation is returned in meters relative to mean sea-level.
247
+ * Returns null if terrain is disabled or if terrain data for the location hasn't been loaded yet.
248
+ *
249
+ * @param {Array<Number>} coordinate - the coordinates to query elevation at
250
+ * @return {Number}
251
+ */
252
+ async queryTerrainElevation(coordinate) {
253
+ const res = await this._runNativeCommand('queryTerrainElevation', this._nativeRef, [coordinate]);
254
+ return res.data;
255
+ }
256
+
257
+ /**
258
+ * Sets the visibility of all the layers referencing the specified `sourceLayerId` and/or `sourceId`
259
+ *
260
+ * @example
261
+ * await this._map.setSourceVisibility(false, 'composite', 'building')
262
+ *
263
+ * @param {boolean} visible - Visibility of the layers
264
+ * @param {String} sourceId - Identifier of the target source (e.g. 'composite')
265
+ * @param {String=} sourceLayerId - Identifier of the target source-layer (e.g. 'building')
266
+ */
267
+ setSourceVisibility(visible, sourceId) {
268
+ let sourceLayerId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
269
+ this._runNativeCommand('setSourceVisibility', this._nativeRef, [visible, sourceId, sourceLayerId]);
270
+ }
271
+
272
+ /**
273
+ * Show the attribution and telemetry action sheet.
274
+ * If you implement a custom attribution button, you should add this action to the button.
275
+ */
276
+ showAttribution() {
277
+ return this._runNativeCommand('showAttribution', this._nativeRef);
278
+ }
279
+ _createStopConfig() {
280
+ let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
281
+ const stopConfig = {
282
+ mode: isNumber(config.mode) ? config.mode : MapboxGL.CameraModes.Ease,
283
+ pitch: config.pitch,
284
+ heading: config.heading,
285
+ duration: config.duration || 2000,
286
+ zoom: config.zoom
287
+ };
288
+ if (config.centerCoordinate) {
289
+ stopConfig.centerCoordinate = toJSONString(makePoint(config.centerCoordinate));
290
+ }
291
+ if (config.bounds && config.bounds.ne && config.bounds.sw) {
292
+ const {
293
+ ne,
294
+ sw,
295
+ paddingLeft,
296
+ paddingRight,
297
+ paddingTop,
298
+ paddingBottom
299
+ } = config.bounds;
300
+ stopConfig.bounds = toJSONString(makeLatLngBounds(ne, sw));
301
+ stopConfig.boundsPaddingTop = paddingTop || 0;
302
+ stopConfig.boundsPaddingRight = paddingRight || 0;
303
+ stopConfig.boundsPaddingBottom = paddingBottom || 0;
304
+ stopConfig.boundsPaddingLeft = paddingLeft || 0;
305
+ }
306
+ return stopConfig;
307
+ }
308
+ _onPress(e) {
309
+ if (isFunction(this.props.onPress)) {
310
+ this.props.onPress(e.nativeEvent.payload);
311
+ }
312
+ }
313
+ _onLongPress(e) {
314
+ if (isFunction(this.props.onLongPress)) {
315
+ this.props.onLongPress(e.nativeEvent.payload);
316
+ }
317
+ }
318
+ _onRegionWillChange(payload) {
319
+ if (isFunction(this.props.onRegionWillChange)) {
320
+ this.props.onRegionWillChange(payload);
321
+ }
322
+ this.setState({
323
+ isUserInteraction: payload.properties.isUserInteraction,
324
+ isAnimatingFromUserInteraction: payload.properties.isAnimatingFromUserInteraction
325
+ });
326
+ }
327
+ _onRegionDidChange(payload) {
328
+ if (isFunction(this.props.onRegionDidChange)) {
329
+ this.props.onRegionDidChange(payload);
330
+ }
331
+ this.setState({
332
+ region: payload
333
+ });
334
+ }
335
+ _onChange(e) {
336
+ const {
337
+ regionWillChangeDebounceTime,
338
+ regionDidChangeDebounceTime
339
+ } = this.props;
340
+ const {
341
+ type,
342
+ payload
343
+ } = e.nativeEvent;
344
+ let propName = '';
345
+ switch (type) {
346
+ case MapboxGL.EventTypes.RegionWillChange:
347
+ if (regionWillChangeDebounceTime > 0) {
348
+ this._onDebouncedRegionWillChange(payload);
349
+ } else {
350
+ propName = 'onRegionWillChange';
351
+ }
352
+ break;
353
+ case MapboxGL.EventTypes.RegionIsChanging:
354
+ propName = 'onRegionIsChanging';
355
+ break;
356
+ case MapboxGL.EventTypes.RegionDidChange:
357
+ if (regionDidChangeDebounceTime > 0) {
358
+ this._onDebouncedRegionDidChange(payload);
359
+ } else {
360
+ propName = 'onRegionDidChange';
361
+ }
362
+ break;
363
+ case MapboxGL.EventTypes.CameraChanged:
364
+ propName = 'onCameraChanged';
365
+ break;
366
+ case MapboxGL.EventTypes.MapIdle:
367
+ propName = 'onMapIdle';
368
+ break;
369
+ case MapboxGL.EventTypes.UserLocationUpdated:
370
+ propName = 'onUserLocationUpdate';
371
+ break;
372
+ case MapboxGL.EventTypes.WillStartLoadingMap:
373
+ propName = 'onWillStartLoadingMap';
374
+ break;
375
+ case MapboxGL.EventTypes.DidFinishLoadingMap:
376
+ propName = 'onDidFinishLoadingMap';
377
+ break;
378
+ case MapboxGL.EventTypes.DidFailLoadingMap:
379
+ propName = 'onDidFailLoadingMap';
380
+ break;
381
+ case MapboxGL.EventTypes.WillStartRenderingFrame:
382
+ propName = 'onWillStartRenderingFrame';
383
+ break;
384
+ case MapboxGL.EventTypes.DidFinishRenderingFrame:
385
+ propName = 'onDidFinishRenderingFrame';
386
+ break;
387
+ case MapboxGL.EventTypes.DidFinishRenderingFrameFully:
388
+ propName = 'onDidFinishRenderingFrameFully';
389
+ break;
390
+ case MapboxGL.EventTypes.WillStartRenderingMap:
391
+ propName = 'onWillStartRenderingMap';
392
+ break;
393
+ case MapboxGL.EventTypes.DidFinishRenderingMap:
394
+ propName = 'onDidFinishRenderingMap';
395
+ break;
396
+ case MapboxGL.EventTypes.DidFinishRenderingMapFully:
397
+ propName = 'onDidFinishRenderingMapFully';
398
+ break;
399
+ case MapboxGL.EventTypes.DidFinishLoadingStyle:
400
+ propName = 'onDidFinishLoadingStyle';
401
+ break;
402
+ default:
403
+ console.warn('Unhandled event callback type', type);
404
+ }
405
+ if (propName.length) {
406
+ this._handleOnChange(propName, payload);
407
+ }
408
+ }
409
+ _onLayout(e) {
410
+ this.setState({
411
+ isReady: true,
412
+ width: e.nativeEvent.layout.width,
413
+ height: e.nativeEvent.layout.height
414
+ });
415
+ }
416
+ _handleOnChange(propName, payload) {
417
+ if (isFunction(this.props[propName])) {
418
+ this.props[propName](payload);
419
+ }
420
+ }
421
+ _getCenterCoordinate() {
422
+ if (!this.props.centerCoordinate) {
423
+ return;
424
+ }
425
+ return toJSONString(makePoint(this.props.centerCoordinate));
426
+ }
427
+ _getVisibleCoordinateBounds() {
428
+ if (!this.props.visibleCoordinateBounds) {
429
+ return;
430
+ }
431
+ return toJSONString(makeLatLngBounds(this.props.visibleCoordinateBounds[0], this.props.visibleCoordinateBounds[1]));
432
+ }
433
+ _getContentInset() {
434
+ if (!this.props.contentInset) {
435
+ return;
436
+ }
437
+ if (!Array.isArray(this.props.contentInset)) {
438
+ return [this.props.contentInset];
439
+ }
440
+ return this.props.contentInset;
441
+ }
442
+ _setNativeRef(nativeRef) {
443
+ this._nativeRef = nativeRef;
444
+ super._runPendingNativeCommands(nativeRef);
445
+ }
446
+ setNativeProps(props) {
447
+ if (this._nativeRef) {
448
+ this._nativeRef.setNativeProps(props);
449
+ }
450
+ }
451
+ _setStyleURL(props) {
452
+ // user set a styleURL, no need to alter props
453
+ if (props.styleURL) {
454
+ return;
455
+ }
456
+
457
+ // user set styleJSON pass it to styleURL
458
+ if (props.styleJSON && !props.styleURL) {
459
+ props.styleURL = props.styleJSON;
460
+ }
461
+
462
+ // user neither set styleJSON nor styleURL
463
+ // set defaultStyleUrl
464
+ if (!props.styleJSON || !props.styleURL) {
465
+ props.styleURL = defaultStyleURL;
466
+ }
467
+ }
468
+ render() {
469
+ const props = {
470
+ ...this.props,
471
+ contentInset: this._getContentInset(),
472
+ style: styles.matchParent
473
+ };
474
+ this._setStyleURL(props);
475
+ const callbacks = {
476
+ ref: nativeRef => this._setNativeRef(nativeRef),
477
+ onPress: this._onPress,
478
+ onLongPress: this._onLongPress,
479
+ onMapChange: this._onChange,
480
+ onAndroidCallback: isAndroid() ? this._onAndroidCallback : undefined
481
+ };
482
+ let mapView = null;
483
+ if (isAndroid() && !this.props.surfaceView && this.state.isReady) {
484
+ mapView = /*#__PURE__*/React.createElement(RCTMGLAndroidTextureMapView, _extends({}, props, callbacks), this.props.children);
485
+ } else if (this.state.isReady) {
486
+ mapView = /*#__PURE__*/React.createElement(RCTMGLMapView, _extends({}, props, callbacks), this.props.children);
487
+ }
488
+ return /*#__PURE__*/React.createElement(View, {
489
+ onLayout: this._onLayout,
490
+ style: this.props.style,
491
+ testID: mapView ? null : this.props.testID
492
+ }, mapView);
493
+ }
494
+ }
495
+ _defineProperty(MapView, "propTypes", {
496
+ ...viewPropTypes,
497
+ /**
498
+ * The distance from the edges of the map view’s frame to the edges of the map view’s logical viewport.
499
+ */
500
+ contentInset: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number]),
501
+ /**
502
+ * The projection used when rendering the map
503
+ */
504
+ projection: PropTypes.oneOf(['mercator', 'globe']),
505
+ /**
506
+ * Style for wrapping React Native View
507
+ */
508
+ style: PropTypes.any,
509
+ /**
510
+ * Style URL for map - notice, if non is set it _will_ default to `MapboxGL.StyleURL.Street`
511
+ */
512
+ styleURL: PropTypes.string,
513
+ /**
514
+ * StyleJSON for map - according to TileJSON specs: https://github.com/mapbox/tilejson-spec
515
+ */
516
+ styleJSON: PropTypes.string,
517
+ /**
518
+ * iOS: The preferred frame rate at which the map view is rendered.
519
+ * The default value for this property is MGLMapViewPreferredFramesPerSecondDefault,
520
+ * which will adaptively set the preferred frame rate based on the capability of
521
+ * the user’s device to maintain a smooth experience. This property can be set to arbitrary integer values.
522
+ *
523
+ * Android: The maximum frame rate at which the map view is rendered, but it can't exceed the ability of device hardware.
524
+ * This property can be set to arbitrary integer values.
525
+ */
526
+ preferredFramesPerSecond: PropTypes.number,
527
+ /**
528
+ * Automatically change the language of the map labels to the system’s preferred language,
529
+ * this is not something that can be toggled on/off
530
+ */
531
+ localizeLabels: PropTypes.bool,
532
+ /**
533
+ * Enable/Disable zoom on the map
534
+ */
535
+ zoomEnabled: PropTypes.bool,
536
+ /**
537
+ * Enable/Disable scroll on the map
538
+ */
539
+ scrollEnabled: PropTypes.bool,
540
+ /**
541
+ * Enable/Disable pitch on map
542
+ */
543
+ pitchEnabled: PropTypes.bool,
544
+ /**
545
+ * Enable/Disable rotation on map
546
+ */
547
+ rotateEnabled: PropTypes.bool,
548
+ /**
549
+ * The Mapbox terms of service, which governs the use of Mapbox-hosted vector tiles and styles,
550
+ * [requires](https://www.mapbox.com/help/how-attribution-works/) these copyright notices to accompany any map that features Mapbox-designed styles, OpenStreetMap data, or other Mapbox data such as satellite or terrain data.
551
+ * If that applies to this map view, do not hide this view or remove any notices from it.
552
+ *
553
+ * You are additionally [required](https://www.mapbox.com/help/how-mobile-apps-work/#telemetry) to provide users with the option to disable anonymous usage and location sharing (telemetry).
554
+ * If this view is hidden, you must implement this setting elsewhere in your app. See our website for [Android](https://www.mapbox.com/android-docs/map-sdk/overview/#telemetry-opt-out) and [iOS](https://www.mapbox.com/ios-sdk/#telemetry_opt_out) for implementation details.
555
+ *
556
+ * Enable/Disable attribution on map. For iOS you need to add MGLMapboxMetricsEnabledSettingShownInApp=YES
557
+ * to your Info.plist
558
+ */
559
+ attributionEnabled: PropTypes.bool,
560
+ /**
561
+ * Adds attribution offset, e.g. `{top: 8, left: 8}` will put attribution button in top-left corner of the map. By default on Android, the attribution with information icon (i) will be on the bottom left, while on iOS the mapbox logo will be on bottom left with information icon (i) on bottom right. Read more about mapbox attribution [here](https://docs.mapbox.com/help/getting-started/attribution/)
562
+ */
563
+ attributionPosition: ornamentPositionPropType,
564
+ /**
565
+ * MapView's tintColor
566
+ */
567
+ tintColor: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
568
+ /**
569
+ * Enable/Disable the logo on the map.
570
+ */
571
+ logoEnabled: PropTypes.bool,
572
+ /**
573
+ * Adds logo offset, e.g. `{top: 8, left: 8}` will put the logo in top-left corner of the map
574
+ */
575
+ logoPosition: ornamentPositionPropType,
576
+ /**
577
+ * Enable/Disable the compass from appearing on the map
578
+ */
579
+ compassEnabled: PropTypes.bool,
580
+ /**
581
+ * [`mapbox` (v10) implementation only] Enable/Disable if the compass should fade out when the map is pointing north
582
+ */
583
+ compassFadeWhenNorth: PropTypes.bool,
584
+ /**
585
+ * [`mapbox` (v10) implementation only] Adds compass offset, e.g. `{top: 8, left: 8}` will put the compass in top-left corner of the map
586
+ */
587
+ compassPosition: ornamentPositionPropType,
588
+ /**
589
+ * Change corner of map the compass starts at. 0: TopLeft, 1: TopRight, 2: BottomLeft, 3: BottomRight
590
+ */
591
+ compassViewPosition: PropTypes.number,
592
+ /**
593
+ * Add margins to the compass with x and y values
594
+ */
595
+ compassViewMargins: PropTypes.object,
596
+ /**
597
+ * [`mapbox` (v10) implementation only] Enable/Disable the scale bar from appearing on the map
598
+ */
599
+ scaleBarEnabled: PropTypes.bool,
600
+ /**
601
+ * [`mapbox` (v10) implementation only] Adds scale bar offset, e.g. `{top: 8, left: 8}` will put the scale bar in top-left corner of the map
602
+ */
603
+ scaleBarPosition: ornamentPositionPropType,
604
+ /**
605
+ * [Android only] Enable/Disable use of GLSurfaceView instead of TextureView.
606
+ */
607
+ surfaceView: PropTypes.bool,
608
+ /**
609
+ * Map press listener, gets called when a user presses the map
610
+ */
611
+ onPress: PropTypes.func,
612
+ /**
613
+ * Map long press listener, gets called when a user long presses the map
614
+ */
615
+ onLongPress: PropTypes.func,
616
+ /**
617
+ * <v10 only
618
+ *
619
+ * This event is triggered whenever the currently displayed map region is about to change.
620
+ *
621
+ * @param {PointFeature} feature - The geojson point feature at the camera center, properties contains zoomLevel, visibleBounds
622
+ */
623
+ onRegionWillChange: PropTypes.func,
624
+ /**
625
+ *
626
+ * This event is triggered whenever the currently displayed map region is changing.
627
+ *
628
+ * @param {PointFeature} feature - The geojson point feature at the camera center, properties contains zoomLevel, visibleBounds
629
+ */
630
+ onRegionIsChanging: PropTypes.func,
631
+ /**
632
+ *
633
+ * This event is triggered whenever the currently displayed map region finished changing.
634
+ *
635
+ * @param {PointFeature} feature - The geojson point feature at the camera center, properties contains zoomLevel, visibleBounds
636
+ */
637
+ onRegionDidChange: PropTypes.func,
638
+ /**
639
+ * iOS, v10 only, deprecated will be removed in next version - please use onRegionIsChanging.
640
+ */
641
+ onCameraChanged: PropTypes.func,
642
+ /**
643
+ * iOS, v10 only, deprecated will be removed in next version - please use onRegionDidChange
644
+ */
645
+ onMapIdle: PropTypes.func,
646
+ /**
647
+ * This event is triggered when the map is about to start loading a new map style.
648
+ */
649
+ onWillStartLoadingMap: PropTypes.func,
650
+ /**
651
+ * This is triggered when the map has successfully loaded a new map style.
652
+ */
653
+ onDidFinishLoadingMap: PropTypes.func,
654
+ /**
655
+ * This event is triggered when the map has failed to load a new map style.
656
+ */
657
+ onDidFailLoadingMap: PropTypes.func,
658
+ /**
659
+ * This event is triggered when the map will start rendering a frame.
660
+ */
661
+ onWillStartRenderingFrame: PropTypes.func,
662
+ /**
663
+ * This event is triggered when the map finished rendering a frame.
664
+ */
665
+ onDidFinishRenderingFrame: PropTypes.func,
666
+ /**
667
+ * This event is triggered when the map fully finished rendering a frame.
668
+ */
669
+ onDidFinishRenderingFrameFully: PropTypes.func,
670
+ /**
671
+ * This event is triggered when the map will start rendering the map.
672
+ */
673
+ onWillStartRenderingMap: PropTypes.func,
674
+ /**
675
+ * This event is triggered when the map finished rendering the map.
676
+ */
677
+ onDidFinishRenderingMap: PropTypes.func,
678
+ /**
679
+ * This event is triggered when the map fully finished rendering the map.
680
+ */
681
+ onDidFinishRenderingMapFully: PropTypes.func,
682
+ /**
683
+ * This event is triggered when the user location is updated.
684
+ */
685
+ onUserLocationUpdate: PropTypes.func,
686
+ /**
687
+ * This event is triggered when a style has finished loading.
688
+ */
689
+ onDidFinishLoadingStyle: PropTypes.func,
690
+ /**
691
+ * The emitted frequency of regionwillchange events
692
+ */
693
+ regionWillChangeDebounceTime: PropTypes.number,
694
+ /**
695
+ * The emitted frequency of regiondidchange events
696
+ */
697
+ regionDidChangeDebounceTime: PropTypes.number
698
+ });
699
+ _defineProperty(MapView, "defaultProps", {
700
+ projection: 'mercator',
701
+ localizeLabels: false,
702
+ scrollEnabled: true,
703
+ pitchEnabled: true,
704
+ rotateEnabled: true,
705
+ attributionEnabled: true,
706
+ compassEnabled: false,
707
+ compassFadeWhenNorth: false,
708
+ logoEnabled: true,
709
+ scaleBarEnabled: true,
710
+ surfaceView: false,
711
+ regionWillChangeDebounceTime: 10,
712
+ regionDidChangeDebounceTime: 500
713
+ });
714
+ const RCTMGLMapView = requireNativeComponent(NATIVE_MODULE_NAME, MapView, {
715
+ nativeOnly: {
716
+ onMapChange: true,
717
+ onAndroidCallback: true
718
+ }
719
+ });
720
+ let RCTMGLAndroidTextureMapView;
721
+ if (isAndroid()) {
722
+ RCTMGLAndroidTextureMapView = requireNativeComponent(ANDROID_TEXTURE_NATIVE_MODULE_NAME, MapView, {
723
+ nativeOnly: {
724
+ onMapChange: true,
725
+ onAndroidCallback: true
726
+ }
727
+ });
728
+ }
729
+ export default MapView;
730
+ //# sourceMappingURL=MapView.js.map