@maplibre/maplibre-react-native 11.0.0-alpha.7 → 11.0.0-alpha.9

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 (338) hide show
  1. package/MapLibreReactNative.podspec +1 -1
  2. package/android/build.gradle +0 -3
  3. package/android/src/main/java/org/maplibre/reactnative/MLRNPackage.kt +43 -0
  4. package/android/src/main/java/org/maplibre/reactnative/components/AbstractEvent.kt +24 -0
  5. package/android/src/main/java/org/maplibre/reactnative/components/AbstractEventEmitter.kt +71 -0
  6. package/android/src/main/java/org/maplibre/reactnative/components/annotation/MLRNPointAnnotation.java +1 -1
  7. package/android/src/main/java/org/maplibre/reactnative/components/camera/CameraStop.kt +203 -0
  8. package/android/src/main/java/org/maplibre/reactnative/components/camera/CameraUpdateItem.kt +109 -0
  9. package/android/src/main/java/org/maplibre/reactnative/components/camera/CameraUpdateQueue.kt +60 -0
  10. package/android/src/main/java/org/maplibre/reactnative/components/camera/MLRNCamera.kt +409 -0
  11. package/android/src/main/java/org/maplibre/reactnative/components/camera/MLRNCameraManager.kt +69 -0
  12. package/android/src/main/java/org/maplibre/reactnative/components/camera/MLRNCameraModule.kt +34 -0
  13. package/android/src/main/java/org/maplibre/reactnative/components/camera/constants/CameraEasing.kt +24 -0
  14. package/android/src/main/java/org/maplibre/reactnative/components/images/MLRNImages.java +1 -2
  15. package/android/src/main/java/org/maplibre/reactnative/components/location/LocationComponentManager.java +1 -1
  16. package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNAndroidTextureMapView.kt +23 -0
  17. package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNAndroidTextureMapViewManager.kt +23 -0
  18. package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapView.kt +1338 -0
  19. package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapViewManager.kt +187 -0
  20. package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapViewModule.kt +159 -0
  21. package/android/src/main/java/org/maplibre/reactnative/components/mapview/helpers/CameraChangeTracker.kt +26 -0
  22. package/android/src/main/java/org/maplibre/reactnative/components/mapview/helpers/LayerSourceInfo.kt +74 -0
  23. package/android/src/main/java/org/maplibre/reactnative/components/styles/layers/MLRNLayer.java +1 -5
  24. package/android/src/main/java/org/maplibre/reactnative/components/styles/light/MLRNLight.java +1 -6
  25. package/android/src/main/java/org/maplibre/reactnative/components/styles/sources/MLRNShapeSource.java +2 -9
  26. package/android/src/main/java/org/maplibre/reactnative/components/styles/sources/MLRNSource.java +1 -1
  27. package/android/src/main/java/org/maplibre/reactnative/events/AbstractEvent.java +2 -5
  28. package/android/src/main/java/org/maplibre/reactnative/events/MapChangeEvent.kt +18 -0
  29. package/android/src/main/java/org/maplibre/reactnative/events/MapClickEvent.java +4 -0
  30. package/android/src/main/java/org/maplibre/reactnative/events/MapPressEvent.kt +27 -0
  31. package/android/src/main/java/org/maplibre/reactnative/events/TrackUserLocationChangeEvent.kt +24 -0
  32. package/android/src/main/java/org/maplibre/reactnative/events/constants/EventKeys.java +0 -1
  33. package/android/src/main/java/org/maplibre/reactnative/events/constants/EventTypes.java +0 -19
  34. package/android/src/main/java/org/maplibre/reactnative/location/LocationManager.java +1 -1
  35. package/android/src/main/java/org/maplibre/reactnative/location/TrackUserLocationMode.kt +43 -0
  36. package/android/src/main/java/org/maplibre/reactnative/location/{UserTrackingState.java → TrackUserLocationState.java} +1 -1
  37. package/android/src/main/java/org/maplibre/reactnative/location/UserLocation.java +1 -1
  38. package/android/src/main/java/org/maplibre/reactnative/modules/MLRNModule.java +1 -49
  39. package/android/src/main/java/org/maplibre/reactnative/utils/ConvertUtils.java +2 -9
  40. package/android/src/main/java/org/maplibre/reactnative/utils/GeoJSONUtils.kt +322 -0
  41. package/android/src/main/java/org/maplibre/reactnative/utils/ReactTagResolver.kt +85 -0
  42. package/ios/MLRNCallout.h +1 -1
  43. package/ios/MLRNEvent.m +3 -1
  44. package/ios/MLRNEventTypes.h +10 -31
  45. package/ios/MLRNEventTypes.m +10 -30
  46. package/ios/MLRNImages.h +1 -1
  47. package/ios/MLRNImages.m +1 -1
  48. package/ios/MLRNLayer.h +1 -1
  49. package/ios/MLRNLayer.m +2 -2
  50. package/ios/MLRNLight.h +2 -1
  51. package/ios/MLRNLocationModule.m +2 -2
  52. package/ios/MLRNMapTouchEvent.h +2 -1
  53. package/ios/MLRNMapTouchEvent.m +12 -10
  54. package/ios/MLRNModule.m +5 -52
  55. package/ios/MLRNNativeUserLocation.m +0 -1
  56. package/ios/MLRNOfflineModule.h +2 -2
  57. package/ios/MLRNOfflineModule.m +9 -9
  58. package/ios/MLRNPointAnnotation.h +1 -1
  59. package/ios/MLRNShapeSource.h +1 -1
  60. package/ios/MLRNSource.h +3 -1
  61. package/ios/MLRNStyle.m +20 -20
  62. package/ios/MLRNUtils.h +17 -2
  63. package/ios/MLRNUtils.m +25 -2
  64. package/ios/components/camera/CameraEasing.h +8 -0
  65. package/ios/{CameraStop.h → components/camera/CameraStop.h} +10 -6
  66. package/ios/components/camera/CameraStop.m +75 -0
  67. package/ios/{CameraUpdateItem.m → components/camera/CameraUpdateItem.m} +45 -46
  68. package/ios/components/camera/MLRNCamera.h +26 -0
  69. package/ios/components/camera/MLRNCamera.m +195 -0
  70. package/ios/components/camera/MLRNCameraComponentView.h +18 -0
  71. package/ios/components/camera/MLRNCameraComponentView.mm +192 -0
  72. package/ios/components/camera/MLRNCameraManager.h +11 -0
  73. package/ios/components/camera/MLRNCameraManager.m +20 -0
  74. package/ios/components/camera/MLRNCameraModule.h +4 -0
  75. package/ios/components/camera/MLRNCameraModule.mm +111 -0
  76. package/ios/{MLRNMapView.h → components/map-view/MLRNMapView.h} +42 -20
  77. package/ios/components/map-view/MLRNMapView.m +809 -0
  78. package/ios/components/map-view/MLRNMapViewComponentView.h +18 -0
  79. package/ios/components/map-view/MLRNMapViewComponentView.mm +400 -0
  80. package/ios/components/map-view/MLRNMapViewManager.h +70 -0
  81. package/ios/components/map-view/MLRNMapViewManager.m +163 -0
  82. package/ios/components/map-view/MLRNMapViewModule.h +4 -0
  83. package/ios/components/map-view/MLRNMapViewModule.mm +249 -0
  84. package/ios/{MLRNSnapshotModule → modules/snapshot}/MLRNSnapshotModule.mm +0 -1
  85. package/lib/commonjs/MLRNModule.js +1 -3
  86. package/lib/commonjs/MLRNModule.js.map +1 -1
  87. package/lib/commonjs/components/Annotation.js +1 -13
  88. package/lib/commonjs/components/Annotation.js.map +1 -1
  89. package/lib/commonjs/components/Images.js.map +1 -1
  90. package/lib/commonjs/components/ShapeSource.js +2 -21
  91. package/lib/commonjs/components/ShapeSource.js.map +1 -1
  92. package/lib/commonjs/components/VectorSource.js +3 -26
  93. package/lib/commonjs/components/VectorSource.js.map +1 -1
  94. package/lib/commonjs/components/camera/Camera.js +97 -0
  95. package/lib/commonjs/components/camera/Camera.js.map +1 -0
  96. package/lib/commonjs/components/camera/CameraNativeComponent.ts +61 -0
  97. package/lib/commonjs/components/camera/NativeCameraModule.js +11 -0
  98. package/lib/commonjs/components/camera/NativeCameraModule.js.map +1 -0
  99. package/lib/commonjs/components/map-view/MapView.js +115 -0
  100. package/lib/commonjs/components/map-view/MapView.js.map +1 -0
  101. package/lib/commonjs/components/map-view/MapViewNativeComponent.ts +96 -0
  102. package/lib/commonjs/components/map-view/NativeMapViewModule.js +9 -0
  103. package/lib/commonjs/components/map-view/NativeMapViewModule.js.map +1 -0
  104. package/lib/commonjs/index.js +246 -4
  105. package/lib/commonjs/index.js.map +1 -1
  106. package/lib/commonjs/modules/snapshot/NativeSnapshotModule.js +2 -2
  107. package/lib/commonjs/modules/snapshot/NativeSnapshotModule.js.map +1 -1
  108. package/lib/commonjs/modules/snapshot/SnapshotManager.js +3 -2
  109. package/lib/commonjs/modules/snapshot/SnapshotManager.js.map +1 -1
  110. package/lib/commonjs/types/Bounds.js +2 -0
  111. package/lib/commonjs/types/{OnPressEvent.js.map → Bounds.js.map} +1 -1
  112. package/lib/commonjs/types/PressEvent.js +2 -0
  113. package/lib/{module/types/OnPressEvent.js.map → commonjs/types/PressEvent.js.map} +1 -1
  114. package/lib/commonjs/types/ViewPadding.js +2 -0
  115. package/lib/commonjs/types/{MapLibreRNEvent.js.map → ViewPadding.js.map} +1 -1
  116. package/lib/commonjs/types/codegen/UnsafeMixed.js +2 -0
  117. package/lib/commonjs/types/codegen/UnsafeMixed.js.map +1 -0
  118. package/lib/commonjs/utils/index.js +0 -11
  119. package/lib/commonjs/utils/index.js.map +1 -1
  120. package/lib/module/MLRNModule.js +0 -1
  121. package/lib/module/MLRNModule.js.map +1 -1
  122. package/lib/module/components/Annotation.js +2 -14
  123. package/lib/module/components/Annotation.js.map +1 -1
  124. package/lib/module/components/Images.js.map +1 -1
  125. package/lib/module/components/ShapeSource.js +3 -22
  126. package/lib/module/components/ShapeSource.js.map +1 -1
  127. package/lib/module/components/VectorSource.js +4 -27
  128. package/lib/module/components/VectorSource.js.map +1 -1
  129. package/lib/module/components/camera/Camera.js +92 -0
  130. package/lib/module/components/camera/Camera.js.map +1 -0
  131. package/lib/module/components/camera/CameraNativeComponent.ts +61 -0
  132. package/lib/module/components/camera/NativeCameraModule.js +10 -0
  133. package/lib/module/components/camera/NativeCameraModule.js.map +1 -0
  134. package/lib/module/components/map-view/MapView.js +110 -0
  135. package/lib/module/components/map-view/MapView.js.map +1 -0
  136. package/lib/module/components/map-view/MapViewNativeComponent.ts +96 -0
  137. package/lib/module/components/map-view/NativeMapViewModule.js +5 -0
  138. package/lib/module/components/map-view/NativeMapViewModule.js.map +1 -0
  139. package/lib/module/index.js +30 -1
  140. package/lib/module/index.js.map +1 -1
  141. package/lib/module/modules/snapshot/NativeSnapshotModule.js +1 -1
  142. package/lib/module/modules/snapshot/NativeSnapshotModule.js.map +1 -1
  143. package/lib/module/modules/snapshot/SnapshotManager.js +1 -1
  144. package/lib/module/modules/snapshot/SnapshotManager.js.map +1 -1
  145. package/lib/module/types/Bounds.js +2 -0
  146. package/lib/module/types/{MapLibreRNEvent.js.map → Bounds.js.map} +1 -1
  147. package/lib/module/types/PressEvent.js +2 -0
  148. package/lib/module/types/PressEvent.js.map +1 -0
  149. package/lib/module/types/ViewPadding.js +2 -0
  150. package/lib/module/types/ViewPadding.js.map +1 -0
  151. package/lib/module/types/codegen/UnsafeMixed.js +2 -0
  152. package/lib/module/types/codegen/UnsafeMixed.js.map +1 -0
  153. package/lib/module/utils/index.js +0 -9
  154. package/lib/module/utils/index.js.map +1 -1
  155. package/lib/typescript/commonjs/src/MLRNModule.d.ts +1 -7
  156. package/lib/typescript/commonjs/src/MLRNModule.d.ts.map +1 -1
  157. package/lib/typescript/commonjs/src/components/Annotation.d.ts +3 -3
  158. package/lib/typescript/commonjs/src/components/Annotation.d.ts.map +1 -1
  159. package/lib/typescript/commonjs/src/components/Images.d.ts +1 -2
  160. package/lib/typescript/commonjs/src/components/Images.d.ts.map +1 -1
  161. package/lib/typescript/commonjs/src/components/ShapeSource.d.ts +2 -5
  162. package/lib/typescript/commonjs/src/components/ShapeSource.d.ts.map +1 -1
  163. package/lib/typescript/commonjs/src/components/VectorSource.d.ts +3 -2
  164. package/lib/typescript/commonjs/src/components/VectorSource.d.ts.map +1 -1
  165. package/lib/typescript/commonjs/src/components/camera/Camera.d.ts +180 -0
  166. package/lib/typescript/commonjs/src/components/camera/Camera.d.ts.map +1 -0
  167. package/lib/typescript/commonjs/src/components/camera/CameraNativeComponent.d.ts +37 -0
  168. package/lib/typescript/commonjs/src/components/camera/CameraNativeComponent.d.ts.map +1 -0
  169. package/lib/typescript/commonjs/src/components/camera/NativeCameraModule.d.ts +27 -0
  170. package/lib/typescript/commonjs/src/components/camera/NativeCameraModule.d.ts.map +1 -0
  171. package/lib/typescript/commonjs/src/components/map-view/MapView.d.ts +323 -0
  172. package/lib/typescript/commonjs/src/components/map-view/MapView.d.ts.map +1 -0
  173. package/lib/typescript/commonjs/src/components/map-view/MapViewNativeComponent.d.ts +69 -0
  174. package/lib/typescript/commonjs/src/components/map-view/MapViewNativeComponent.d.ts.map +1 -0
  175. package/lib/typescript/commonjs/src/components/map-view/NativeMapViewModule.d.ts +45 -0
  176. package/lib/typescript/commonjs/src/components/map-view/NativeMapViewModule.d.ts.map +1 -0
  177. package/lib/typescript/commonjs/src/index.d.ts +41 -1
  178. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  179. package/lib/typescript/commonjs/src/modules/snapshot/NativeSnapshotModule.d.ts +2 -1
  180. package/lib/typescript/commonjs/src/modules/snapshot/NativeSnapshotModule.d.ts.map +1 -1
  181. package/lib/typescript/commonjs/src/types/Bounds.d.ts +2 -0
  182. package/lib/typescript/commonjs/src/types/Bounds.d.ts.map +1 -0
  183. package/lib/typescript/commonjs/src/types/PressEvent.d.ts +16 -0
  184. package/lib/typescript/commonjs/src/types/PressEvent.d.ts.map +1 -0
  185. package/lib/typescript/commonjs/src/types/ViewPadding.d.ts +7 -0
  186. package/lib/typescript/commonjs/src/types/ViewPadding.d.ts.map +1 -0
  187. package/lib/typescript/commonjs/src/types/codegen/UnsafeMixed.d.ts +10 -0
  188. package/lib/typescript/commonjs/src/types/codegen/UnsafeMixed.d.ts.map +1 -0
  189. package/lib/typescript/commonjs/src/utils/index.d.ts +1 -3
  190. package/lib/typescript/commonjs/src/utils/index.d.ts.map +1 -1
  191. package/lib/typescript/module/src/MLRNModule.d.ts +1 -7
  192. package/lib/typescript/module/src/MLRNModule.d.ts.map +1 -1
  193. package/lib/typescript/module/src/components/Annotation.d.ts +3 -3
  194. package/lib/typescript/module/src/components/Annotation.d.ts.map +1 -1
  195. package/lib/typescript/module/src/components/Images.d.ts +1 -2
  196. package/lib/typescript/module/src/components/Images.d.ts.map +1 -1
  197. package/lib/typescript/module/src/components/ShapeSource.d.ts +2 -5
  198. package/lib/typescript/module/src/components/ShapeSource.d.ts.map +1 -1
  199. package/lib/typescript/module/src/components/VectorSource.d.ts +3 -2
  200. package/lib/typescript/module/src/components/VectorSource.d.ts.map +1 -1
  201. package/lib/typescript/module/src/components/camera/Camera.d.ts +180 -0
  202. package/lib/typescript/module/src/components/camera/Camera.d.ts.map +1 -0
  203. package/lib/typescript/module/src/components/camera/CameraNativeComponent.d.ts +37 -0
  204. package/lib/typescript/module/src/components/camera/CameraNativeComponent.d.ts.map +1 -0
  205. package/lib/typescript/module/src/components/camera/NativeCameraModule.d.ts +27 -0
  206. package/lib/typescript/module/src/components/camera/NativeCameraModule.d.ts.map +1 -0
  207. package/lib/typescript/module/src/components/map-view/MapView.d.ts +323 -0
  208. package/lib/typescript/module/src/components/map-view/MapView.d.ts.map +1 -0
  209. package/lib/typescript/module/src/components/map-view/MapViewNativeComponent.d.ts +69 -0
  210. package/lib/typescript/module/src/components/map-view/MapViewNativeComponent.d.ts.map +1 -0
  211. package/lib/typescript/module/src/components/map-view/NativeMapViewModule.d.ts +45 -0
  212. package/lib/typescript/module/src/components/map-view/NativeMapViewModule.d.ts.map +1 -0
  213. package/lib/typescript/module/src/index.d.ts +41 -1
  214. package/lib/typescript/module/src/index.d.ts.map +1 -1
  215. package/lib/typescript/module/src/modules/snapshot/NativeSnapshotModule.d.ts +2 -1
  216. package/lib/typescript/module/src/modules/snapshot/NativeSnapshotModule.d.ts.map +1 -1
  217. package/lib/typescript/module/src/types/Bounds.d.ts +2 -0
  218. package/lib/typescript/module/src/types/Bounds.d.ts.map +1 -0
  219. package/lib/typescript/module/src/types/PressEvent.d.ts +16 -0
  220. package/lib/typescript/module/src/types/PressEvent.d.ts.map +1 -0
  221. package/lib/typescript/module/src/types/ViewPadding.d.ts +7 -0
  222. package/lib/typescript/module/src/types/ViewPadding.d.ts.map +1 -0
  223. package/lib/typescript/module/src/types/codegen/UnsafeMixed.d.ts +10 -0
  224. package/lib/typescript/module/src/types/codegen/UnsafeMixed.d.ts.map +1 -0
  225. package/lib/typescript/module/src/utils/index.d.ts +1 -3
  226. package/lib/typescript/module/src/utils/index.d.ts.map +1 -1
  227. package/package.json +38 -28
  228. package/src/MLRNModule.ts +0 -10
  229. package/src/components/Annotation.tsx +8 -23
  230. package/src/components/Images.tsx +2 -4
  231. package/src/components/ShapeSource.tsx +18 -31
  232. package/src/components/VectorSource.tsx +5 -28
  233. package/src/components/camera/Camera.tsx +311 -0
  234. package/src/components/camera/CameraNativeComponent.ts +61 -0
  235. package/src/components/camera/NativeCameraModule.ts +39 -0
  236. package/src/components/map-view/MapView.tsx +582 -0
  237. package/src/components/map-view/MapViewNativeComponent.ts +96 -0
  238. package/src/components/map-view/NativeMapViewModule.ts +83 -0
  239. package/src/index.ts +86 -1
  240. package/src/modules/snapshot/NativeSnapshotModule.ts +1 -2
  241. package/src/modules/snapshot/SnapshotManager.ts +1 -1
  242. package/src/types/Bounds.ts +1 -0
  243. package/src/types/PressEvent.ts +19 -0
  244. package/src/types/ViewPadding.ts +6 -0
  245. package/src/types/codegen/UnsafeMixed.ts +9 -0
  246. package/src/utils/index.ts +1 -14
  247. package/android/src/main/java/org/maplibre/reactnative/components/AbstractEvent.java +0 -35
  248. package/android/src/main/java/org/maplibre/reactnative/components/AbstractEventEmitter.java +0 -80
  249. package/android/src/main/java/org/maplibre/reactnative/components/camera/CameraStop.java +0 -245
  250. package/android/src/main/java/org/maplibre/reactnative/components/camera/CameraUpdateItem.java +0 -121
  251. package/android/src/main/java/org/maplibre/reactnative/components/camera/CameraUpdateQueue.java +0 -68
  252. package/android/src/main/java/org/maplibre/reactnative/components/camera/MLRNCamera.java +0 -519
  253. package/android/src/main/java/org/maplibre/reactnative/components/camera/MLRNCameraManager.java +0 -101
  254. package/android/src/main/java/org/maplibre/reactnative/components/camera/constants/CameraMode.java +0 -18
  255. package/android/src/main/java/org/maplibre/reactnative/components/mapview/LayerSourceInfo.java +0 -59
  256. package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNAndroidTextureMapView.java +0 -13
  257. package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNAndroidTextureMapViewManager.java +0 -27
  258. package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapView.java +0 -1521
  259. package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapViewManager.java +0 -342
  260. package/android/src/main/java/org/maplibre/reactnative/components/mapview/helpers/CameraChangeTracker.java +0 -37
  261. package/android/src/main/java/org/maplibre/reactnative/events/MapChangeEvent.java +0 -43
  262. package/android/src/main/java/org/maplibre/reactnative/events/MapUserTrackingModeEvent.java +0 -32
  263. package/android/src/main/java/org/maplibre/reactnative/location/UserLocationVerticalAlignment.java +0 -7
  264. package/android/src/main/java/org/maplibre/reactnative/location/UserTrackingMode.java +0 -59
  265. package/android/src/main/java/org/maplibre/reactnative/utils/GeoJSONUtils.java +0 -310
  266. package/ios/CameraMode.h +0 -10
  267. package/ios/CameraMode.m +0 -10
  268. package/ios/CameraStop.m +0 -73
  269. package/ios/MLRNCamera.h +0 -29
  270. package/ios/MLRNCamera.m +0 -236
  271. package/ios/MLRNCameraManager.h +0 -5
  272. package/ios/MLRNCameraManager.m +0 -39
  273. package/ios/MLRNMapView.m +0 -497
  274. package/ios/MLRNMapViewManager.h +0 -9
  275. package/ios/MLRNMapViewManager.m +0 -604
  276. package/lib/commonjs/MapLibreRN.js +0 -266
  277. package/lib/commonjs/MapLibreRN.js.map +0 -1
  278. package/lib/commonjs/components/Camera.js +0 -333
  279. package/lib/commonjs/components/Camera.js.map +0 -1
  280. package/lib/commonjs/components/MapView.js +0 -449
  281. package/lib/commonjs/components/MapView.js.map +0 -1
  282. package/lib/commonjs/hooks/useNativeRef.js +0 -14
  283. package/lib/commonjs/hooks/useNativeRef.js.map +0 -1
  284. package/lib/commonjs/types/CameraMode.js +0 -14
  285. package/lib/commonjs/types/CameraMode.js.map +0 -1
  286. package/lib/commonjs/types/MapLibreRNEvent.js +0 -6
  287. package/lib/commonjs/types/OnPressEvent.js +0 -2
  288. package/lib/module/MapLibreRN.js +0 -33
  289. package/lib/module/MapLibreRN.js.map +0 -1
  290. package/lib/module/components/Camera.js +0 -328
  291. package/lib/module/components/Camera.js.map +0 -1
  292. package/lib/module/components/MapView.js +0 -444
  293. package/lib/module/components/MapView.js.map +0 -1
  294. package/lib/module/hooks/useNativeRef.js +0 -10
  295. package/lib/module/hooks/useNativeRef.js.map +0 -1
  296. package/lib/module/types/CameraMode.js +0 -10
  297. package/lib/module/types/CameraMode.js.map +0 -1
  298. package/lib/module/types/MapLibreRNEvent.js +0 -4
  299. package/lib/module/types/OnPressEvent.js +0 -2
  300. package/lib/typescript/commonjs/src/MapLibreRN.d.ts +0 -41
  301. package/lib/typescript/commonjs/src/MapLibreRN.d.ts.map +0 -1
  302. package/lib/typescript/commonjs/src/components/Camera.d.ts +0 -134
  303. package/lib/typescript/commonjs/src/components/Camera.d.ts.map +0 -1
  304. package/lib/typescript/commonjs/src/components/MapView.d.ts +0 -223
  305. package/lib/typescript/commonjs/src/components/MapView.d.ts.map +0 -1
  306. package/lib/typescript/commonjs/src/hooks/useNativeRef.d.ts +0 -8
  307. package/lib/typescript/commonjs/src/hooks/useNativeRef.d.ts.map +0 -1
  308. package/lib/typescript/commonjs/src/types/CameraMode.d.ts +0 -7
  309. package/lib/typescript/commonjs/src/types/CameraMode.d.ts.map +0 -1
  310. package/lib/typescript/commonjs/src/types/MapLibreRNEvent.d.ts +0 -6
  311. package/lib/typescript/commonjs/src/types/MapLibreRNEvent.d.ts.map +0 -1
  312. package/lib/typescript/commonjs/src/types/OnPressEvent.d.ts +0 -12
  313. package/lib/typescript/commonjs/src/types/OnPressEvent.d.ts.map +0 -1
  314. package/lib/typescript/module/src/MapLibreRN.d.ts +0 -41
  315. package/lib/typescript/module/src/MapLibreRN.d.ts.map +0 -1
  316. package/lib/typescript/module/src/components/Camera.d.ts +0 -134
  317. package/lib/typescript/module/src/components/Camera.d.ts.map +0 -1
  318. package/lib/typescript/module/src/components/MapView.d.ts +0 -223
  319. package/lib/typescript/module/src/components/MapView.d.ts.map +0 -1
  320. package/lib/typescript/module/src/hooks/useNativeRef.d.ts +0 -8
  321. package/lib/typescript/module/src/hooks/useNativeRef.d.ts.map +0 -1
  322. package/lib/typescript/module/src/types/CameraMode.d.ts +0 -7
  323. package/lib/typescript/module/src/types/CameraMode.d.ts.map +0 -1
  324. package/lib/typescript/module/src/types/MapLibreRNEvent.d.ts +0 -6
  325. package/lib/typescript/module/src/types/MapLibreRNEvent.d.ts.map +0 -1
  326. package/lib/typescript/module/src/types/OnPressEvent.d.ts +0 -12
  327. package/lib/typescript/module/src/types/OnPressEvent.d.ts.map +0 -1
  328. package/src/MapLibreRN.ts +0 -75
  329. package/src/components/Camera.tsx +0 -568
  330. package/src/components/MapView.tsx +0 -838
  331. package/src/hooks/useNativeRef.ts +0 -14
  332. package/src/types/CameraMode.ts +0 -6
  333. package/src/types/MapLibreRNEvent.ts +0 -7
  334. package/src/types/OnPressEvent.ts +0 -11
  335. /package/ios/{CameraUpdateItem.h → components/camera/CameraUpdateItem.h} +0 -0
  336. /package/ios/{CameraUpdateQueue.h → components/camera/CameraUpdateQueue.h} +0 -0
  337. /package/ios/{CameraUpdateQueue.m → components/camera/CameraUpdateQueue.m} +0 -0
  338. /package/ios/{MLRNSnapshotModule → modules/snapshot}/MLRNSnapshotModule.h +0 -0
@@ -2,40 +2,20 @@
2
2
 
3
3
  @implementation MLRNEventTypes
4
4
 
5
- NSString *const RCT_MAPBOX_EVENT_TAP = @"press";
6
- NSString *const RCT_MAPBOX_EVENT_LONGPRESS = @"longpress";
5
+ NSString *const RCT_MLRN_PRESS = @"Press";
6
+ NSString *const RCT_MLRN_LONG_PRESS = @"LongPress";
7
7
 
8
- NSString *const RCT_MAPBOX_USER_TRACKING_MODE_CHANGE = @"usertrackingmodechange";
8
+ NSString *const RCT_MLRN_ANNOTATION_TAP = @"AnnotationTap";
9
9
 
10
- NSString *const RCT_MAPBOX_REGION_WILL_CHANGE_EVENT = @"regionwillchange";
11
- NSString *const RCT_MAPBOX_REGION_IS_CHANGING = @"regionischanging";
12
- NSString *const RCT_MAPBOX_REGION_DID_CHANGE = @"regiondidchange";
10
+ NSString *const RCT_MLRN_OFFLINE_PROGRESS = @"OfflineProgress";
11
+ NSString *const RCT_MLRN_OFFLINE_ERROR = @"OfflineError";
12
+ NSString *const RCT_MLRN_OFFLINE_TILE_LIMIT = @"OfflineTileLimit";
13
13
 
14
- NSString *const RCT_MAPBOX_WILL_START_LOADING_MAP = @"willstartloadingmap";
15
- NSString *const RCT_MAPBOX_DID_FINISH_LOADING_MAP = @"didfinishloadingmap";
16
- NSString *const RCT_MAPBOX_DID_FAIL_LOADING_MAP = @"didfailoadingmap";
14
+ NSString *const RCT_MLRN_SHAPE_SOURCE_LAYER_PRESS = @"ShapeSourceLayerPress";
15
+ NSString *const RCT_MLRN_VECTOR_SOURCE_LAYER_PRESS = @"VectorSourceLayerPress";
17
16
 
18
- NSString *const RCT_MAPBOX_WILL_START_RENDERING_FRAME = @"willstartrenderingframe";
19
- NSString *const RCT_MAPBOX_DID_FINSIH_RENDERING_FRAME = @"didfinishrenderingframe";
20
- NSString *const RCT_MAPBOX_DID_FINISH_RENDERING_FRAME_FULLY = @"didfinishrenderingframefully";
17
+ NSString *const RCT_MLRN_MISSING_IMAGE = @"MissingImage";
21
18
 
22
- NSString *const RCT_MAPBOX_WILL_START_RENDERING_MAP = @"willstartrenderingmap";
23
- NSString *const RCT_MAPBOX_DID_FINISH_RENDERING_MAP = @"didfinishrenderingmap";
24
- NSString *const RCT_MAPBOX_DID_FINISH_RENDERING_MAP_FULLY = @"didfinishrenderingmapfully";
25
-
26
- NSString *const RCT_MAPBOX_DID_FINISH_LOADING_STYLE = @"didfinishloadingstyle";
27
-
28
- NSString *const RCT_MAPBOX_ANNOTATION_TAP = @"annotationtap";
29
-
30
- NSString *const RCT_MAPBOX_OFFLINE_PROGRESS = @"offlinestatus";
31
- NSString *const RCT_MAPBOX_OFFLINE_ERROR = @"offlineerror";
32
- NSString *const RCT_MAPBOX_OFFLINE_TILE_LIMIT = @"offlinetilelimit";
33
-
34
- NSString *const RCT_MAPBOX_SHAPE_SOURCE_LAYER_PRESS = @"shapesourcelayerpress";
35
- NSString *const RCT_MAPBOX_VECTOR_SOURCE_LAYER_PRESS = @"vectorsourcelayerpress";
36
-
37
- NSString *const RCT_MAPBOX_IMAGES_MISSING_IMAGE = @"imagesmissingimage";
38
-
39
- NSString *const RCT_MAPBOX_USER_LOCATION_UPDATE = @"MapboxUserLocationUpdate";
19
+ NSString *const RCT_MLRN_USER_LOCATION_UPDATE = @"UserLocationUpdate";
40
20
 
41
21
  @end
package/ios/MLRNImages.h CHANGED
@@ -2,7 +2,7 @@
2
2
  #import <React/RCTComponent.h>
3
3
  #import <UIKit/UIKit.h>
4
4
 
5
- @import MapLibre;
5
+ #import <MapLibre/MapLibre.h>
6
6
 
7
7
  @class MLRNMapView;
8
8
 
package/ios/MLRNImages.m CHANGED
@@ -57,7 +57,7 @@ static UIImage *_placeHolderImage;
57
57
 
58
58
  - (void)sendImageMissingEvent:(NSString *)imageName {
59
59
  NSDictionary *payload = @{@"imageKey" : imageName};
60
- MLRNEvent *event = [MLRNEvent makeEvent:RCT_MAPBOX_IMAGES_MISSING_IMAGE withPayload:payload];
60
+ MLRNEvent *event = [MLRNEvent makeEvent:RCT_MLRN_MISSING_IMAGE withPayload:payload];
61
61
  if (_onImageMissing) {
62
62
  _onImageMissing([event toJSON]);
63
63
  }
package/ios/MLRNLayer.h CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  @class MLRNMapView;
5
5
 
6
- @import MapLibre;
6
+ #import <MapLibre/MapLibre.h>
7
7
 
8
8
  @interface MLRNLayer<T> : UIView
9
9
 
package/ios/MLRNLayer.m CHANGED
@@ -173,7 +173,7 @@
173
173
  }
174
174
 
175
175
  - (void)insertAbove:(NSString *)aboveLayerIDs {
176
- [_map waitForLayerWithID:aboveLayerIDs
176
+ [_map waitForLayerWithId:aboveLayerIDs
177
177
  then:^void(MLNStyleLayer *layer) {
178
178
  if (![self _hasInitialized]) {
179
179
  return;
@@ -184,7 +184,7 @@
184
184
  }
185
185
 
186
186
  - (void)insertBelow:(NSString *)belowLayerID {
187
- [_map waitForLayerWithID:belowLayerID
187
+ [_map waitForLayerWithId:belowLayerID
188
188
  then:^void(MLNStyleLayer *layer) {
189
189
  if (![self _hasInitialized]) {
190
190
  return;
package/ios/MLRNLight.h CHANGED
@@ -1,5 +1,6 @@
1
1
  #import <UIKit/UIKit.h>
2
- @import MapLibre;
2
+
3
+ #import <MapLibre/MapLibre.h>
3
4
 
4
5
  @interface MLRNLight : UIView
5
6
 
@@ -39,7 +39,7 @@ RCT_EXPORT_MODULE();
39
39
  }
40
40
 
41
41
  - (NSArray<NSString *> *)supportedEvents {
42
- return @[ RCT_MAPBOX_USER_LOCATION_UPDATE ];
42
+ return @[ RCT_MLRN_USER_LOCATION_UPDATE ];
43
43
  }
44
44
 
45
45
  RCT_EXPORT_METHOD(start : (CLLocationDistance)minDisplacement) {
@@ -70,7 +70,7 @@ RCT_EXPORT_METHOD(getLastKnownLocation : (RCTPromiseResolveBlock)
70
70
  return;
71
71
  }
72
72
 
73
- [self sendEventWithName:RCT_MAPBOX_USER_LOCATION_UPDATE body:[location toJSON]];
73
+ [self sendEventWithName:RCT_MLRN_USER_LOCATION_UPDATE body:[location toJSON]];
74
74
  }
75
75
 
76
76
  @end
@@ -1,7 +1,8 @@
1
1
  #import <Foundation/Foundation.h>
2
2
  #import "MLRNEvent.h"
3
3
  #import "MLRNPointAnnotation.h"
4
- @import MapLibre;
4
+
5
+ #import <MapLibre/MapLibre.h>
5
6
 
6
7
  @interface MLRNMapTouchEvent : MLRNEvent
7
8
 
@@ -10,32 +10,34 @@
10
10
  feature.coordinate = _coordinate;
11
11
  if (_id == nil) {
12
12
  feature.attributes = @{
13
- @"screenPointX" : [NSNumber numberWithDouble:_screenPoint.x],
14
- @"screenPointY" : [NSNumber numberWithDouble:_screenPoint.y]
13
+ @"longitude" : [NSNumber numberWithDouble:_coordinate.longitude],
14
+ @"latitude" : [NSNumber numberWithDouble:_coordinate.latitude],
15
+ @"locationX" : [NSNumber numberWithDouble:_screenPoint.x],
16
+ @"locationY" : [NSNumber numberWithDouble:_screenPoint.y]
15
17
  };
16
18
  } else {
17
19
  feature.attributes = @{
18
20
  @"id" : _id,
19
- @"screenPointX" : [NSNumber numberWithDouble:_screenPoint.x],
20
- @"screenPointY" : [NSNumber numberWithDouble:_screenPoint.y]
21
+ @"longitude" : [NSNumber numberWithDouble:_coordinate.longitude],
22
+ @"latitude" : [NSNumber numberWithDouble:_coordinate.latitude],
23
+ @"locationX" : [NSNumber numberWithDouble:_screenPoint.x],
24
+ @"locationY" : [NSNumber numberWithDouble:_screenPoint.y]
21
25
  };
22
26
  }
23
27
  return [feature geoJSONDictionary];
24
28
  }
25
29
 
26
30
  + (MLRNMapTouchEvent *)makeTapEvent:(MLNMapView *)mapView withPoint:(CGPoint)point {
27
- return [MLRNMapTouchEvent _fromPoint:point withMapView:mapView andEventType:RCT_MAPBOX_EVENT_TAP];
31
+ return [MLRNMapTouchEvent _fromPoint:point withMapView:mapView andEventType:RCT_MLRN_PRESS];
28
32
  }
29
33
 
30
34
  + (MLRNMapTouchEvent *)makeLongPressEvent:(MLNMapView *)mapView withPoint:(CGPoint)point {
31
- return [MLRNMapTouchEvent _fromPoint:point
32
- withMapView:mapView
33
- andEventType:RCT_MAPBOX_EVENT_LONGPRESS];
35
+ return [MLRNMapTouchEvent _fromPoint:point withMapView:mapView andEventType:RCT_MLRN_LONG_PRESS];
34
36
  }
35
37
 
36
38
  + (MLRNMapTouchEvent *)makeAnnotationTapEvent:(MLRNPointAnnotation *)pointAnnotation {
37
39
  MLRNMapTouchEvent *event = [[MLRNMapTouchEvent alloc] init];
38
- event.type = RCT_MAPBOX_ANNOTATION_TAP;
40
+ event.type = RCT_MLRN_ANNOTATION_TAP;
39
41
  event.id = pointAnnotation.id;
40
42
  event.coordinate = pointAnnotation.coordinate;
41
43
  event.screenPoint = [pointAnnotation.superview convertPoint:pointAnnotation.frame.origin
@@ -45,7 +47,7 @@
45
47
 
46
48
  + (MLRNMapTouchEvent *)makeAnnotationTapEventOnDrag:(MLRNPointAnnotation *)pointAnnotation {
47
49
  MLRNMapTouchEvent *event = [[MLRNMapTouchEvent alloc] init];
48
- event.type = RCT_MAPBOX_ANNOTATION_TAP;
50
+ event.type = RCT_MLRN_ANNOTATION_TAP;
49
51
  event.id = pointAnnotation.id;
50
52
  CGPoint screenPoint = [pointAnnotation.superview convertPoint:pointAnnotation.layer.position
51
53
  toView:nil];
package/ios/MLRNModule.m CHANGED
@@ -1,5 +1,4 @@
1
1
  #import "MLRNModule.h"
2
- #import "CameraMode.h"
3
2
  #import "MLRNCustomHeaders.h"
4
3
  #import "MLRNEventTypes.h"
5
4
  #import "MLRNOfflineModule.h"
@@ -21,55 +20,12 @@ RCT_EXPORT_MODULE();
21
20
 
22
21
  // event types
23
22
  NSMutableDictionary *eventTypes = [[NSMutableDictionary alloc] init];
24
- [eventTypes setObject:RCT_MAPBOX_EVENT_TAP forKey:@"MapClick"];
25
- [eventTypes setObject:RCT_MAPBOX_EVENT_LONGPRESS forKey:@"MapLongClick"];
26
- [eventTypes setObject:RCT_MAPBOX_REGION_WILL_CHANGE_EVENT forKey:@"RegionWillChange"];
27
- [eventTypes setObject:RCT_MAPBOX_REGION_IS_CHANGING forKey:@"RegionIsChanging"];
28
- [eventTypes setObject:RCT_MAPBOX_REGION_DID_CHANGE forKey:@"RegionDidChange"];
29
- [eventTypes setObject:RCT_MAPBOX_WILL_START_LOADING_MAP forKey:@"WillStartLoadingMap"];
30
- [eventTypes setObject:RCT_MAPBOX_DID_FINISH_LOADING_MAP forKey:@"DidFinishLoadingMap"];
31
- [eventTypes setObject:RCT_MAPBOX_DID_FAIL_LOADING_MAP forKey:@"DidFailLoadingMap"];
32
- [eventTypes setObject:RCT_MAPBOX_WILL_START_RENDERING_FRAME forKey:@"WillStartRenderingFrame"];
33
- [eventTypes setObject:RCT_MAPBOX_DID_FINSIH_RENDERING_FRAME forKey:@"DidFinishRenderingFrame"];
34
- [eventTypes setObject:RCT_MAPBOX_DID_FINISH_RENDERING_FRAME_FULLY
35
- forKey:@"DidFinishRenderingFrameFully"];
36
- [eventTypes setObject:RCT_MAPBOX_WILL_START_RENDERING_MAP forKey:@"WillStartRenderingMap"];
37
- [eventTypes setObject:RCT_MAPBOX_DID_FINISH_RENDERING_MAP forKey:@"DidFinishRenderingMap"];
38
- [eventTypes setObject:RCT_MAPBOX_DID_FINISH_RENDERING_MAP_FULLY
39
- forKey:@"DidFinishRenderingMapFully"];
40
- [eventTypes setObject:RCT_MAPBOX_DID_FINISH_LOADING_STYLE forKey:@"DidFinishLoadingStyle"];
23
+ [eventTypes setObject:RCT_MLRN_PRESS forKey:@"Press"];
24
+ [eventTypes setObject:RCT_MLRN_LONG_PRESS forKey:@"LongPress"];
41
25
 
42
26
  // location module events
43
27
  NSMutableDictionary *locationModuleEvents = [[NSMutableDictionary alloc] init];
44
- [locationModuleEvents setObject:RCT_MAPBOX_USER_LOCATION_UPDATE forKey:@"Update"];
45
-
46
- // user tracking modes
47
- NSMutableDictionary *userTrackingModes = [[NSMutableDictionary alloc] init];
48
- [userTrackingModes setObject:[NSNumber numberWithInt:MLNUserTrackingModeNone] forKey:@"None"];
49
- [userTrackingModes setObject:[NSNumber numberWithInt:MLNUserTrackingModeFollow] forKey:@"Follow"];
50
- [userTrackingModes setObject:[NSNumber numberWithInt:MLNUserTrackingModeFollowWithHeading]
51
- forKey:@"FollowWithHeading"];
52
- [userTrackingModes setObject:[NSNumber numberWithInt:MLNUserTrackingModeFollowWithCourse]
53
- forKey:@"FollowWithCourse"];
54
-
55
- // user location vertical alignment
56
- NSMutableDictionary *userLocationVerticalAlignment = [[NSMutableDictionary alloc] init];
57
- [userLocationVerticalAlignment
58
- setObject:[NSNumber numberWithInt:MLNAnnotationVerticalAlignmentTop]
59
- forKey:@"Top"];
60
- [userLocationVerticalAlignment
61
- setObject:[NSNumber numberWithInt:MLNAnnotationVerticalAlignmentCenter]
62
- forKey:@"Center"];
63
- [userLocationVerticalAlignment
64
- setObject:[NSNumber numberWithInt:MLNAnnotationVerticalAlignmentBottom]
65
- forKey:@"Bottom"];
66
-
67
- // camera modes
68
- NSMutableDictionary *cameraModes = [[NSMutableDictionary alloc] init];
69
- [cameraModes setObject:[NSNumber numberWithInt:RCT_MAPBOX_CAMERA_MODE_FLIGHT] forKey:@"Flight"];
70
- [cameraModes setObject:[NSNumber numberWithInt:RCT_MAPBOX_CAMERA_MODE_EASE] forKey:@"Ease"];
71
- [cameraModes setObject:[NSNumber numberWithInt:RCT_MAPBOX_CAMERA_MODE_LINEAR] forKey:@"Linear"];
72
- [cameraModes setObject:[NSNumber numberWithInt:RCT_MAPBOX_CAMERA_MODE_NONE] forKey:@"None"];
28
+ [locationModuleEvents setObject:RCT_MLRN_USER_LOCATION_UPDATE forKey:@"Update"];
73
29
 
74
30
  // style sources
75
31
  NSMutableDictionary *styleSourceConsts = [[NSMutableDictionary alloc] init];
@@ -77,8 +33,8 @@ RCT_EXPORT_MODULE();
77
33
 
78
34
  // offline module callback names
79
35
  NSMutableDictionary *offlineModuleCallbackNames = [[NSMutableDictionary alloc] init];
80
- [offlineModuleCallbackNames setObject:RCT_MAPBOX_OFFLINE_CALLBACK_ERROR forKey:@"Error"];
81
- [offlineModuleCallbackNames setObject:RCT_MAPBOX_OFFLINE_CALLBACK_PROGRESS forKey:@"Progress"];
36
+ [offlineModuleCallbackNames setObject:RCT_MLRN_OFFLINE_CALLBACK_ERROR forKey:@"Error"];
37
+ [offlineModuleCallbackNames setObject:RCT_MLRN_OFFLINE_CALLBACK_PROGRESS forKey:@"Progress"];
82
38
 
83
39
  NSMutableDictionary *offlinePackDownloadState = [[NSMutableDictionary alloc] init];
84
40
  [offlinePackDownloadState setObject:@(MLNOfflinePackStateInactive) forKey:@"Inactive"];
@@ -88,9 +44,6 @@ RCT_EXPORT_MODULE();
88
44
  return @{
89
45
  @"StyleURL" : styleURLS,
90
46
  @"EventTypes" : eventTypes,
91
- @"UserTrackingModes" : userTrackingModes,
92
- @"UserLocationVerticalAlignment" : userLocationVerticalAlignment,
93
- @"CameraModes" : cameraModes,
94
47
  @"StyleSource" : styleSourceConsts,
95
48
  @"OfflineCallbackName" : offlineModuleCallbackNames,
96
49
  @"OfflinePackDownloadState" : offlinePackDownloadState,
@@ -1,5 +1,4 @@
1
1
  #import "MLRNNativeUserLocation.h"
2
- #import "CameraMode.h"
3
2
  #import "CameraStop.h"
4
3
  #import "CameraUpdateQueue.h"
5
4
  #import "MLRNEvent.h"
@@ -5,7 +5,7 @@
5
5
 
6
6
  @interface MLRNOfflineModule : RCTEventEmitter <RCTBridgeModule>
7
7
 
8
- extern NSString *const RCT_MAPBOX_OFFLINE_CALLBACK_PROGRESS;
9
- extern NSString *const RCT_MAPBOX_OFFLINE_CALLBACK_ERROR;
8
+ extern NSString *const RCT_MLRN_OFFLINE_CALLBACK_PROGRESS;
9
+ extern NSString *const RCT_MLRN_OFFLINE_CALLBACK_ERROR;
10
10
 
11
11
  @end
@@ -27,8 +27,8 @@ RCT_EXPORT_MODULE()
27
27
  hasListeners = NO;
28
28
  }
29
29
 
30
- NSString *const RCT_MAPBOX_OFFLINE_CALLBACK_PROGRESS = @"MapboxOfflineRegionProgress";
31
- NSString *const RCT_MAPBOX_OFFLINE_CALLBACK_ERROR = @"MapboOfflineRegionError";
30
+ NSString *const RCT_MLRN_OFFLINE_CALLBACK_PROGRESS = @"OfflineRegionProgress";
31
+ NSString *const RCT_MLRN_OFFLINE_CALLBACK_ERROR = @"OfflineRegionError";
32
32
 
33
33
  - (instancetype)init {
34
34
  if (self = [super init]) {
@@ -64,7 +64,7 @@ NSString *const RCT_MAPBOX_OFFLINE_CALLBACK_ERROR = @"MapboOfflineRegionError";
64
64
  }
65
65
 
66
66
  - (NSArray<NSString *> *)supportedEvents {
67
- return @[ RCT_MAPBOX_OFFLINE_CALLBACK_PROGRESS, RCT_MAPBOX_OFFLINE_CALLBACK_ERROR ];
67
+ return @[ RCT_MLRN_OFFLINE_CALLBACK_PROGRESS, RCT_MLRN_OFFLINE_CALLBACK_ERROR ];
68
68
  }
69
69
 
70
70
  - (void)observeValueForKeyPath:(NSString *)keyPath
@@ -343,7 +343,7 @@ RCT_EXPORT_METHOD(setProgressEventThrottle : (nonnull NSNumber *)throttleValue)
343
343
  if ([self _shouldSendProgressEvent:[self _getCurrentTimestamp] pack:pack]) {
344
344
  NSDictionary *metadata = [self _unarchiveMetadata:pack];
345
345
  MLRNEvent *event = [self _makeProgressEvent:metadata[@"name"] pack:pack];
346
- [self _sendEvent:RCT_MAPBOX_OFFLINE_CALLBACK_PROGRESS event:event];
346
+ [self _sendEvent:RCT_MLRN_OFFLINE_CALLBACK_PROGRESS event:event];
347
347
  lastPackTimestamp = [self _getCurrentTimestamp];
348
348
  }
349
349
 
@@ -361,9 +361,9 @@ RCT_EXPORT_METHOD(setProgressEventThrottle : (nonnull NSNumber *)throttleValue)
361
361
  if (name != nil) {
362
362
  NSError *error = notification.userInfo[MLNOfflinePackUserInfoKeyError];
363
363
  MLRNEvent *event = [self _makeErrorEvent:name
364
- type:RCT_MAPBOX_OFFLINE_ERROR
364
+ type:RCT_MLRN_OFFLINE_ERROR
365
365
  message:error.description];
366
- [self _sendEvent:RCT_MAPBOX_OFFLINE_CALLBACK_ERROR event:event];
366
+ [self _sendEvent:RCT_MLRN_OFFLINE_CALLBACK_ERROR event:event];
367
367
  }
368
368
  }
369
369
 
@@ -374,9 +374,9 @@ RCT_EXPORT_METHOD(setProgressEventThrottle : (nonnull NSNumber *)throttleValue)
374
374
  NSString *name = metadata[@"name"];
375
375
  if (name != nil) {
376
376
  MLRNEvent *event = [self _makeErrorEvent:name
377
- type:RCT_MAPBOX_OFFLINE_ERROR
377
+ type:RCT_MLRN_OFFLINE_ERROR
378
378
  message:@"Mapbox tile limit exceeded"];
379
- [self _sendEvent:RCT_MAPBOX_OFFLINE_CALLBACK_ERROR event:event];
379
+ [self _sendEvent:RCT_MLRN_OFFLINE_CALLBACK_ERROR event:event];
380
380
  }
381
381
  }
382
382
 
@@ -436,7 +436,7 @@ RCT_EXPORT_METHOD(setProgressEventThrottle : (nonnull NSNumber *)throttleValue)
436
436
  }
437
437
 
438
438
  - (MLRNEvent *)_makeProgressEvent:(NSString *)name pack:(MLNOfflinePack *)pack {
439
- return [MLRNEvent makeEvent:RCT_MAPBOX_OFFLINE_PROGRESS
439
+ return [MLRNEvent makeEvent:RCT_MLRN_OFFLINE_PROGRESS
440
440
  withPayload:[self _makeRegionStatusPayload:name pack:pack]];
441
441
  }
442
442
 
@@ -3,7 +3,7 @@
3
3
  #import <UIKit/UIKit.h>
4
4
  #import "MLRNCallout.h"
5
5
 
6
- @import MapLibre;
6
+ #import <MapLibre/MapLibre.h>
7
7
 
8
8
  @interface MLRNPointAnnotation : MLNAnnotationView <MLNAnnotation>
9
9
 
@@ -1,7 +1,7 @@
1
1
  #import <React/RCTBridge.h>
2
2
  #import "MLRNSource.h"
3
3
 
4
- @import MapLibre;
4
+ #import <MapLibre/MapLibre.h>
5
5
 
6
6
  @interface MLRNShapeSource : MLRNSource
7
7
 
package/ios/MLRNSource.h CHANGED
@@ -1,7 +1,9 @@
1
1
  #import <React/RCTComponent.h>
2
2
  #import <UIKit/UIKit.h>
3
+
3
4
  #import "MLRNLayer.h"
4
- @import MapLibre;
5
+
6
+ #import <MapLibre/MapLibre.h>
5
7
 
6
8
  @interface MLRNSource : UIView
7
9
 
package/ios/MLRNStyle.m CHANGED
@@ -18,7 +18,7 @@
18
18
  - (void)fillLayer:(MLNFillStyleLayer *)layer withReactStyle:(NSDictionary *)reactStyle isValid:(BOOL (^)(void)) isValid
19
19
  {
20
20
  if (![self _hasReactStyle:reactStyle]) {
21
- // TODO throw exception
21
+
22
22
  return;
23
23
  }
24
24
 
@@ -70,7 +70,7 @@
70
70
  } else if ([prop isEqualToString:@"fillPatternTransition"]) {
71
71
  [self setFillPatternTransition:layer withReactStyleValue:styleValue];
72
72
  } else {
73
- // TODO throw exception
73
+
74
74
  }
75
75
  }
76
76
  }
@@ -78,7 +78,7 @@
78
78
  - (void)lineLayer:(MLNLineStyleLayer *)layer withReactStyle:(NSDictionary *)reactStyle isValid:(BOOL (^)(void)) isValid
79
79
  {
80
80
  if (![self _hasReactStyle:reactStyle]) {
81
- // TODO throw exception
81
+
82
82
  return;
83
83
  }
84
84
 
@@ -154,7 +154,7 @@
154
154
  } else if ([prop isEqualToString:@"lineGradient"]) {
155
155
  [self setLineGradient:layer withReactStyleValue:styleValue];
156
156
  } else {
157
- // TODO throw exception
157
+
158
158
  }
159
159
  }
160
160
  }
@@ -162,7 +162,7 @@
162
162
  - (void)symbolLayer:(MLNSymbolStyleLayer *)layer withReactStyle:(NSDictionary *)reactStyle isValid:(BOOL (^)(void)) isValid
163
163
  {
164
164
  if (![self _hasReactStyle:reactStyle]) {
165
- // TODO throw exception
165
+
166
166
  return;
167
167
  }
168
168
 
@@ -322,7 +322,7 @@
322
322
  } else if ([prop isEqualToString:@"textTranslateAnchor"]) {
323
323
  [self setTextTranslateAnchor:layer withReactStyleValue:styleValue];
324
324
  } else {
325
- // TODO throw exception
325
+
326
326
  }
327
327
  }
328
328
  }
@@ -330,7 +330,7 @@
330
330
  - (void)circleLayer:(MLNCircleStyleLayer *)layer withReactStyle:(NSDictionary *)reactStyle isValid:(BOOL (^)(void)) isValid
331
331
  {
332
332
  if (![self _hasReactStyle:reactStyle]) {
333
- // TODO throw exception
333
+
334
334
  return;
335
335
  }
336
336
 
@@ -381,7 +381,7 @@
381
381
  } else if ([prop isEqualToString:@"circleStrokeOpacityTransition"]) {
382
382
  [self setCircleStrokeOpacityTransition:layer withReactStyleValue:styleValue];
383
383
  } else {
384
- // TODO throw exception
384
+
385
385
  }
386
386
  }
387
387
  }
@@ -389,7 +389,7 @@
389
389
  - (void)heatmapLayer:(MLNHeatmapStyleLayer *)layer withReactStyle:(NSDictionary *)reactStyle isValid:(BOOL (^)(void)) isValid
390
390
  {
391
391
  if (![self _hasReactStyle:reactStyle]) {
392
- // TODO throw exception
392
+
393
393
  return;
394
394
  }
395
395
 
@@ -416,7 +416,7 @@
416
416
  } else if ([prop isEqualToString:@"heatmapOpacityTransition"]) {
417
417
  [self setHeatmapOpacityTransition:layer withReactStyleValue:styleValue];
418
418
  } else {
419
- // TODO throw exception
419
+
420
420
  }
421
421
  }
422
422
  }
@@ -424,7 +424,7 @@
424
424
  - (void)fillExtrusionLayer:(MLNFillExtrusionStyleLayer *)layer withReactStyle:(NSDictionary *)reactStyle isValid:(BOOL (^)(void)) isValid
425
425
  {
426
426
  if (![self _hasReactStyle:reactStyle]) {
427
- // TODO throw exception
427
+
428
428
  return;
429
429
  }
430
430
 
@@ -478,7 +478,7 @@
478
478
  } else if ([prop isEqualToString:@"fillExtrusionVerticalGradient"]) {
479
479
  [self setFillExtrusionVerticalGradient:layer withReactStyleValue:styleValue];
480
480
  } else {
481
- // TODO throw exception
481
+
482
482
  }
483
483
  }
484
484
  }
@@ -486,7 +486,7 @@
486
486
  - (void)rasterLayer:(MLNRasterStyleLayer *)layer withReactStyle:(NSDictionary *)reactStyle isValid:(BOOL (^)(void)) isValid
487
487
  {
488
488
  if (![self _hasReactStyle:reactStyle]) {
489
- // TODO throw exception
489
+
490
490
  return;
491
491
  }
492
492
 
@@ -525,7 +525,7 @@
525
525
  } else if ([prop isEqualToString:@"rasterFadeDuration"]) {
526
526
  [self setRasterFadeDuration:layer withReactStyleValue:styleValue];
527
527
  } else {
528
- // TODO throw exception
528
+
529
529
  }
530
530
  }
531
531
  }
@@ -533,7 +533,7 @@
533
533
  - (void)hillshadeLayer:(MLNHillshadeStyleLayer *)layer withReactStyle:(NSDictionary *)reactStyle isValid:(BOOL (^)(void)) isValid
534
534
  {
535
535
  if (![self _hasReactStyle:reactStyle]) {
536
- // TODO throw exception
536
+
537
537
  return;
538
538
  }
539
539
 
@@ -564,7 +564,7 @@
564
564
  } else if ([prop isEqualToString:@"hillshadeAccentColorTransition"]) {
565
565
  [self setHillshadeAccentColorTransition:layer withReactStyleValue:styleValue];
566
566
  } else {
567
- // TODO throw exception
567
+
568
568
  }
569
569
  }
570
570
  }
@@ -572,7 +572,7 @@
572
572
  - (void)backgroundLayer:(MLNBackgroundStyleLayer *)layer withReactStyle:(NSDictionary *)reactStyle isValid:(BOOL (^)(void)) isValid
573
573
  {
574
574
  if (![self _hasReactStyle:reactStyle]) {
575
- // TODO throw exception
575
+
576
576
  return;
577
577
  }
578
578
 
@@ -610,7 +610,7 @@
610
610
  } else if ([prop isEqualToString:@"backgroundOpacityTransition"]) {
611
611
  [self setBackgroundOpacityTransition:layer withReactStyleValue:styleValue];
612
612
  } else {
613
- // TODO throw exception
613
+
614
614
  }
615
615
  }
616
616
  }
@@ -618,7 +618,7 @@
618
618
  - (void)lightLayer:(MLNLight *)layer withReactStyle:(NSDictionary *)reactStyle isValid:(BOOL (^)(void)) isValid
619
619
  {
620
620
  if (![self _hasReactStyle:reactStyle]) {
621
- // TODO throw exception
621
+
622
622
  return;
623
623
  }
624
624
 
@@ -641,7 +641,7 @@
641
641
  } else if ([prop isEqualToString:@"intensityTransition"]) {
642
642
  [self setIntensityTransition:layer withReactStyleValue:styleValue];
643
643
  } else {
644
- // TODO throw exception
644
+
645
645
  }
646
646
  }
647
647
  }
package/ios/MLRNUtils.h CHANGED
@@ -1,30 +1,45 @@
1
- #import <MapKit/MapKit.h>
1
+ #import <MapLibre/MapLibre.h>
2
2
  #import <React/RCTBridge.h>
3
3
  #import <React/RCTConvert.h>
4
4
  #import <React/RCTImageLoader.h>
5
- #import <MapLibre/MapLibre.h>
6
5
 
7
6
  @interface MLRNUtils : NSObject
8
7
 
9
8
  + (CLLocationCoordinate2D)fromFeature:(NSString *)json;
9
+
10
+ + (CLLocationCoordinate2D)fromLongitude:(NSNumber *)longitude latitude:(NSNumber *)latitude;
11
+
12
+ + (NSArray<NSDictionary *> *)featuresToJSON:(NSArray<id<MLNFeature>> *)features;
13
+
10
14
  + (MLNShape *)shapeFromGeoJSON:(NSString *)json;
15
+
11
16
  + (MLNCoordinateBounds)fromFeatureCollection:(NSString *)json;
17
+
18
+ + (MLNCoordinateBounds)fromReactBounds:(NSArray<NSNumber *> *)bounds;
19
+
12
20
  + (NSArray<NSNumber *> *)fromCoordinateBounds:(MLNCoordinateBounds)bounds;
21
+
13
22
  + (NSTimeInterval)fromMS:(NSNumber *)number;
14
23
  + (NSNumber *)clamp:(NSNumber *)value min:(NSNumber *)min max:(NSNumber *)max;
24
+
15
25
  + (UIColor *)toColor:(id)value;
26
+
16
27
  + (void)fetchImage:(RCTBridge *)bridge
17
28
  url:(NSString *)url
18
29
  scale:(double)scale
19
30
  sdf:(Boolean)sdf
20
31
  callback:(RCTImageLoaderCompletionBlock)callback;
32
+
21
33
  + (void)fetchImages:(RCTBridge *)bridge
22
34
  style:(MLNStyle *)style
23
35
  objects:(NSDictionary<NSString *, NSString *> *)objects
24
36
  forceUpdate:(BOOL)forceUpdate
25
37
  callback:(void (^)(void))callback;
38
+
26
39
  + (CGVector)toCGVector:(NSArray<NSNumber *> *)arr;
40
+
27
41
  + (UIEdgeInsets)toUIEdgeInsets:(NSArray<NSNumber *> *)arr;
42
+
28
43
  + (NSURL *)styleURLFromStyleJSON:(NSString *)styleJSON;
29
44
 
30
45
  @end
package/ios/MLRNUtils.m CHANGED
@@ -15,6 +15,18 @@ static double const MS_TO_S = 0.001;
15
15
  return feature.coordinate;
16
16
  }
17
17
 
18
+ + (CLLocationCoordinate2D)fromLongitude:(NSNumber *)longitude latitude:(NSNumber *)latitude {
19
+ return CLLocationCoordinate2DMake([latitude doubleValue], [longitude doubleValue]);
20
+ }
21
+
22
+ + (NSArray<NSDictionary *> *)featuresToJSON:(NSArray<id<MLNFeature>> *)features {
23
+ NSMutableArray<NSDictionary *> *json = [[NSMutableArray alloc] init];
24
+ for (id<MLNFeature> feature in features) {
25
+ [json addObject:feature.geoJSONDictionary];
26
+ }
27
+ return json;
28
+ }
29
+
18
30
  + (UIEdgeInsets)toUIEdgeInsets:(NSArray<NSNumber *> *)arr {
19
31
  return UIEdgeInsetsMake([arr[0] floatValue], [arr[1] floatValue], [arr[2] floatValue],
20
32
  [arr[3] floatValue]);
@@ -51,10 +63,21 @@ static double const MS_TO_S = 0.001;
51
63
  return MLNCoordinateBoundsMake(sw, ne);
52
64
  }
53
65
 
66
+ + (MLNCoordinateBounds)fromReactBounds:(NSArray<NSNumber *> *)bounds {
67
+ CLLocationCoordinate2D sw =
68
+ CLLocationCoordinate2DMake([bounds[1] doubleValue], [bounds[0] doubleValue]);
69
+ CLLocationCoordinate2D ne =
70
+ CLLocationCoordinate2DMake([bounds[3] doubleValue], [bounds[2] doubleValue]);
71
+
72
+ return MLNCoordinateBoundsMake(sw, ne);
73
+ }
74
+
54
75
  + (NSArray<NSNumber *> *)fromCoordinateBounds:(MLNCoordinateBounds)bounds {
55
76
  return @[
56
- @[ @(bounds.ne.longitude), @(bounds.ne.latitude) ],
57
- @[ @(bounds.sw.longitude), @(bounds.sw.latitude) ]
77
+ @(bounds.sw.longitude),
78
+ @(bounds.sw.latitude),
79
+ @(bounds.ne.longitude),
80
+ @(bounds.ne.latitude),
58
81
  ];
59
82
  }
60
83
 
@@ -0,0 +1,8 @@
1
+ #import <Foundation/Foundation.h>
2
+
3
+ typedef NS_ENUM(NSInteger, MLRNCameraEasing) {
4
+ MLRNCameraEasingNone = 0,
5
+ MLRNCameraEasingLinear = 1,
6
+ MLRNCameraEasingEase = 2,
7
+ MLRNCameraEasingFly = 3,
8
+ };