@rnmapbox/maps 10.0.0-beta.75 → 10.0.0-beta.77

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 (298) hide show
  1. package/README.md +3 -3
  2. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/images/RCTMGLImagesManager.kt +5 -5
  3. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/RCTMGLStyle.kt +7 -1
  4. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/RCTMGLStyleFactory.java +5 -5
  5. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTLayer.kt +37 -10
  6. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLBackgroundLayer.kt +21 -0
  7. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLBackgroundLayerManager.kt +65 -0
  8. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLCircleLayer.kt +40 -0
  9. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLCircleLayerManager.kt +76 -0
  10. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLFillExtrusionLayer.kt +43 -0
  11. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLFillExtrusionLayerManager.kt +76 -0
  12. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLFillLayer.kt +40 -0
  13. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLFillLayerManager.kt +76 -0
  14. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLHeatmapLayer.kt +40 -0
  15. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLHeatmapLayerManager.kt +76 -0
  16. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLLineLayer.kt +40 -0
  17. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLLineLayerManager.kt +76 -0
  18. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLRasterLayer.kt +18 -0
  19. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLRasterLayerManager.kt +65 -0
  20. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLSkyLayerManager.kt +76 -0
  21. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLSymbolLayer.kt +40 -0
  22. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLSymbolLayerManager.kt +76 -0
  23. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLImageSource.kt +69 -0
  24. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLImageSourceManager.kt +54 -0
  25. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLRasterDemSource.kt +82 -0
  26. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLRasterDemSourceManager.kt +30 -0
  27. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLRasterSource.kt +37 -0
  28. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLRasterSourceManager.kt +32 -0
  29. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLShapeSource.kt +5 -0
  30. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLShapeSourceManager.kt +10 -4
  31. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLTileSource.kt +44 -0
  32. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLTileSourceManager.kt +69 -0
  33. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLVectorSource.kt +78 -0
  34. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLVectorSourceManager.kt +69 -0
  35. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTSource.kt +101 -85
  36. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/events/PointAnnotationDragEvent.java +4 -2
  37. package/ios/RCTMGL-v10/RCMTGLImage.swift +2 -1
  38. package/ios/RCTMGL-v10/RCTMGLCamera.swift +11 -31
  39. package/ios/RCTMGL-v10/RCTMGLImages.swift +57 -17
  40. package/ios/RCTMGL-v10/RCTMGLInteractiveElement.swift +13 -1
  41. package/ios/RCTMGL-v10/RCTMGLLayer.swift +35 -6
  42. package/ios/RCTMGL-v10/RCTMGLLocationModule.swift +27 -4
  43. package/ios/RCTMGL-v10/RCTMGLMapView.swift +15 -3
  44. package/ios/RCTMGL-v10/RCTMGLSource.swift +35 -17
  45. package/ios/RCTMGL-v10/RCTMGLUtils.swift +14 -5
  46. package/javascript/MGLModule.ts +54 -0
  47. package/javascript/Mapbox.ts +100 -0
  48. package/javascript/classes/index.d.ts +20 -1
  49. package/javascript/components/AbstractLayer.tsx +2 -1
  50. package/javascript/components/Annotation.tsx +141 -0
  51. package/javascript/components/BackgroundLayer.tsx +6 -1
  52. package/javascript/components/{Callout.js → Callout.tsx} +53 -45
  53. package/javascript/components/CircleLayer.tsx +5 -0
  54. package/javascript/components/FillExtrusionLayer.tsx +6 -1
  55. package/javascript/components/FillLayer.tsx +5 -0
  56. package/javascript/components/HeadingIndicator.tsx +24 -13
  57. package/javascript/components/HeatmapLayer.tsx +6 -1
  58. package/javascript/components/ImageSource.tsx +6 -1
  59. package/javascript/components/Images.tsx +58 -6
  60. package/javascript/components/LineLayer.tsx +5 -0
  61. package/javascript/components/MapView.tsx +1 -1
  62. package/javascript/components/MarkerView.tsx +3 -2
  63. package/javascript/components/PointAnnotation.tsx +11 -6
  64. package/javascript/components/RasterDemSource.tsx +5 -0
  65. package/javascript/components/RasterLayer.tsx +6 -1
  66. package/javascript/components/RasterSource.tsx +5 -0
  67. package/javascript/components/ShapeSource.tsx +6 -1
  68. package/javascript/components/SkyLayer.tsx +5 -0
  69. package/javascript/components/{Style.js → Style.tsx} +117 -35
  70. package/javascript/components/SymbolLayer.tsx +6 -1
  71. package/javascript/components/Terrain.tsx +8 -7
  72. package/javascript/components/{UserLocation.js → UserLocation.tsx} +106 -95
  73. package/javascript/components/VectorSource.tsx +6 -1
  74. package/javascript/index.ts +4 -0
  75. package/javascript/modules/offline/offlineManager.ts +5 -1
  76. package/javascript/modules/snapshot/snapshotManager.ts +1 -0
  77. package/javascript/types/BaseProps.ts +1 -0
  78. package/javascript/types/Position.ts +1 -0
  79. package/javascript/utils/Logger.ts +1 -1
  80. package/javascript/utils/geoUtils.ts +0 -35
  81. package/javascript/utils/index.ts +0 -8
  82. package/javascript/utils/styleMap.ts +0 -1598
  83. package/lib/commonjs/MGLModule.js +37 -0
  84. package/lib/commonjs/MGLModule.js.map +1 -0
  85. package/lib/commonjs/Mapbox.js +379 -0
  86. package/lib/commonjs/Mapbox.js.map +1 -0
  87. package/lib/commonjs/classes/index.d.js +2 -0
  88. package/lib/commonjs/classes/index.d.js.map +1 -1
  89. package/lib/commonjs/components/AbstractLayer.js +1 -2
  90. package/lib/commonjs/components/AbstractLayer.js.map +1 -1
  91. package/lib/commonjs/components/{annotations/Annotation.js → Annotation.js} +26 -27
  92. package/lib/commonjs/components/Annotation.js.map +1 -0
  93. package/lib/commonjs/components/BackgroundLayer.js.map +1 -1
  94. package/lib/commonjs/components/Callout.js +7 -33
  95. package/lib/commonjs/components/Callout.js.map +1 -1
  96. package/lib/commonjs/components/CircleLayer.js.map +1 -1
  97. package/lib/commonjs/components/FillExtrusionLayer.js.map +1 -1
  98. package/lib/commonjs/components/FillLayer.js.map +1 -1
  99. package/lib/commonjs/components/HeadingIndicator.js +12 -3
  100. package/lib/commonjs/components/HeadingIndicator.js.map +1 -1
  101. package/lib/commonjs/components/HeatmapLayer.js.map +1 -1
  102. package/lib/commonjs/components/ImageSource.js.map +1 -1
  103. package/lib/commonjs/components/Images.js +17 -1
  104. package/lib/commonjs/components/Images.js.map +1 -1
  105. package/lib/commonjs/components/LineLayer.js.map +1 -1
  106. package/lib/commonjs/components/MapView.js.map +1 -1
  107. package/lib/commonjs/components/MarkerView.js.map +1 -1
  108. package/lib/commonjs/components/PointAnnotation.js.map +1 -1
  109. package/lib/commonjs/components/RasterDemSource.js.map +1 -1
  110. package/lib/commonjs/components/RasterLayer.js.map +1 -1
  111. package/lib/commonjs/components/RasterSource.js.map +1 -1
  112. package/lib/commonjs/components/ShapeSource.js.map +1 -1
  113. package/lib/commonjs/components/SkyLayer.js.map +1 -1
  114. package/lib/commonjs/components/Style.js +11 -15
  115. package/lib/commonjs/components/Style.js.map +1 -1
  116. package/lib/commonjs/components/SymbolLayer.js.map +1 -1
  117. package/lib/commonjs/components/Terrain.js.map +1 -1
  118. package/lib/commonjs/components/UserLocation.js +28 -78
  119. package/lib/commonjs/components/UserLocation.js.map +1 -1
  120. package/lib/commonjs/components/VectorSource.js.map +1 -1
  121. package/lib/commonjs/index.js +16 -339
  122. package/lib/commonjs/index.js.map +1 -1
  123. package/lib/commonjs/modules/offline/offlineManager.js +6 -0
  124. package/lib/commonjs/modules/offline/offlineManager.js.map +1 -1
  125. package/lib/commonjs/modules/snapshot/snapshotManager.js.map +1 -1
  126. package/lib/commonjs/types/Position.js +2 -0
  127. package/lib/commonjs/types/Position.js.map +1 -0
  128. package/lib/commonjs/utils/animated/Animated.js.map +1 -1
  129. package/lib/commonjs/utils/geoUtils.js +1 -19
  130. package/lib/commonjs/utils/geoUtils.js.map +1 -1
  131. package/lib/commonjs/utils/index.js +0 -16
  132. package/lib/commonjs/utils/index.js.map +1 -1
  133. package/lib/commonjs/utils/styleMap.js +1 -1217
  134. package/lib/commonjs/utils/styleMap.js.map +1 -1
  135. package/lib/module/MGLModule.js +19 -0
  136. package/lib/module/MGLModule.js.map +1 -0
  137. package/lib/module/Mapbox.js +59 -0
  138. package/lib/module/Mapbox.js.map +1 -0
  139. package/lib/module/classes/index.d.js +2 -0
  140. package/lib/module/classes/index.d.js.map +1 -1
  141. package/lib/module/components/AbstractLayer.js +1 -1
  142. package/lib/module/components/AbstractLayer.js.map +1 -1
  143. package/lib/module/components/{annotations/Annotation.js → Annotation.js} +26 -27
  144. package/lib/module/components/Annotation.js.map +1 -0
  145. package/lib/module/components/BackgroundLayer.js.map +1 -1
  146. package/lib/module/components/Callout.js +7 -33
  147. package/lib/module/components/Callout.js.map +1 -1
  148. package/lib/module/components/CircleLayer.js.map +1 -1
  149. package/lib/module/components/FillExtrusionLayer.js.map +1 -1
  150. package/lib/module/components/FillLayer.js.map +1 -1
  151. package/lib/module/components/HeadingIndicator.js +12 -3
  152. package/lib/module/components/HeadingIndicator.js.map +1 -1
  153. package/lib/module/components/HeatmapLayer.js.map +1 -1
  154. package/lib/module/components/ImageSource.js.map +1 -1
  155. package/lib/module/components/Images.js +17 -1
  156. package/lib/module/components/Images.js.map +1 -1
  157. package/lib/module/components/LineLayer.js.map +1 -1
  158. package/lib/module/components/MapView.js.map +1 -1
  159. package/lib/module/components/MarkerView.js.map +1 -1
  160. package/lib/module/components/PointAnnotation.js.map +1 -1
  161. package/lib/module/components/RasterDemSource.js.map +1 -1
  162. package/lib/module/components/RasterLayer.js.map +1 -1
  163. package/lib/module/components/RasterSource.js.map +1 -1
  164. package/lib/module/components/ShapeSource.js.map +1 -1
  165. package/lib/module/components/SkyLayer.js.map +1 -1
  166. package/lib/module/components/Style.js +11 -15
  167. package/lib/module/components/Style.js.map +1 -1
  168. package/lib/module/components/SymbolLayer.js.map +1 -1
  169. package/lib/module/components/Terrain.js.map +1 -1
  170. package/lib/module/components/UserLocation.js +27 -77
  171. package/lib/module/components/UserLocation.js.map +1 -1
  172. package/lib/module/components/VectorSource.js.map +1 -1
  173. package/lib/module/index.js +3 -108
  174. package/lib/module/index.js.map +1 -1
  175. package/lib/module/modules/offline/offlineManager.js +1 -0
  176. package/lib/module/modules/offline/offlineManager.js.map +1 -1
  177. package/lib/module/modules/snapshot/snapshotManager.js.map +1 -1
  178. package/lib/module/types/Position.js +2 -0
  179. package/lib/module/types/Position.js.map +1 -0
  180. package/lib/module/utils/animated/Animated.js.map +1 -1
  181. package/lib/module/utils/geoUtils.js +0 -16
  182. package/lib/module/utils/geoUtils.js.map +1 -1
  183. package/lib/module/utils/index.js +0 -14
  184. package/lib/module/utils/index.js.map +1 -1
  185. package/lib/module/utils/styleMap.js +0 -1201
  186. package/lib/module/utils/styleMap.js.map +1 -1
  187. package/lib/typescript/MGLModule.d.ts +22 -0
  188. package/lib/typescript/MGLModule.d.ts.map +1 -0
  189. package/lib/typescript/Mapbox.d.ts +54 -0
  190. package/lib/typescript/Mapbox.d.ts.map +1 -0
  191. package/lib/typescript/components/AbstractLayer.d.ts +1 -0
  192. package/lib/typescript/components/AbstractLayer.d.ts.map +1 -1
  193. package/lib/typescript/components/Annotation.d.ts +34 -0
  194. package/lib/typescript/components/Annotation.d.ts.map +1 -0
  195. package/lib/typescript/components/BackgroundLayer.d.ts +5 -1
  196. package/lib/typescript/components/BackgroundLayer.d.ts.map +1 -1
  197. package/lib/typescript/components/Callout.d.ts +41 -0
  198. package/lib/typescript/components/Callout.d.ts.map +1 -0
  199. package/lib/typescript/components/CircleLayer.d.ts +4 -0
  200. package/lib/typescript/components/CircleLayer.d.ts.map +1 -1
  201. package/lib/typescript/components/FillExtrusionLayer.d.ts +5 -1
  202. package/lib/typescript/components/FillExtrusionLayer.d.ts.map +1 -1
  203. package/lib/typescript/components/FillLayer.d.ts +4 -0
  204. package/lib/typescript/components/FillLayer.d.ts.map +1 -1
  205. package/lib/typescript/components/HeadingIndicator.d.ts +2 -1
  206. package/lib/typescript/components/HeadingIndicator.d.ts.map +1 -1
  207. package/lib/typescript/components/HeatmapLayer.d.ts +5 -1
  208. package/lib/typescript/components/HeatmapLayer.d.ts.map +1 -1
  209. package/lib/typescript/components/ImageSource.d.ts +5 -1
  210. package/lib/typescript/components/ImageSource.d.ts.map +1 -1
  211. package/lib/typescript/components/Images.d.ts +24 -2
  212. package/lib/typescript/components/Images.d.ts.map +1 -1
  213. package/lib/typescript/components/LineLayer.d.ts +4 -0
  214. package/lib/typescript/components/LineLayer.d.ts.map +1 -1
  215. package/lib/typescript/components/MapView.d.ts +2 -5
  216. package/lib/typescript/components/MapView.d.ts.map +1 -1
  217. package/lib/typescript/components/MarkerView.d.ts +3 -2
  218. package/lib/typescript/components/MarkerView.d.ts.map +1 -1
  219. package/lib/typescript/components/PointAnnotation.d.ts +8 -6
  220. package/lib/typescript/components/PointAnnotation.d.ts.map +1 -1
  221. package/lib/typescript/components/RasterDemSource.d.ts +4 -0
  222. package/lib/typescript/components/RasterDemSource.d.ts.map +1 -1
  223. package/lib/typescript/components/RasterLayer.d.ts +5 -1
  224. package/lib/typescript/components/RasterLayer.d.ts.map +1 -1
  225. package/lib/typescript/components/RasterSource.d.ts +4 -0
  226. package/lib/typescript/components/RasterSource.d.ts.map +1 -1
  227. package/lib/typescript/components/ShapeSource.d.ts +5 -1
  228. package/lib/typescript/components/ShapeSource.d.ts.map +1 -1
  229. package/lib/typescript/components/SkyLayer.d.ts +4 -0
  230. package/lib/typescript/components/SkyLayer.d.ts.map +1 -1
  231. package/lib/typescript/components/Style.d.ts +74 -0
  232. package/lib/typescript/components/Style.d.ts.map +1 -0
  233. package/lib/typescript/components/SymbolLayer.d.ts +5 -1
  234. package/lib/typescript/components/SymbolLayer.d.ts.map +1 -1
  235. package/lib/typescript/components/Terrain.d.ts +2 -2
  236. package/lib/typescript/components/Terrain.d.ts.map +1 -1
  237. package/lib/typescript/components/UserLocation.d.ts +102 -0
  238. package/lib/typescript/components/UserLocation.d.ts.map +1 -0
  239. package/lib/typescript/components/VectorSource.d.ts +5 -1
  240. package/lib/typescript/components/VectorSource.d.ts.map +1 -1
  241. package/lib/typescript/index.d.ts +4 -0
  242. package/lib/typescript/index.d.ts.map +1 -0
  243. package/lib/typescript/modules/offline/offlineManager.d.ts +2 -1
  244. package/lib/typescript/modules/offline/offlineManager.d.ts.map +1 -1
  245. package/lib/typescript/modules/snapshot/snapshotManager.d.ts +1 -0
  246. package/lib/typescript/modules/snapshot/snapshotManager.d.ts.map +1 -1
  247. package/lib/typescript/types/BaseProps.d.ts +1 -0
  248. package/lib/typescript/types/BaseProps.d.ts.map +1 -1
  249. package/lib/typescript/types/Position.d.ts +2 -0
  250. package/lib/typescript/types/Position.d.ts.map +1 -0
  251. package/lib/typescript/utils/Logger.d.ts +1 -1
  252. package/lib/typescript/utils/Logger.d.ts.map +1 -1
  253. package/lib/typescript/utils/animated/Animated.d.ts +23 -0
  254. package/lib/typescript/utils/animated/Animated.d.ts.map +1 -0
  255. package/lib/typescript/utils/geoUtils.d.ts +0 -8
  256. package/lib/typescript/utils/geoUtils.d.ts.map +1 -1
  257. package/lib/typescript/utils/index.d.ts +0 -14
  258. package/lib/typescript/utils/index.d.ts.map +1 -1
  259. package/lib/typescript/utils/styleMap.d.ts +0 -1406
  260. package/lib/typescript/utils/styleMap.d.ts.map +1 -1
  261. package/package.json +35 -39
  262. package/plugin/build/withMapbox.d.ts +10 -6
  263. package/plugin/build/withMapbox.js +119 -137
  264. package/plugin/install.md +21 -0
  265. package/plugin/src/withMapbox.ts +166 -138
  266. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLBackgroundLayer.java +0 -23
  267. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLBackgroundLayerManager.java +0 -60
  268. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLCircleLayer.java +0 -53
  269. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLCircleLayerManager.java +0 -73
  270. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLFillExtrusionLayer.java +0 -51
  271. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLFillExtrusionLayerManager.java +0 -76
  272. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLFillLayer.java +0 -51
  273. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLFillLayerManager.java +0 -77
  274. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLHeatmapLayer.java +0 -51
  275. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLHeatmapLayerManager.java +0 -73
  276. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLLineLayer.java +0 -51
  277. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLLineLayerManager.java +0 -75
  278. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLRasterLayer.java +0 -24
  279. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLRasterLayerManager.java +0 -60
  280. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLSkyLayerManager.java +0 -73
  281. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLSymbolLayer.java +0 -51
  282. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/layers/RCTMGLSymbolLayerManager.java +0 -71
  283. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLImageSource.java +0 -76
  284. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLImageSourceManager.java +0 -68
  285. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLRasterDemSource.java +0 -122
  286. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLRasterDemSourceManager.java +0 -64
  287. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLRasterSource.java +0 -43
  288. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLRasterSourceManager.java +0 -39
  289. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLTileSource.java +0 -103
  290. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLTileSourceManager.java +0 -80
  291. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLVectorSource.java +0 -100
  292. package/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/components/styles/sources/RCTMGLVectorSourceManager.java +0 -80
  293. package/index.d.ts +0 -516
  294. package/javascript/components/annotations/Annotation.js +0 -122
  295. package/javascript/index.js +0 -162
  296. package/lib/commonjs/components/annotations/Annotation.js.map +0 -1
  297. package/lib/module/components/annotations/Annotation.js.map +0 -1
  298. /package/javascript/utils/animated/{Animated.js → Animated.ts} +0 -0
package/README.md CHANGED
@@ -147,15 +147,15 @@ npm run android
147
147
  ```js
148
148
  import React from 'react';
149
149
  import { StyleSheet, View } from 'react-native';
150
- import MapboxGL from '@rnmapbox/maps';
150
+ import Mapbox from '@rnmapbox/maps';
151
151
 
152
- MapboxGL.setAccessToken('<YOUR_ACCESSTOKEN>');
152
+ Mapbox.setAccessToken('<YOUR_ACCESSTOKEN>');
153
153
 
154
154
  const App = () => {
155
155
  return (
156
156
  <View style={styles.page}>
157
157
  <View style={styles.container}>
158
- <MapboxGL.MapView style={styles.map} />
158
+ <Mapbox.MapView style={styles.map} />
159
159
  </View>
160
160
  </View>
161
161
  );
@@ -63,9 +63,9 @@ class RCTMGLImagesManager(private val mContext: ReactApplicationContext) :
63
63
  val drawable =
64
64
  ResourceUtils.getDrawableByName(mContext, resourceName) as BitmapDrawable
65
65
  if (drawable != null) {
66
- return NativeImage(name, drawable)
66
+ return NativeImage(resourceName, drawable)
67
67
  } else {
68
- Logger.e("RCTMGLImages", "cound not get native drawable with name: $name")
68
+ Logger.e("RCTMGLImages", "cound not get native drawable with name: $resourceName")
69
69
  return null
70
70
  }
71
71
  }
@@ -98,10 +98,10 @@ class RCTMGLImagesManager(private val mContext: ReactApplicationContext) :
98
98
  }
99
99
  val drawable =
100
100
  ResourceUtils.getDrawableByName(mContext, resourceName) as BitmapDrawable
101
- if (drawable != null) {
102
- return NativeImage(name, drawable, scale, sdf, stretchX, stretchY)
101
+ if (drawable != null && resourceName != null) {
102
+ return NativeImage(resourceName, drawable, scale, sdf, stretchX, stretchY)
103
103
  } else {
104
- Logger.e("RCTMGLImages", "cound not get native drawable with name: $name")
104
+ Logger.e("RCTMGLImages", "cound not get native drawable with name: $resourceName")
105
105
  return null
106
106
  }
107
107
  }
@@ -5,6 +5,7 @@ import com.facebook.react.bridge.ReadableMap
5
5
  import com.mapbox.maps.MapboxMap
6
6
  import com.mapbox.rctmgl.utils.ImageEntry
7
7
  import com.mapbox.rctmgl.utils.DownloadMapImageTask
8
+ import com.mapbox.rctmgl.utils.Logger
8
9
  import java.util.AbstractMap
9
10
  import java.util.ArrayList
10
11
 
@@ -39,11 +40,12 @@ class RCTMGLStyle(private val mContext: Context, reactStyle: ReadableMap?, map:
39
40
  }
40
41
 
41
42
  @JvmOverloads
42
- fun addImage(styleValue: RCTMGLStyleValue, callback: DownloadMapImageTask.OnAllImagesLoaded? = null) {
43
+ fun addImage(styleValue: RCTMGLStyleValue, styleKey: String, callback: DownloadMapImageTask.OnAllImagesLoaded? = null) {
43
44
  if (!styleValue.shouldAddImage()) {
44
45
  callback?.onAllImagesLoaded()
45
46
  return
46
47
  }
48
+ Logger.w(LOG_TAG,"Deprecated: Image in style is deprecated, use images component instead. key: $styleKey [image-in-style-deprecated]")
47
49
  val uriStr = styleValue.imageURI
48
50
  val images = arrayOf<Map.Entry<String, ImageEntry>>(
49
51
  AbstractMap.SimpleEntry<String, ImageEntry>(
@@ -59,4 +61,8 @@ class RCTMGLStyle(private val mContext: Context, reactStyle: ReadableMap?, map:
59
61
  mReactStyle = reactStyle
60
62
  mMap = map
61
63
  }
64
+
65
+ companion object {
66
+ const val LOG_TAG = "RCTMGLStyle"
67
+ }
62
68
  }
@@ -80,7 +80,7 @@ public class RCTMGLStyleFactory {
80
80
  RCTMGLStyleFactory.setFillTranslateAnchor(layer, styleValue);
81
81
  break;
82
82
  case "fillPattern":
83
- style.addImage(styleValue, new DownloadMapImageTask.OnAllImagesLoaded() {
83
+ style.addImage(styleValue, styleKey, new DownloadMapImageTask.OnAllImagesLoaded() {
84
84
  @Override
85
85
  public void onAllImagesLoaded() {
86
86
  try {
@@ -172,7 +172,7 @@ public class RCTMGLStyleFactory {
172
172
  RCTMGLStyleFactory.setLineDasharray(layer, styleValue);
173
173
  break;
174
174
  case "linePattern":
175
- style.addImage(styleValue, new DownloadMapImageTask.OnAllImagesLoaded() {
175
+ style.addImage(styleValue, styleKey, new DownloadMapImageTask.OnAllImagesLoaded() {
176
176
  @Override
177
177
  public void onAllImagesLoaded() {
178
178
  try {
@@ -240,7 +240,7 @@ public class RCTMGLStyleFactory {
240
240
  RCTMGLStyleFactory.setIconTextFitPadding(layer, styleValue);
241
241
  break;
242
242
  case "iconImage":
243
- style.addImage(styleValue, new DownloadMapImageTask.OnAllImagesLoaded() {
243
+ style.addImage(styleValue, styleKey, new DownloadMapImageTask.OnAllImagesLoaded() {
244
244
  @Override
245
245
  public void onAllImagesLoaded() {
246
246
  try {
@@ -573,7 +573,7 @@ public class RCTMGLStyleFactory {
573
573
  RCTMGLStyleFactory.setFillExtrusionTranslateAnchor(layer, styleValue);
574
574
  break;
575
575
  case "fillExtrusionPattern":
576
- style.addImage(styleValue, new DownloadMapImageTask.OnAllImagesLoaded() {
576
+ style.addImage(styleValue, styleKey, new DownloadMapImageTask.OnAllImagesLoaded() {
577
577
  @Override
578
578
  public void onAllImagesLoaded() {
579
579
  try {
@@ -729,7 +729,7 @@ public class RCTMGLStyleFactory {
729
729
  RCTMGLStyleFactory.setBackgroundColorTransition(layer, styleValue);
730
730
  break;
731
731
  case "backgroundPattern":
732
- style.addImage(styleValue, new DownloadMapImageTask.OnAllImagesLoaded() {
732
+ style.addImage(styleValue, styleKey, new DownloadMapImageTask.OnAllImagesLoaded() {
733
733
  @Override
734
734
  public void onAllImagesLoaded() {
735
735
  try {
@@ -17,6 +17,7 @@ import com.mapbox.maps.extension.style.expressions.generated.Expression
17
17
  import com.mapbox.maps.extension.style.layers.*
18
18
  import com.mapbox.maps.extension.style.layers.properties.generated.Visibility
19
19
  import com.mapbox.rctmgl.components.styles.layers.RCTLayer
20
+ import com.mapbox.rctmgl.components.styles.sources.RCTSource
20
21
  import com.mapbox.rctmgl.modules.RCTMGLLogging
21
22
  import com.mapbox.rctmgl.utils.ExpressionParser
22
23
  import java.lang.ClassCastException
@@ -43,10 +44,19 @@ abstract class RCTLayer<T : Layer?>(protected var mContext: Context) : AbstractS
43
44
  protected var mLayer: T? = null
44
45
  protected var mHadFilter = false
45
46
 
47
+ protected var mExisting : Boolean? = null
48
+
46
49
  fun setSourceID(sourceID: String?) {
47
50
  mSourceID = sourceID
48
51
  }
49
52
 
53
+ fun checkID(): String? {
54
+ if (iD == null) {
55
+ Logger.w(LOG_TAG, "iD is null in layer")
56
+ }
57
+ return iD;
58
+ }
59
+
50
60
  fun setAboveLayerID(aboveLayerID: String?) {
51
61
  if (mAboveLayerID != null && mAboveLayerID == aboveLayerID) {
52
62
  return
@@ -76,7 +86,7 @@ abstract class RCTLayer<T : Layer?>(protected var mContext: Context) : AbstractS
76
86
  mLayerIndex = layerIndex
77
87
  if (mLayer != null) {
78
88
  removeFromMap(mMapView!!)
79
- addAtIndex(mLayerIndex!!)
89
+ addAtIndex(layerIndex)
80
90
  }
81
91
  }
82
92
 
@@ -121,6 +131,10 @@ abstract class RCTLayer<T : Layer?>(protected var mContext: Context) : AbstractS
121
131
  }
122
132
  }
123
133
 
134
+ fun setExisting(existing: Boolean) {
135
+ mExisting = existing
136
+ }
137
+
124
138
  fun add() {
125
139
  if (!hasInitialized()) {
126
140
  return
@@ -175,7 +189,7 @@ abstract class RCTLayer<T : Layer?>(protected var mContext: Context) : AbstractS
175
189
  if (!hasInitialized()) {
176
190
  return
177
191
  }
178
- if (style == null) return
192
+ val style = this.style ?: return
179
193
  val layerSize = style!!.styleLayers.size
180
194
  if (index >= layerSize) {
181
195
  FLog.e(
@@ -184,13 +198,16 @@ abstract class RCTLayer<T : Layer?>(protected var mContext: Context) : AbstractS
184
198
  )
185
199
  index = layerSize - 1
186
200
  }
187
- style!!.addLayerAt(mLayer!!, index)
188
- mMapView!!.layerAdded(mLayer!!)
201
+ val layer = mLayer ?: return
202
+ val mapView = mMapView ?: return
203
+ style.addLayerAt(layer, index)
204
+ mapView.layerAdded(layer)
189
205
  }
190
206
 
191
207
  protected fun insertLayer() {
192
- if (style == null) return
193
- if (style!!.getLayer(iD!!) != null) {
208
+ val style = this.style ?: return
209
+ val id = checkID() ?: return
210
+ if (style.styleLayerExists(id)) {
194
211
  return // prevent adding a layer twice
195
212
  }
196
213
  if (mAboveLayerID != null) {
@@ -218,8 +235,8 @@ abstract class RCTLayer<T : Layer?>(protected var mContext: Context) : AbstractS
218
235
  // override if you want to update the filter
219
236
  }
220
237
 
221
- private fun getLayerAs(style: Style?, id: String?): T? {
222
- val result = style!!.getLayer(iD!!)
238
+ private fun getLayerAs(style: Style, id: String?): T? {
239
+ val result = style.getLayer(iD!!)
223
240
  return try {
224
241
  result as T?
225
242
  } catch (exception: ClassCastException) {
@@ -230,14 +247,24 @@ abstract class RCTLayer<T : Layer?>(protected var mContext: Context) : AbstractS
230
247
  override fun addToMap(mapView: RCTMGLMapView) {
231
248
  super.addToMap(mapView)
232
249
  mMap = mapView.getMapboxMap()
233
- if (style == null) return
234
- val existingLayer = getLayerAs(style, iD)
250
+ val style = style ?: return
251
+ val id = checkID() ?: return
252
+
253
+ val exists = style.styleLayerExists(id)
254
+ var existingLayer: T? = null;
255
+ if (exists) {
256
+ if (mExisting == null) {
257
+ Logger.e(LOG_TAG, "Layer $id seems to refer to an existing layer but existing flag is not specified, this is deprecated")
258
+ }
259
+ existingLayer = getLayerAs(style, id)
260
+ }
235
261
  if (existingLayer != null) {
236
262
  mLayer = existingLayer
237
263
  } else {
238
264
  mLayer = makeLayer()
239
265
  insertLayer()
240
266
  }
267
+
241
268
  addStyles()
242
269
  if (mFilter != null) {
243
270
  mHadFilter = true
@@ -0,0 +1,21 @@
1
+ package com.mapbox.rctmgl.components.styles.layers
2
+
3
+ import android.content.Context
4
+ import com.mapbox.maps.extension.style.layers.generated.BackgroundLayer
5
+ import com.mapbox.rctmgl.components.styles.RCTMGLStyle
6
+ import com.mapbox.rctmgl.components.styles.RCTMGLStyleFactory
7
+
8
+ class RCTMGLBackgroundLayer(context: Context?) : RCTLayer<BackgroundLayer?>(
9
+ context!!
10
+ ) {
11
+ override fun makeLayer(): BackgroundLayer {
12
+ return BackgroundLayer(iD!!)
13
+ }
14
+
15
+ override fun addStyles() {
16
+ RCTMGLStyleFactory.setBackgroundLayerStyle(
17
+ mLayer,
18
+ RCTMGLStyle(context, mReactStyle, mMap!!)
19
+ )
20
+ }
21
+ }
@@ -0,0 +1,65 @@
1
+ package com.mapbox.rctmgl.components.styles.layers
2
+
3
+ import com.facebook.react.bridge.ReadableMap
4
+ import com.facebook.react.uimanager.ThemedReactContext
5
+ import com.facebook.react.uimanager.ViewGroupManager
6
+ import com.facebook.react.uimanager.annotations.ReactProp
7
+
8
+ class RCTMGLBackgroundLayerManager : ViewGroupManager<RCTMGLBackgroundLayer>() {
9
+ override fun getName(): String {
10
+ return REACT_CLASS
11
+ }
12
+
13
+ override fun createViewInstance(reactContext: ThemedReactContext): RCTMGLBackgroundLayer {
14
+ return RCTMGLBackgroundLayer(reactContext)
15
+ }
16
+
17
+ @ReactProp(name = "id")
18
+ fun setId(layer: RCTMGLBackgroundLayer, id: String?) {
19
+ layer.iD = id
20
+ }
21
+
22
+ @ReactProp(name = "existing")
23
+ fun setExisting(layer: RCTMGLBackgroundLayer, existing: Boolean) {
24
+ layer.setExisting(existing)
25
+ }
26
+
27
+ @ReactProp(name = "sourceID")
28
+ fun setSourceID(layer: RCTMGLBackgroundLayer, sourceID: String?) {
29
+ layer.setSourceID(sourceID)
30
+ }
31
+
32
+ @ReactProp(name = "aboveLayerID")
33
+ fun setAboveLayerID(layer: RCTMGLBackgroundLayer, aboveLayerID: String?) {
34
+ layer.setAboveLayerID(aboveLayerID)
35
+ }
36
+
37
+ @ReactProp(name = "belowLayerID")
38
+ fun setBelowLayerID(layer: RCTMGLBackgroundLayer, belowLayerID: String?) {
39
+ layer.setBelowLayerID(belowLayerID)
40
+ }
41
+
42
+ @ReactProp(name = "layerIndex")
43
+ fun setLayerIndex(layer: RCTMGLBackgroundLayer, layerIndex: Int) {
44
+ layer.setLayerIndex(layerIndex)
45
+ }
46
+
47
+ @ReactProp(name = "minZoomLevel")
48
+ fun setMinZoomLevel(layer: RCTMGLBackgroundLayer, minZoomLevel: Double) {
49
+ layer.setMinZoomLevel(minZoomLevel)
50
+ }
51
+
52
+ @ReactProp(name = "maxZoomLevel")
53
+ fun setMaxZoomLevel(layer: RCTMGLBackgroundLayer, maxZoomLevel: Double) {
54
+ layer.setMaxZoomLevel(maxZoomLevel)
55
+ }
56
+
57
+ @ReactProp(name = "reactStyle")
58
+ fun setReactStyle(layer: RCTMGLBackgroundLayer, style: ReadableMap?) {
59
+ layer.setReactStyle(style)
60
+ }
61
+
62
+ companion object {
63
+ const val REACT_CLASS = "RCTMGLBackgroundLayer"
64
+ }
65
+ }
@@ -0,0 +1,40 @@
1
+ package com.mapbox.rctmgl.components.styles.layers
2
+
3
+ import android.content.Context
4
+ import com.mapbox.maps.extension.style.expressions.generated.Expression
5
+ import com.mapbox.maps.extension.style.layers.generated.CircleLayer
6
+ import com.mapbox.rctmgl.components.mapview.RCTMGLMapView
7
+ import com.mapbox.rctmgl.components.styles.RCTMGLStyle
8
+ import com.mapbox.rctmgl.components.styles.RCTMGLStyleFactory
9
+
10
+ class RCTMGLCircleLayer(context: Context?) : RCTLayer<CircleLayer?>(
11
+ context!!
12
+ ) {
13
+ private var mSourceLayerID: String? = null
14
+ override fun updateFilter(expression: Expression?) {
15
+ mLayer!!.filter(expression!!)
16
+ }
17
+
18
+ override fun addToMap(mapView: RCTMGLMapView) {
19
+ super.addToMap(mapView)
20
+ }
21
+
22
+ override fun makeLayer(): CircleLayer {
23
+ val layer = CircleLayer(iD!!, mSourceID!!)
24
+ if (mSourceLayerID != null) {
25
+ layer.sourceLayer(mSourceLayerID!!)
26
+ }
27
+ return layer
28
+ }
29
+
30
+ override fun addStyles() {
31
+ RCTMGLStyleFactory.setCircleLayerStyle(mLayer, RCTMGLStyle(context, mReactStyle, mMap!!))
32
+ }
33
+
34
+ fun setSourceLayerID(sourceLayerID: String?) {
35
+ mSourceLayerID = sourceLayerID
36
+ if (mLayer != null) {
37
+ mLayer!!.sourceLayer(sourceLayerID!!)
38
+ }
39
+ }
40
+ }
@@ -0,0 +1,76 @@
1
+ package com.mapbox.rctmgl.components.styles.layers
2
+
3
+ import com.facebook.react.bridge.ReadableArray
4
+ import com.facebook.react.bridge.ReadableMap
5
+ import com.facebook.react.uimanager.ThemedReactContext
6
+ import com.facebook.react.uimanager.ViewGroupManager
7
+ import com.facebook.react.uimanager.annotations.ReactProp
8
+
9
+ class RCTMGLCircleLayerManager : ViewGroupManager<RCTMGLCircleLayer>() {
10
+ override fun getName(): String {
11
+ return REACT_CLASS
12
+ }
13
+
14
+ override fun createViewInstance(reactContext: ThemedReactContext): RCTMGLCircleLayer {
15
+ return RCTMGLCircleLayer(reactContext)
16
+ }
17
+
18
+ @ReactProp(name = "id")
19
+ fun setId(layer: RCTMGLCircleLayer, id: String?) {
20
+ layer.iD = id
21
+ }
22
+
23
+ @ReactProp(name = "existing")
24
+ fun setExisting(layer: RCTMGLCircleLayer, existing: Boolean) {
25
+ layer.setExisting(existing)
26
+ }
27
+
28
+ @ReactProp(name = "sourceID")
29
+ fun setSourceID(layer: RCTMGLCircleLayer, sourceID: String?) {
30
+ layer.setSourceID(sourceID)
31
+ }
32
+
33
+ @ReactProp(name = "aboveLayerID")
34
+ fun setAboveLayerID(layer: RCTMGLCircleLayer, aboveLayerID: String?) {
35
+ layer.setAboveLayerID(aboveLayerID)
36
+ }
37
+
38
+ @ReactProp(name = "belowLayerID")
39
+ fun setBelowLayerID(layer: RCTMGLCircleLayer, belowLayerID: String?) {
40
+ layer.setBelowLayerID(belowLayerID)
41
+ }
42
+
43
+ @ReactProp(name = "layerIndex")
44
+ fun setLayerIndex(layer: RCTMGLCircleLayer, layerIndex: Int) {
45
+ layer.setLayerIndex(layerIndex)
46
+ }
47
+
48
+ @ReactProp(name = "minZoomLevel")
49
+ fun setMinZoomLevel(layer: RCTMGLCircleLayer, minZoomLevel: Double) {
50
+ layer.setMinZoomLevel(minZoomLevel)
51
+ }
52
+
53
+ @ReactProp(name = "maxZoomLevel")
54
+ fun setMaxZoomLevel(layer: RCTMGLCircleLayer, maxZoomLevel: Double) {
55
+ layer.setMaxZoomLevel(maxZoomLevel)
56
+ }
57
+
58
+ @ReactProp(name = "reactStyle")
59
+ fun setReactStyle(layer: RCTMGLCircleLayer, style: ReadableMap?) {
60
+ layer.setReactStyle(style)
61
+ }
62
+
63
+ @ReactProp(name = "sourceLayerID")
64
+ fun setSourceLayerId(layer: RCTMGLCircleLayer, sourceLayerID: String?) {
65
+ layer.setSourceLayerID(sourceLayerID)
66
+ }
67
+
68
+ @ReactProp(name = "filter")
69
+ fun setFilter(layer: RCTMGLCircleLayer, filterList: ReadableArray?) {
70
+ layer.setFilter(filterList)
71
+ }
72
+
73
+ companion object {
74
+ const val REACT_CLASS = "RCTMGLCircleLayer"
75
+ }
76
+ }
@@ -0,0 +1,43 @@
1
+ package com.mapbox.rctmgl.components.styles.layers
2
+
3
+ import android.content.Context
4
+ import com.mapbox.maps.extension.style.expressions.generated.Expression
5
+ import com.mapbox.maps.extension.style.layers.generated.FillExtrusionLayer
6
+ import com.mapbox.rctmgl.components.mapview.RCTMGLMapView
7
+ import com.mapbox.rctmgl.components.styles.RCTMGLStyle
8
+ import com.mapbox.rctmgl.components.styles.RCTMGLStyleFactory
9
+
10
+ class RCTMGLFillExtrusionLayer(context: Context?) : RCTLayer<FillExtrusionLayer?>(
11
+ context!!
12
+ ) {
13
+ private var mSourceLayerID: String? = null
14
+ override fun updateFilter(expression: Expression?) {
15
+ mLayer!!.filter(expression!!)
16
+ }
17
+
18
+ override fun addToMap(mapView: RCTMGLMapView) {
19
+ super.addToMap(mapView)
20
+ }
21
+
22
+ override fun makeLayer(): FillExtrusionLayer {
23
+ val layer = FillExtrusionLayer(iD!!, mSourceID!!)
24
+ if (mSourceLayerID != null) {
25
+ layer.sourceLayer(mSourceLayerID!!)
26
+ }
27
+ return layer
28
+ }
29
+
30
+ override fun addStyles() {
31
+ RCTMGLStyleFactory.setFillExtrusionLayerStyle(
32
+ mLayer,
33
+ RCTMGLStyle(context, mReactStyle, mMap!!)
34
+ )
35
+ }
36
+
37
+ fun setSourceLayerID(sourceLayerID: String?) {
38
+ mSourceLayerID = sourceLayerID
39
+ if (mLayer != null) {
40
+ mLayer!!.sourceLayer(mSourceLayerID!!)
41
+ }
42
+ }
43
+ }
@@ -0,0 +1,76 @@
1
+ package com.mapbox.rctmgl.components.styles.layers
2
+
3
+ import com.facebook.react.bridge.ReadableArray
4
+ import com.facebook.react.bridge.ReadableMap
5
+ import com.facebook.react.uimanager.ThemedReactContext
6
+ import com.facebook.react.uimanager.ViewGroupManager
7
+ import com.facebook.react.uimanager.annotations.ReactProp
8
+
9
+ class RCTMGLFillExtrusionLayerManager : ViewGroupManager<RCTMGLFillExtrusionLayer>() {
10
+ override fun getName(): String {
11
+ return REACT_CLASS
12
+ }
13
+
14
+ override fun createViewInstance(reactContext: ThemedReactContext): RCTMGLFillExtrusionLayer {
15
+ return RCTMGLFillExtrusionLayer(reactContext)
16
+ }
17
+
18
+ @ReactProp(name = "id")
19
+ fun setId(layer: RCTMGLFillExtrusionLayer, id: String?) {
20
+ layer.iD = id
21
+ }
22
+
23
+ @ReactProp(name = "existing")
24
+ fun setExisting(layer: RCTMGLFillExtrusionLayer, existing: Boolean) {
25
+ layer.setExisting(existing)
26
+ }
27
+
28
+ @ReactProp(name = "sourceID")
29
+ fun setSourceID(layer: RCTMGLFillExtrusionLayer, sourceID: String?) {
30
+ layer.setSourceID(sourceID)
31
+ }
32
+
33
+ @ReactProp(name = "aboveLayerID")
34
+ fun setAboveLayerID(layer: RCTMGLFillExtrusionLayer, aboveLayerID: String?) {
35
+ layer.setAboveLayerID(aboveLayerID)
36
+ }
37
+
38
+ @ReactProp(name = "belowLayerID")
39
+ fun setBelowLayerID(layer: RCTMGLFillExtrusionLayer, belowLayerID: String?) {
40
+ layer.setBelowLayerID(belowLayerID)
41
+ }
42
+
43
+ @ReactProp(name = "layerIndex")
44
+ fun setLayerIndex(layer: RCTMGLFillExtrusionLayer, layerIndex: Int) {
45
+ layer.setLayerIndex(layerIndex)
46
+ }
47
+
48
+ @ReactProp(name = "minZoomLevel")
49
+ fun setMinZoomLevel(layer: RCTMGLFillExtrusionLayer, minZoomLevel: Double) {
50
+ layer.setMinZoomLevel(minZoomLevel)
51
+ }
52
+
53
+ @ReactProp(name = "maxZoomLevel")
54
+ fun setMaxZoomLevel(layer: RCTMGLFillExtrusionLayer, maxZoomLevel: Double) {
55
+ layer.setMaxZoomLevel(maxZoomLevel)
56
+ }
57
+
58
+ @ReactProp(name = "reactStyle")
59
+ fun setReactStyle(layer: RCTMGLFillExtrusionLayer, style: ReadableMap?) {
60
+ layer.setReactStyle(style)
61
+ }
62
+
63
+ @ReactProp(name = "sourceLayerID")
64
+ fun setSourceLayerId(layer: RCTMGLFillExtrusionLayer, sourceLayerID: String?) {
65
+ layer.setSourceLayerID(sourceLayerID)
66
+ }
67
+
68
+ @ReactProp(name = "filter")
69
+ fun setFilter(layer: RCTMGLFillExtrusionLayer, filterList: ReadableArray?) {
70
+ layer.setFilter(filterList)
71
+ }
72
+
73
+ companion object {
74
+ const val REACT_CLASS = "RCTMGLFillExtrusionLayer"
75
+ }
76
+ }
@@ -0,0 +1,40 @@
1
+ package com.mapbox.rctmgl.components.styles.layers
2
+
3
+ import android.content.Context
4
+ import com.mapbox.maps.extension.style.expressions.generated.Expression
5
+ import com.mapbox.maps.extension.style.layers.generated.FillLayer
6
+ import com.mapbox.rctmgl.components.mapview.RCTMGLMapView
7
+ import com.mapbox.rctmgl.components.styles.RCTMGLStyle
8
+ import com.mapbox.rctmgl.components.styles.RCTMGLStyleFactory
9
+
10
+ class RCTMGLFillLayer(context: Context?) : RCTLayer<FillLayer?>(
11
+ context!!
12
+ ) {
13
+ private var mSourceLayerID: String? = null
14
+ override fun updateFilter(expression: Expression?) {
15
+ mLayer!!.filter(expression!!)
16
+ }
17
+
18
+ override fun addToMap(mapView: RCTMGLMapView) {
19
+ super.addToMap(mapView)
20
+ }
21
+
22
+ override fun makeLayer(): FillLayer {
23
+ val layer = FillLayer(iD!!, mSourceID!!)
24
+ if (mSourceLayerID != null) {
25
+ layer.sourceLayer(mSourceLayerID!!)
26
+ }
27
+ return layer
28
+ }
29
+
30
+ override fun addStyles() {
31
+ RCTMGLStyleFactory.setFillLayerStyle(mLayer, RCTMGLStyle(context, mReactStyle, mMap!!))
32
+ }
33
+
34
+ fun setSourceLayerID(sourceLayerID: String?) {
35
+ mSourceLayerID = sourceLayerID
36
+ if (mLayer != null) {
37
+ mLayer!!.sourceLayer(mSourceLayerID!!)
38
+ }
39
+ }
40
+ }
@@ -0,0 +1,76 @@
1
+ package com.mapbox.rctmgl.components.styles.layers
2
+
3
+ import com.facebook.react.bridge.ReadableArray
4
+ import com.facebook.react.bridge.ReadableMap
5
+ import com.facebook.react.uimanager.ThemedReactContext
6
+ import com.facebook.react.uimanager.ViewGroupManager
7
+ import com.facebook.react.uimanager.annotations.ReactProp
8
+
9
+ class RCTMGLFillLayerManager : ViewGroupManager<RCTMGLFillLayer>() {
10
+ override fun getName(): String {
11
+ return REACT_CLASS
12
+ }
13
+
14
+ override fun createViewInstance(reactContext: ThemedReactContext): RCTMGLFillLayer {
15
+ return RCTMGLFillLayer(reactContext)
16
+ }
17
+
18
+ @ReactProp(name = "id")
19
+ fun setId(layer: RCTMGLFillLayer, id: String?) {
20
+ layer.iD = id
21
+ }
22
+
23
+ @ReactProp(name = "existing")
24
+ fun setExisting(layer: RCTMGLFillLayer, existing: Boolean) {
25
+ layer.setExisting(existing)
26
+ }
27
+
28
+ @ReactProp(name = "sourceID")
29
+ fun setSourceID(layer: RCTMGLFillLayer, sourceID: String?) {
30
+ layer.setSourceID(sourceID)
31
+ }
32
+
33
+ @ReactProp(name = "sourceLayerID")
34
+ fun setSourceLayerId(layer: RCTMGLFillLayer, sourceLayerID: String?) {
35
+ layer.setSourceLayerID(sourceLayerID)
36
+ }
37
+
38
+ @ReactProp(name = "aboveLayerID")
39
+ fun setAboveLayerID(layer: RCTMGLFillLayer, aboveLayerID: String?) {
40
+ layer.setAboveLayerID(aboveLayerID)
41
+ }
42
+
43
+ @ReactProp(name = "belowLayerID")
44
+ fun setBelowLayerID(layer: RCTMGLFillLayer, belowLayerID: String?) {
45
+ layer.setBelowLayerID(belowLayerID)
46
+ }
47
+
48
+ @ReactProp(name = "layerIndex")
49
+ fun setLayerIndex(layer: RCTMGLFillLayer, layerIndex: Int) {
50
+ layer.setLayerIndex(layerIndex)
51
+ }
52
+
53
+ @ReactProp(name = "minZoomLevel")
54
+ fun setMinZoomLevel(layer: RCTMGLFillLayer, minZoomLevel: Double) {
55
+ layer.setMinZoomLevel(minZoomLevel)
56
+ }
57
+
58
+ @ReactProp(name = "maxZoomLevel")
59
+ fun setMaxZoomLevel(layer: RCTMGLFillLayer, maxZoomLevel: Double) {
60
+ layer.setMaxZoomLevel(maxZoomLevel)
61
+ }
62
+
63
+ @ReactProp(name = "reactStyle")
64
+ fun setReactStyle(layer: RCTMGLFillLayer, style: ReadableMap?) {
65
+ layer.setReactStyle(style)
66
+ }
67
+
68
+ @ReactProp(name = "filter")
69
+ fun setFilter(layer: RCTMGLFillLayer, filterList: ReadableArray?) {
70
+ layer.setFilter(filterList)
71
+ }
72
+
73
+ companion object {
74
+ const val REACT_CLASS = "RCTMGLFillLayer"
75
+ }
76
+ }