react-native-maps 1.21.0-alpha.98 → 1.21.0

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 (230) hide show
  1. package/README.md +9 -4
  2. package/android/build.gradle +65 -72
  3. package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  4. package/android/src/main/RCTAppDependencyProvider.h +25 -0
  5. package/android/src/main/RCTAppDependencyProvider.mm +55 -0
  6. package/android/src/main/RCTModulesConformingToProtocolsProvider.h +18 -0
  7. package/android/src/main/RCTModulesConformingToProtocolsProvider.mm +33 -0
  8. package/android/src/main/RCTThirdPartyComponentsProvider.h +16 -0
  9. package/android/src/main/RCTThirdPartyComponentsProvider.mm +28 -0
  10. package/android/src/main/ReactAppDependencyProvider.podspec +34 -0
  11. package/android/src/main/java/com/facebook/fbreact/specs/NativeAirMapsModuleSpec.java +63 -0
  12. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsCalloutManagerDelegate.java +35 -0
  13. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsCalloutManagerInterface.java +17 -0
  14. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsCircleManagerDelegate.java +49 -0
  15. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsCircleManagerInterface.java +23 -0
  16. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsGooglePolygonManagerDelegate.java +49 -0
  17. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsGooglePolygonManagerInterface.java +23 -0
  18. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerDelegate.java +209 -0
  19. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerInterface.java +74 -0
  20. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsMarkerManagerDelegate.java +104 -0
  21. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsMarkerManagerInterface.java +39 -0
  22. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsOverlayManagerDelegate.java +45 -0
  23. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsOverlayManagerInterface.java +22 -0
  24. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsPolylineManagerDelegate.java +58 -0
  25. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsPolylineManagerInterface.java +26 -0
  26. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsUrlTileManagerDelegate.java +62 -0
  27. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsUrlTileManagerInterface.java +27 -0
  28. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsWMSTileManagerDelegate.java +56 -0
  29. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsWMSTileManagerInterface.java +25 -0
  30. package/android/src/main/java/com/rnmaps/fabric/MapViewManager.java +5 -1
  31. package/android/src/main/java/com/rnmaps/fabric/NativeAirMapsModule.java +1 -1
  32. package/android/src/main/java/com/rnmaps/fabric/OverlayManager.java +9 -3
  33. package/android/src/main/java/com/rnmaps/fabric/UrlTileManager.java +124 -0
  34. package/android/src/main/java/com/rnmaps/fabric/WMSTileManager.java +114 -0
  35. package/android/src/main/java/com/rnmaps/maps/MapAirModulePackage.java +19 -3
  36. package/android/src/main/java/com/rnmaps/maps/MapMarker.java +608 -603
  37. package/android/src/main/java/com/rnmaps/maps/MapMarkerManager.java +3 -3
  38. package/android/src/main/java/com/rnmaps/maps/MapOverlay.java +2 -22
  39. package/android/src/main/java/com/rnmaps/maps/MapOverlayManager.java +23 -1
  40. package/android/src/main/java/com/rnmaps/maps/MapUrlTile.java +18 -18
  41. package/android/src/main/java/com/rnmaps/maps/MapUrlTileManager.java +10 -14
  42. package/android/src/main/java/com/rnmaps/maps/MapView.java +58 -49
  43. package/android/src/main/java/com/rnmaps/maps/MapWMSTile.java +3 -3
  44. package/android/src/main/java/com/rnmaps/maps/MapWMSTileManager.java +10 -10
  45. package/android/src/main/jni/CMakeLists.txt +36 -0
  46. package/android/src/main/jni/RNMapsSpecs-generated.cpp +68 -0
  47. package/android/src/main/jni/RNMapsSpecs.h +31 -0
  48. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.cpp +31 -0
  49. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.h +33 -0
  50. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/EventEmitters.cpp +979 -0
  51. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/EventEmitters.h +860 -0
  52. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/Props.cpp +227 -0
  53. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/Props.h +1297 -0
  54. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/RNMapsSpecsJSI-generated.cpp +74 -0
  55. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/RNMapsSpecsJSI.h +268 -0
  56. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.cpp +26 -0
  57. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.h +131 -0
  58. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/States.cpp +16 -0
  59. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/States.h +137 -0
  60. package/ios/AirGoogleMaps/AIRGoogleMap.h +13 -13
  61. package/ios/AirGoogleMaps/{AIRGoogleMap.m → AIRGoogleMap.mm} +32 -34
  62. package/ios/AirGoogleMaps/AIRGoogleMapManager.h +1 -0
  63. package/ios/AirGoogleMaps/AIRGoogleMapManager.mm +543 -0
  64. package/ios/AirGoogleMaps/AIRGoogleMapMarker.m +3 -3
  65. package/ios/AirGoogleMaps/AIRGoogleMapMarkerManager.m +1 -1
  66. package/ios/AirGoogleMaps/AIRGoogleMapUrlTile.m +2 -2
  67. package/ios/AirGoogleMaps/AIRGoogleMapWMSTile.m +2 -2
  68. package/ios/AirGoogleMaps/RNMapsGoogleMapView.h +5 -2
  69. package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +41 -33
  70. package/ios/AirGoogleMaps/RNMapsGoogleMapViewManager.mm +16 -1
  71. package/ios/AirGoogleMaps/RNMapsGooglePolygonView.mm +23 -14
  72. package/ios/AirGoogleMaps/RNMapsGooglePolygonViewManager.mm +1 -0
  73. package/ios/AirMaps/AIRMap.h +8 -9
  74. package/ios/AirMaps/{AIRMap.m → AIRMap.mm} +18 -14
  75. package/ios/AirMaps/AIRMapManager.m +8 -19
  76. package/ios/AirMaps/AIRMapMarker.m +57 -44
  77. package/ios/AirMaps/AIRMapOverlay.m +2 -2
  78. package/ios/AirMaps/AIRMapWMSTile.m +8 -8
  79. package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMapView.h +25 -0
  80. package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMapView.mm +77 -0
  81. package/ios/AirMaps/FabricPlaceholders/PlaceHolderPolygonView.h +25 -0
  82. package/ios/AirMaps/FabricPlaceholders/PlaceHolderPolygonView.mm +51 -0
  83. package/ios/AirMaps/RNMapsAirModule.h +2 -3
  84. package/ios/AirMaps/RNMapsAirModule.mm +14 -0
  85. package/ios/AirMaps/RNMapsDefines.h +1 -0
  86. package/ios/AirMaps/RNMapsMapView.h +5 -2
  87. package/ios/AirMaps/RNMapsMapView.mm +16 -6
  88. package/ios/AirMaps/RNMapsMapViewManager.mm +19 -1
  89. package/ios/AirMaps/RNMapsMarkerView.mm +12 -4
  90. package/ios/AirMaps/RNMapsMarkerViewManager.mm +7 -0
  91. package/ios/AirMaps/module.modulemap +6 -0
  92. package/ios/AirMaps.xcodeproj/project.pbxproj +15 -55
  93. package/ios/generated/RCTAppDependencyProvider.h +25 -0
  94. package/ios/generated/RCTAppDependencyProvider.mm +55 -0
  95. package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
  96. package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
  97. package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
  98. package/ios/generated/RCTThirdPartyComponentsProvider.mm +26 -0
  99. package/ios/{AirMaps → generated}/RNMapsAirModuleDelegate.h +1 -1
  100. package/ios/generated/RNMapsSpecs/ComponentDescriptors.cpp +29 -0
  101. package/ios/generated/RNMapsSpecs/ComponentDescriptors.h +31 -0
  102. package/ios/generated/RNMapsSpecs/EventEmitters.cpp +977 -0
  103. package/ios/generated/RNMapsSpecs/EventEmitters.h +846 -0
  104. package/ios/generated/RNMapsSpecs/Props.cpp +194 -0
  105. package/ios/generated/RNMapsSpecs/Props.h +1224 -0
  106. package/ios/generated/RNMapsSpecs/RCTComponentViewHelpers.h +591 -0
  107. package/ios/generated/RNMapsSpecs/RNMapsSpecs-generated.mm +92 -0
  108. package/ios/generated/RNMapsSpecs/RNMapsSpecs.h +137 -0
  109. package/ios/generated/RNMapsSpecs/ShadowNodes.cpp +24 -0
  110. package/ios/generated/RNMapsSpecs/ShadowNodes.h +109 -0
  111. package/ios/generated/RNMapsSpecs/States.cpp +16 -0
  112. package/ios/generated/RNMapsSpecs/States.h +113 -0
  113. package/ios/generated/RNMapsSpecsJSI-generated.cpp +74 -0
  114. package/ios/generated/RNMapsSpecsJSI.h +268 -0
  115. package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
  116. package/ios/generated/module.modulemap +15 -0
  117. package/package.json +30 -25
  118. package/react-native-google-maps.podspec +27 -0
  119. package/react-native-maps-generated.podspec +31 -0
  120. package/react-native-maps.podspec +52 -46
  121. package/react-native.config.js +16 -0
  122. package/src/AnimatedRegion.ts +169 -0
  123. package/src/Geojson.tsx +541 -0
  124. package/src/MapCallout.tsx +77 -0
  125. package/src/MapCalloutSubview.tsx +64 -0
  126. package/src/MapCircle.tsx +162 -0
  127. package/src/MapHeatmap.tsx +125 -0
  128. package/src/MapLocalTile.tsx +60 -0
  129. package/src/MapMarker.tsx +531 -0
  130. package/src/MapMarkerNativeComponent.ts +51 -0
  131. package/src/MapOverlay.tsx +178 -0
  132. package/src/MapPolygon.tsx +188 -0
  133. package/src/MapPolygon.types.ts +25 -0
  134. package/src/MapPolyline.tsx +215 -0
  135. package/src/MapUrlTile.tsx +169 -0
  136. package/src/MapView.tsx +1230 -0
  137. package/src/MapView.types.ts +212 -0
  138. package/src/MapView.web.ts +2 -0
  139. package/src/MapViewNativeComponent.ts +86 -0
  140. package/src/MapWMSTile.tsx +148 -0
  141. package/src/ProviderConstants.ts +2 -0
  142. package/src/createFabricMap.tsx +253 -0
  143. package/src/decorateMapComponent.ts +227 -0
  144. package/src/fixImageProp.ts +17 -0
  145. package/src/index.ts +52 -0
  146. package/src/sharedTypes.ts +101 -0
  147. package/{specs → src/specs}/NativeComponentCircle.ts +3 -4
  148. package/{specs → src/specs}/NativeComponentGoogleMapView.ts +15 -9
  149. package/{specs → src/specs}/NativeComponentMapView.ts +61 -32
  150. package/{specs → src/specs}/NativeComponentOverlay.ts +11 -2
  151. package/{specs → src/specs}/NativeComponentPolyline.ts +1 -1
  152. package/src/specs/NativeComponentUrlTile.ts +128 -0
  153. package/src/specs/NativeComponentWMSTile.ts +107 -0
  154. package/ios/AirGoogleMaps/AIRGoogleMapManager.m +0 -533
  155. package/lib/AnimatedRegion.d.ts +0 -19
  156. package/lib/AnimatedRegion.js +0 -134
  157. package/lib/Geojson.d.ts +0 -204
  158. package/lib/Geojson.js +0 -166
  159. package/lib/MapCallout.d.ts +0 -40
  160. package/lib/MapCallout.js +0 -51
  161. package/lib/MapCalloutSubview.d.ts +0 -34
  162. package/lib/MapCalloutSubview.js +0 -48
  163. package/lib/MapCircle.d.ts +0 -117
  164. package/lib/MapCircle.js +0 -53
  165. package/lib/MapHeatmap.d.ts +0 -78
  166. package/lib/MapHeatmap.js +0 -59
  167. package/lib/MapLocalTile.d.ts +0 -35
  168. package/lib/MapLocalTile.js +0 -44
  169. package/lib/MapMarker.d.ts +0 -322
  170. package/lib/MapMarker.js +0 -158
  171. package/lib/MapMarkerNativeComponent.d.ts +0 -15
  172. package/lib/MapMarkerNativeComponent.js +0 -15
  173. package/lib/MapOverlay.d.ts +0 -88
  174. package/lib/MapOverlay.js +0 -65
  175. package/lib/MapPolygon.d.ts +0 -140
  176. package/lib/MapPolygon.js +0 -53
  177. package/lib/MapPolygon.types.d.ts +0 -18
  178. package/lib/MapPolygon.types.js +0 -2
  179. package/lib/MapPolyline.d.ts +0 -156
  180. package/lib/MapPolyline.js +0 -53
  181. package/lib/MapUrlTile.d.ts +0 -134
  182. package/lib/MapUrlTile.js +0 -44
  183. package/lib/MapView.d.ts +0 -703
  184. package/lib/MapView.js +0 -427
  185. package/lib/MapView.types.d.ts +0 -161
  186. package/lib/MapView.types.js +0 -2
  187. package/lib/MapView.web.d.ts +0 -1
  188. package/lib/MapView.web.js +0 -9
  189. package/lib/MapViewNativeComponent.d.ts +0 -18
  190. package/lib/MapViewNativeComponent.js +0 -19
  191. package/lib/MapWMSTile.d.ts +0 -116
  192. package/lib/MapWMSTile.js +0 -44
  193. package/lib/ProviderConstants.d.ts +0 -2
  194. package/lib/ProviderConstants.js +0 -5
  195. package/lib/createFabricMap.d.ts +0 -24
  196. package/lib/createFabricMap.js +0 -188
  197. package/lib/decorateMapComponent.d.ts +0 -36
  198. package/lib/decorateMapComponent.js +0 -120
  199. package/lib/fixImageProp.d.ts +0 -4
  200. package/lib/fixImageProp.js +0 -16
  201. package/lib/index.d.ts +0 -38
  202. package/lib/index.js +0 -81
  203. package/lib/sharedTypes.d.ts +0 -81
  204. package/lib/sharedTypes.js +0 -2
  205. package/lib/sharedTypesInternal.js +0 -2
  206. package/lib/specs/NativeAirMapsModule.d.ts +0 -31
  207. package/lib/specs/NativeAirMapsModule.js +0 -4
  208. package/lib/specs/NativeComponentCallout.d.ts +0 -46
  209. package/lib/specs/NativeComponentCallout.js +0 -9
  210. package/lib/specs/NativeComponentCircle.d.ts +0 -74
  211. package/lib/specs/NativeComponentCircle.js +0 -7
  212. package/lib/specs/NativeComponentGoogleMapView.d.ts +0 -713
  213. package/lib/specs/NativeComponentGoogleMapView.js +0 -22
  214. package/lib/specs/NativeComponentGooglePolygon.d.ts +0 -75
  215. package/lib/specs/NativeComponentGooglePolygon.js +0 -7
  216. package/lib/specs/NativeComponentMapView.d.ts +0 -847
  217. package/lib/specs/NativeComponentMapView.js +0 -20
  218. package/lib/specs/NativeComponentMarker.d.ts +0 -258
  219. package/lib/specs/NativeComponentMarker.js +0 -19
  220. package/lib/specs/NativeComponentOverlay.d.ts +0 -67
  221. package/lib/specs/NativeComponentOverlay.js +0 -7
  222. package/lib/specs/NativeComponentPolyline.d.ts +0 -101
  223. package/lib/specs/NativeComponentPolyline.js +0 -7
  224. /package/ios/AirMaps/{UIView +AirMap.m → UIView+AirMap.m} +0 -0
  225. /package/ios/{AirMaps → generated}/RNMapsHostVewDelegate.h +0 -0
  226. /package/{lib/sharedTypesInternal.d.ts → src/sharedTypesInternal.ts} +0 -0
  227. /package/{specs → src/specs}/NativeAirMapsModule.ts +0 -0
  228. /package/{specs → src/specs}/NativeComponentCallout.ts +0 -0
  229. /package/{specs → src/specs}/NativeComponentGooglePolygon.ts +0 -0
  230. /package/{specs → src/specs}/NativeComponentMarker.ts +0 -0
@@ -10,17 +10,33 @@
10
10
  #import "RNMapsGoogleMapView.h"
11
11
  #import "RNMapsGooglePolygonView.h"
12
12
  #import "AIRGoogleMap.h"
13
- #import "AIRMapMarker.h"
14
13
  #import "AIRGoogleMapManager.h"
15
- #import <react/renderer/components/RNMapsSpecs/ComponentDescriptors.h>
16
- #import <react/renderer/components/RNMapsSpecs/EventEmitters.h>
17
- #import <react/renderer/components/RNMapsSpecs/Props.h>
18
- #import <react/renderer/components/RNMapsSpecs/RCTComponentViewHelpers.h>
14
+ #if __has_include(<ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>)
15
+ #import <ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>
16
+ #import <ReactNativeMapsGenerated/RNMapsHostVewDelegate.h>
17
+ #import <ReactNativeMapsGenerated/ComponentDescriptors.h>
18
+ #import <ReactNativeMapsGenerated/EventEmitters.h>
19
+ #import <ReactNativeMapsGenerated/Props.h>
20
+ #import <ReactNativeMapsGenerated/RCTComponentViewHelpers.h>
21
+ #else
22
+ #import <react-native-maps-generated/RNMapsAirModuleDelegate.h>
23
+ #import <react-native-maps-generated/ComponentDescriptors.h>
24
+ #import <react-native-maps-generated/EventEmitters.h>
25
+ #import <react-native-maps-generated/Props.h>
26
+ #import <react-native-maps-generated/RCTComponentViewHelpers.h>
27
+ #endif
19
28
  #import "RCTFabricComponentsPlugins.h"
20
29
  #import <React/RCTConversions.h>
30
+ #import <React/RCTUtils.h>
21
31
  #import "RCTConvert+GMSMapViewType.h"
32
+ #if __has_include(<ReactNativeMaps/RCTConvert+AirMap.h>)
33
+ #import <ReactNativeMaps/RCTConvert+AirMap.h>
34
+ #import <ReactNativeMaps/UIView+AirMap.h>
35
+ #else
22
36
  #import "RCTConvert+AirMap.h"
23
37
  #import "UIView+AirMap.h"
38
+ #endif
39
+
24
40
 
25
41
  using namespace facebook::react;
26
42
 
@@ -36,7 +52,7 @@ using namespace facebook::react;
36
52
 
37
53
 
38
54
  - (id<RNMapsAirModuleDelegate>) mapView {
39
- return _view;
55
+ return (id<RNMapsAirModuleDelegate>)_view;
40
56
  }
41
57
 
42
58
  #pragma mark - JS Commands
@@ -195,17 +211,14 @@ using namespace facebook::react;
195
211
 
196
212
  _view.onIndoorLevelActivated = [self](NSDictionary* dictionary) {
197
213
  if (_eventEmitter) {
214
+
198
215
  auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
199
216
 
200
- facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorLevelActivatedIndoorLevel level = {
217
+ facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorLevelActivated data = {
201
218
  .activeLevelIndex= (int) [dictionary[@"activeLevelIndex"] integerValue],
202
219
  .name = [dictionary[@"name"] UTF8String],
203
220
  .shortName = [dictionary[@"shortName"] UTF8String],
204
221
  };
205
-
206
- facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorLevelActivated data = {
207
- .indoorLevel = level,
208
- };
209
222
  mapViewEventEmitter->onIndoorLevelActivated(data);
210
223
  }
211
224
  };
@@ -214,13 +227,13 @@ using namespace facebook::react;
214
227
  if (_eventEmitter) {
215
228
  auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
216
229
 
217
- facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorBuildingFocusedIndoorBuilding indoorBuilding = {
218
- .underground = [dictionary[@"underground"] boolValue],
219
- .activeLevelIndex = (int) [dictionary[@"activeLevelIndex"] integerValue]
220
- };
230
+ NSError *jsError = nil;
231
+ NSString *levelsStr = RCTJSONStringify(dictionary[@"levels"], &jsError);
221
232
 
222
233
  facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorBuildingFocused data = {
223
- .indoorBuilding = indoorBuilding
234
+ .underground = [dictionary[@"underground"] boolValue],
235
+ .activeLevelIndex = (int) [dictionary[@"activeLevelIndex"] integerValue],
236
+ .levels = [levelsStr UTF8String]
224
237
  };
225
238
  mapViewEventEmitter->onIndoorBuildingFocused(data);
226
239
  }
@@ -242,7 +255,7 @@ using namespace facebook::react;
242
255
  mapViewEventEmitter->onKmlReady(data);
243
256
  }
244
257
  };
245
- _view.onChange = [self](NSDictionary* dictionary) {
258
+ _view.onRegionChange = [self](NSDictionary* dictionary) {
246
259
  if (_eventEmitter) {
247
260
 
248
261
  NSDictionary* regionDict = dictionary[@"region"];
@@ -363,22 +376,6 @@ using namespace facebook::react;
363
376
  }
364
377
  };
365
378
 
366
- _view.onRegionChange = [self](NSDictionary* dictionary) {
367
- if (_eventEmitter) {
368
-
369
- NSDictionary* regionDict = dictionary[@"region"];
370
- auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
371
- facebook::react::RNMapsGoogleMapViewEventEmitter::OnRegionChange data = {
372
- .region.latitude = [regionDict[@"latitude"] doubleValue],
373
- .region.longitude = [regionDict[@"longitude"] doubleValue],
374
- .region.latitudeDelta = [regionDict[@"latitudeDelta"] doubleValue],
375
- .region.longitudeDelta = [regionDict[@"longitudeDelta"] doubleValue],
376
- .continuous = [dictionary[@"continuous"] boolValue],
377
- };
378
- mapViewEventEmitter->onRegionChange(data);
379
- }
380
- };
381
-
382
379
  _view.onRegionChangeComplete = [self](NSDictionary* dictionary) {
383
380
  if (_eventEmitter) {
384
381
 
@@ -515,6 +512,12 @@ using namespace facebook::react;
515
512
  _legacyMapManager.googleMapId = mapID;
516
513
  }
517
514
  }
515
+ if (oldViewProps.customMapStyleString != newViewProps.customMapStyleString) {
516
+ NSString* customStyle = RCTNSStringFromString(newViewProps.customMapStyleString);
517
+ if (customStyle && [customStyle length]){
518
+ _legacyMapManager.customMapStyle = customStyle;
519
+ }
520
+ }
518
521
  if (!newViewProps.zoomTapEnabled) {
519
522
  _legacyMapManager.zoomTapEnabled = newViewProps.zoomTapEnabled;
520
523
  } else {
@@ -591,6 +594,8 @@ using namespace facebook::react;
591
594
  REMAP_MAPVIEW_PROP(scrollEnabled)
592
595
 
593
596
  REMAP_MAPVIEW_STRING_PROP(kmlSrc)
597
+ REMAP_MAPVIEW_STRING_PROP(customMapStyleString)
598
+
594
599
 
595
600
  if (newViewProps.minZoom != oldViewProps.minZoom || newViewProps.maxZoom != oldViewProps.maxZoom){
596
601
  [_view setMinZoom:newViewProps.minZoom maxZoom:newViewProps.maxZoom];
@@ -636,6 +641,9 @@ using namespace facebook::react;
636
641
  case RNMapsGoogleMapViewMapType::Hybrid:
637
642
  _view.mapType = kGMSTypeHybrid;
638
643
  break;
644
+ case RNMapsGoogleMapViewMapType::None:
645
+ _view.mapType = kGMSTypeNone;
646
+ break;
639
647
  default:
640
648
  _view.mapType = kGMSTypeNormal;
641
649
  break;
@@ -18,7 +18,22 @@
18
18
 
19
19
  RCT_EXPORT_MODULE(RNMapsGoogleMapViewManager)
20
20
 
21
-
21
+ RCT_EXPORT_VIEW_PROPERTY(onMapReady, RCTDirectEventBlock)
22
+ RCT_EXPORT_VIEW_PROPERTY(onMapLoaded, RCTDirectEventBlock)
23
+ RCT_EXPORT_VIEW_PROPERTY(onKmlReady, RCTDirectEventBlock)
24
+ RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
25
+ RCT_EXPORT_VIEW_PROPERTY(onLongPress, RCTBubblingEventBlock)
26
+ RCT_EXPORT_VIEW_PROPERTY(onPanDrag, RCTDirectEventBlock)
27
+ RCT_EXPORT_VIEW_PROPERTY(onUserLocationChange, RCTDirectEventBlock)
28
+ RCT_EXPORT_VIEW_PROPERTY(onMarkerPress, RCTDirectEventBlock)
29
+ RCT_EXPORT_VIEW_PROPERTY(onMarkerSelect, RCTDirectEventBlock)
30
+ RCT_EXPORT_VIEW_PROPERTY(onMarkerDeselect, RCTDirectEventBlock)
31
+ RCT_EXPORT_VIEW_PROPERTY(onRegionChangeStart, RCTDirectEventBlock)
32
+ RCT_EXPORT_VIEW_PROPERTY(onRegionChange, RCTDirectEventBlock)
33
+ RCT_EXPORT_VIEW_PROPERTY(onRegionChangeComplete, RCTDirectEventBlock)
34
+ RCT_EXPORT_VIEW_PROPERTY(onPoiClick, RCTDirectEventBlock)
35
+ RCT_EXPORT_VIEW_PROPERTY(onIndoorLevelActivated, RCTDirectEventBlock)
36
+ RCT_EXPORT_VIEW_PROPERTY(onIndoorBuildingFocused, RCTDirectEventBlock)
22
37
 
23
38
  @end
24
39
 
@@ -1,6 +1,6 @@
1
1
  //
2
2
  // RNMapsGoogleMapView.mm
3
- //
3
+ //
4
4
  //
5
5
  // Created by Salah Ghanim on 23.11.24.
6
6
  // Copyright © 2024 react-native-maps. All rights reserved.
@@ -10,11 +10,20 @@
10
10
  #import "RNMapsGooglePolygonView.h"
11
11
  #import "AIRGMSPolygon.h"
12
12
  #import "AIRGoogleMap.h"
13
-
14
- #import <react/renderer/components/RNMapsSpecs/ComponentDescriptors.h>
15
- #import <react/renderer/components/RNMapsSpecs/EventEmitters.h>
16
- #import <react/renderer/components/RNMapsSpecs/Props.h>
17
- #import <react/renderer/components/RNMapsSpecs/RCTComponentViewHelpers.h>
13
+ #if __has_include(<ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>)
14
+ #import <ReactNativeMapsGenerated/RNMapsSpecs.h>
15
+ #import <ReactNativeMapsGenerated/RNMapsHostVewDelegate.h>
16
+ #import <ReactNativeMapsGenerated/ComponentDescriptors.h>
17
+ #import <ReactNativeMapsGenerated/EventEmitters.h>
18
+ #import <ReactNativeMapsGenerated/Props.h>
19
+ #import <ReactNativeMapsGenerated/RCTComponentViewHelpers.h>
20
+ #else
21
+ #import <react-native-maps-generated/RNMapsSpecs.h>
22
+ #import <react-native-maps-generated/ComponentDescriptors.h>
23
+ #import <react-native-maps-generated/EventEmitters.h>
24
+ #import <react-native-maps-generated/Props.h>
25
+ #import <react-native-maps-generated/RCTComponentViewHelpers.h>
26
+ #endif
18
27
 
19
28
  #import "RCTFabricComponentsPlugins.h"
20
29
  #import <React/RCTConversions.h>
@@ -39,7 +48,7 @@ bool areHolesEqual(const std::vector<std::vector<RNMapsGooglePolygonHolesStruct>
39
48
  if (newHole.size() != oldHole.size()) {
40
49
  return false;
41
50
  }
42
-
51
+
43
52
  }
44
53
 
45
54
  return true;
@@ -74,7 +83,7 @@ bool areHolesEqual(const std::vector<std::vector<RNMapsGooglePolygonHolesStruct>
74
83
  }
75
84
 
76
85
  - (void) prepareContentView {
77
-
86
+
78
87
  _view = [AIRGMSPolygon new];
79
88
  _view.onPress = [self](NSDictionary* dictionary) {
80
89
  if (_eventEmitter) {
@@ -169,7 +178,7 @@ bool areHolesEqual(const std::vector<std::vector<RNMapsGooglePolygonHolesStruct>
169
178
  }
170
179
  _view.path = path;
171
180
  }
172
-
181
+
173
182
  if (!areHolesEqual(newViewProps.holes, oldViewProps.holes)){
174
183
  NSMutableArray<GMSMutablePath *> *interiorPolygons = [NSMutableArray array];
175
184
  for(int h = 0; h < newViewProps.holes.size(); h++)
@@ -186,19 +195,19 @@ bool areHolesEqual(const std::vector<std::vector<RNMapsGooglePolygonHolesStruct>
186
195
  }
187
196
  _view.holes = interiorPolygons;
188
197
  }
189
-
190
-
198
+
199
+
191
200
  REMAP_MAPVIEW_PROP(tappable)
192
201
 
193
202
  if (newViewProps.fillColor){
194
203
  _view.fillColor = RCTUIColorFromSharedColor(newViewProps.fillColor);
195
204
  }
196
-
205
+
197
206
  if (newViewProps.strokeColor){
198
207
  _view.strokeColor = RCTUIColorFromSharedColor(newViewProps.strokeColor);
199
208
  }
200
-
201
-
209
+
210
+
202
211
 
203
212
 
204
213
  [super updateProps:props oldProps:oldProps];
@@ -18,6 +18,7 @@
18
18
 
19
19
  RCT_EXPORT_MODULE(RNMapsGooglePolygonViewManager)
20
20
 
21
+ RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
21
22
 
22
23
 
23
24
  @end
@@ -14,7 +14,7 @@
14
14
  #import "SMCalloutView.h"
15
15
  #import "RCTConvert+AirMap.h"
16
16
  #import "AIRMapCalloutSubview.h"
17
- #import "RNMapsAirModuleDelegate.h"
17
+
18
18
 
19
19
  @class AIRMapCoordinate;
20
20
  @class AIRMapMarker;
@@ -23,7 +23,7 @@ extern const NSTimeInterval AIRMapRegionChangeObserveInterval;
23
23
  extern const CGFloat AIRMapZoomBoundBuffer;
24
24
  extern const NSInteger AIRMapMaxZoomLevel;
25
25
 
26
- @interface AIRMap: MKMapView<SMCalloutViewDelegate, RNMapsAirModuleDelegate>
26
+ @interface AIRMap: MKMapView<SMCalloutViewDelegate>
27
27
 
28
28
  @property (nonatomic, strong) SMCalloutView *calloutView;
29
29
  @property (nonatomic, strong) UIImageView *cacheImageView;
@@ -56,12 +56,12 @@ extern const NSInteger AIRMapMaxZoomLevel;
56
56
 
57
57
  @property (nonatomic, assign) BOOL ignoreRegionChanges;
58
58
 
59
- @property (nonatomic, copy) RCTBubblingEventBlock onMapReady;
60
- @property (nonatomic, copy) RCTBubblingEventBlock onChange;
59
+ @property (nonatomic, copy) RCTDirectEventBlock onMapReady;
60
+ @property (nonatomic, copy) RCTDirectEventBlock onRegionChange;
61
61
  @property (nonatomic, copy) RCTBubblingEventBlock onPress;
62
- @property (nonatomic, copy) RCTBubblingEventBlock onPanDrag;
63
- @property (nonatomic, copy) RCTBubblingEventBlock onDoublePress;
64
62
  @property (nonatomic, copy) RCTBubblingEventBlock onLongPress;
63
+ @property (nonatomic, copy) RCTDirectEventBlock onPanDrag;
64
+ @property (nonatomic, copy) RCTDirectEventBlock onDoublePress;
65
65
  @property (nonatomic, copy) RCTDirectEventBlock onMarkerPress;
66
66
  @property (nonatomic, copy) RCTDirectEventBlock onMarkerSelect;
67
67
  @property (nonatomic, copy) RCTDirectEventBlock onMarkerDeselect;
@@ -71,14 +71,13 @@ extern const NSInteger AIRMapMaxZoomLevel;
71
71
 
72
72
  @property (nonatomic, copy) RCTDirectEventBlock onCalloutPress;
73
73
  @property (nonatomic, copy) RCTDirectEventBlock onRegionChangeStart;
74
- @property (nonatomic, copy) RCTDirectEventBlock onRegionChange;
75
- @property (nonatomic, copy) RCTBubblingEventBlock onUserLocationChange;
74
+ @property (nonatomic, copy) RCTDirectEventBlock onUserLocationChange;
76
75
 
77
76
  - (void)cacheViewIfNeeded;
78
77
  - (void)beginLoading;
79
78
  - (void)finishLoading;
80
79
  - (double)getZoomLevel;
81
- - (NSArray *)getMapBoundaries;
80
+ - (NSDictionary *)getMapBoundaries;
82
81
 
83
82
  - (AIRMapMarker*) markerAtPoint:(CGPoint)point;
84
83
  - (NSDictionary*) getMarkersFramesWithOnlyVisible:(BOOL)onlyVisible;
@@ -26,8 +26,12 @@ const NSTimeInterval AIRMapRegionChangeObserveInterval = 0.1;
26
26
  const CGFloat AIRMapZoomBoundBuffer = 0.01;
27
27
  const NSInteger AIRMapMaxZoomLevel = 20;
28
28
 
29
-
30
- @interface MKMapView (UIGestureRecognizer)
29
+ #if __has_include(<ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>)
30
+ #import <ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>
31
+ #else
32
+ #import <react-native-maps-generated/RNMapsAirModuleDelegate.h>
33
+ #endif
34
+ @interface MKMapView (UIGestureRecognizer)<RNMapsAirModuleDelegate>
31
35
 
32
36
  // this tells the compiler that MKMapView actually implements this method
33
37
  - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch;
@@ -320,23 +324,23 @@ const NSInteger AIRMapMaxZoomLevel = 20;
320
324
 
321
325
  #pragma mark RNMapsAirModuleDelegate.h
322
326
 
323
- - (NSArray *)getMapBoundaries
327
+ - (NSDictionary *)getMapBoundaries
324
328
  {
325
329
  MKMapRect mapRect = self.visibleMapRect;
326
330
 
327
331
  CLLocationCoordinate2D northEast = MKCoordinateForMapPoint(MKMapPointMake(MKMapRectGetMaxX(mapRect), mapRect.origin.y));
328
332
  CLLocationCoordinate2D southWest = MKCoordinateForMapPoint(MKMapPointMake(mapRect.origin.x, MKMapRectGetMaxY(mapRect)));
329
333
 
330
- return @[
331
- @[
332
- [NSNumber numberWithDouble:northEast.longitude],
333
- [NSNumber numberWithDouble:northEast.latitude]
334
- ],
335
- @[
336
- [NSNumber numberWithDouble:southWest.longitude],
337
- [NSNumber numberWithDouble:southWest.latitude]
338
- ]
339
- ];
334
+ return @{
335
+ @"northEast": @{
336
+ @"latitude": [NSNumber numberWithDouble:northEast.latitude],
337
+ @"longitude": [NSNumber numberWithDouble:northEast.longitude],
338
+ },
339
+ @"southWest": @{
340
+ @"latitude": [NSNumber numberWithDouble:southWest.latitude],
341
+ @"longitude": [NSNumber numberWithDouble:southWest.longitude],
342
+ },
343
+ };
340
344
  }
341
345
  - (NSDictionary *) getPointForCoordinates:(CLLocationCoordinate2D) location
342
346
  {
@@ -749,7 +753,7 @@ const NSInteger AIRMapMaxZoomLevel = 20;
749
753
 
750
754
  - (void) listenToMemoryWarnings
751
755
  {
752
- __weak typeof(self) weakSelf = self;
756
+ __weak __typeof(self) weakSelf = self;
753
757
  static dispatch_once_t onceToken;
754
758
  static dispatch_source_t source;
755
759
  dispatch_once(&onceToken, ^{
@@ -111,13 +111,13 @@ RCT_EXPORT_VIEW_PROPERTY(legalLabelInsets, UIEdgeInsets)
111
111
  RCT_EXPORT_VIEW_PROPERTY(mapPadding, UIEdgeInsets)
112
112
  RCT_EXPORT_VIEW_PROPERTY(mapType, MKMapType)
113
113
  RCT_EXPORT_VIEW_PROPERTY(cameraZoomRange, NSDictionary)
114
- RCT_EXPORT_VIEW_PROPERTY(onMapReady, RCTBubblingEventBlock)
115
- RCT_EXPORT_VIEW_PROPERTY(onChange, RCTBubblingEventBlock)
114
+ RCT_EXPORT_VIEW_PROPERTY(onMapReady, RCTDirectEventBlock)
115
+ RCT_EXPORT_VIEW_PROPERTY(onRegionChange, RCTDirectEventBlock)
116
116
  RCT_EXPORT_VIEW_PROPERTY(onRegionChangeStart, RCTDirectEventBlock)
117
- RCT_EXPORT_VIEW_PROPERTY(onPanDrag, RCTBubblingEventBlock)
117
+ RCT_EXPORT_VIEW_PROPERTY(onPanDrag, RCTDirectEventBlock)
118
118
  RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
119
119
  RCT_EXPORT_VIEW_PROPERTY(onLongPress, RCTBubblingEventBlock)
120
- RCT_EXPORT_VIEW_PROPERTY(onDoublePress, RCTBubblingEventBlock)
120
+ RCT_EXPORT_VIEW_PROPERTY(onDoublePress, RCTDirectEventBlock)
121
121
  RCT_EXPORT_VIEW_PROPERTY(onMarkerPress, RCTDirectEventBlock)
122
122
  RCT_EXPORT_VIEW_PROPERTY(onMarkerSelect, RCTDirectEventBlock)
123
123
  RCT_EXPORT_VIEW_PROPERTY(onMarkerDeselect, RCTDirectEventBlock)
@@ -125,7 +125,7 @@ RCT_EXPORT_VIEW_PROPERTY(onMarkerDragStart, RCTDirectEventBlock)
125
125
  RCT_EXPORT_VIEW_PROPERTY(onMarkerDrag, RCTDirectEventBlock)
126
126
  RCT_EXPORT_VIEW_PROPERTY(onMarkerDragEnd, RCTDirectEventBlock)
127
127
  RCT_EXPORT_VIEW_PROPERTY(onCalloutPress, RCTDirectEventBlock)
128
- RCT_EXPORT_VIEW_PROPERTY(onUserLocationChange, RCTBubblingEventBlock)
128
+ RCT_EXPORT_VIEW_PROPERTY(onUserLocationChange, RCTDirectEventBlock)
129
129
  RCT_CUSTOM_VIEW_PROPERTY(initialRegion, MKCoordinateRegion, AIRMap)
130
130
  {
131
131
  if (json == nil) return;
@@ -186,18 +186,7 @@ RCT_EXPORT_METHOD(getMapBoundaries:(nonnull NSNumber *)reactTag
186
186
  if (![view isKindOfClass:[AIRMap class]]) {
187
187
  RCTLogError(@"Invalid view returned from registry, expecting AIRMap, got: %@", view);
188
188
  } else {
189
- NSArray *boundingBox = [view getMapBoundaries];
190
-
191
- resolve(@{
192
- @"northEast" : @{
193
- @"longitude" : boundingBox[0][0],
194
- @"latitude" : boundingBox[0][1]
195
- },
196
- @"southWest" : @{
197
- @"longitude" : boundingBox[1][0],
198
- @"latitude" : boundingBox[1][1]
199
- }
200
- });
189
+ resolve([view getMapBoundaries]);
201
190
  }
202
191
  }];
203
192
  }
@@ -1006,14 +995,14 @@ static int kDragCenterContext;
1006
995
 
1007
996
  - (void)_emitRegionChangeEvent:(AIRMap *)mapView continuous:(BOOL)continuous
1008
997
  {
1009
- if (!mapView.ignoreRegionChanges && mapView.onChange) {
998
+ if (!mapView.ignoreRegionChanges && mapView.onRegionChange) {
1010
999
  MKCoordinateRegion region = mapView.region;
1011
1000
  if (!CLLocationCoordinate2DIsValid(region.center)) {
1012
1001
  return;
1013
1002
  }
1014
1003
 
1015
1004
  #define FLUSH_NAN(value) (isnan(value) ? 0 : value)
1016
- mapView.onChange(@{
1005
+ mapView.onRegionChange(@{
1017
1006
  @"continuous": @(continuous),
1018
1007
  @"region": @{
1019
1008
  @"latitude": @(FLUSH_NAN(region.center.latitude)),