react-native-maps 1.21.0-alpha.99 → 1.22.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 (234) 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/app.plugin.js +1 -0
  61. package/ios/AirGoogleMaps/AIRGoogleMap.h +13 -13
  62. package/ios/AirGoogleMaps/{AIRGoogleMap.m → AIRGoogleMap.mm} +32 -34
  63. package/ios/AirGoogleMaps/AIRGoogleMapManager.h +1 -0
  64. package/ios/AirGoogleMaps/AIRGoogleMapManager.mm +543 -0
  65. package/ios/AirGoogleMaps/AIRGoogleMapMarker.m +3 -3
  66. package/ios/AirGoogleMaps/AIRGoogleMapMarkerManager.m +1 -1
  67. package/ios/AirGoogleMaps/AIRGoogleMapUrlTile.m +2 -2
  68. package/ios/AirGoogleMaps/AIRGoogleMapWMSTile.m +2 -2
  69. package/ios/AirGoogleMaps/RNMapsGoogleMapView.h +5 -2
  70. package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +41 -33
  71. package/ios/AirGoogleMaps/RNMapsGoogleMapViewManager.mm +16 -1
  72. package/ios/AirGoogleMaps/RNMapsGooglePolygonView.mm +23 -14
  73. package/ios/AirGoogleMaps/RNMapsGooglePolygonViewManager.mm +1 -0
  74. package/ios/AirMaps/AIRMap.h +8 -9
  75. package/ios/AirMaps/{AIRMap.m → AIRMap.mm} +18 -14
  76. package/ios/AirMaps/AIRMapManager.m +8 -19
  77. package/ios/AirMaps/AIRMapMarker.m +57 -44
  78. package/ios/AirMaps/AIRMapOverlay.m +2 -2
  79. package/ios/AirMaps/AIRMapWMSTile.m +8 -8
  80. package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMapView.h +25 -0
  81. package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMapView.mm +77 -0
  82. package/ios/AirMaps/FabricPlaceholders/PlaceHolderPolygonView.h +25 -0
  83. package/ios/AirMaps/FabricPlaceholders/PlaceHolderPolygonView.mm +51 -0
  84. package/ios/AirMaps/RNMapsAirModule.h +2 -3
  85. package/ios/AirMaps/RNMapsAirModule.mm +14 -0
  86. package/ios/AirMaps/RNMapsDefines.h +1 -0
  87. package/ios/AirMaps/RNMapsMapView.h +5 -2
  88. package/ios/AirMaps/RNMapsMapView.mm +16 -6
  89. package/ios/AirMaps/RNMapsMapViewManager.mm +19 -1
  90. package/ios/AirMaps/RNMapsMarkerView.mm +12 -4
  91. package/ios/AirMaps/RNMapsMarkerViewManager.mm +7 -0
  92. package/ios/AirMaps/module.modulemap +6 -0
  93. package/ios/AirMaps.xcodeproj/project.pbxproj +15 -55
  94. package/ios/generated/RCTAppDependencyProvider.h +25 -0
  95. package/ios/generated/RCTAppDependencyProvider.mm +55 -0
  96. package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
  97. package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
  98. package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
  99. package/ios/generated/RCTThirdPartyComponentsProvider.mm +26 -0
  100. package/ios/{AirMaps → generated}/RNMapsAirModuleDelegate.h +1 -1
  101. package/ios/generated/RNMapsSpecs/ComponentDescriptors.cpp +29 -0
  102. package/ios/generated/RNMapsSpecs/ComponentDescriptors.h +31 -0
  103. package/ios/generated/RNMapsSpecs/EventEmitters.cpp +977 -0
  104. package/ios/generated/RNMapsSpecs/EventEmitters.h +846 -0
  105. package/ios/generated/RNMapsSpecs/Props.cpp +194 -0
  106. package/ios/generated/RNMapsSpecs/Props.h +1224 -0
  107. package/ios/generated/RNMapsSpecs/RCTComponentViewHelpers.h +591 -0
  108. package/ios/generated/RNMapsSpecs/RNMapsSpecs-generated.mm +92 -0
  109. package/ios/generated/RNMapsSpecs/RNMapsSpecs.h +137 -0
  110. package/ios/generated/RNMapsSpecs/ShadowNodes.cpp +24 -0
  111. package/ios/generated/RNMapsSpecs/ShadowNodes.h +109 -0
  112. package/ios/generated/RNMapsSpecs/States.cpp +16 -0
  113. package/ios/generated/RNMapsSpecs/States.h +113 -0
  114. package/ios/generated/RNMapsSpecsJSI-generated.cpp +74 -0
  115. package/ios/generated/RNMapsSpecsJSI.h +268 -0
  116. package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
  117. package/ios/generated/module.modulemap +15 -0
  118. package/package.json +34 -27
  119. package/plugin/build/android.js +58 -0
  120. package/plugin/build/index.js +10 -0
  121. package/plugin/build/ios.js +172 -0
  122. package/react-native-google-maps.podspec +27 -0
  123. package/react-native-maps-generated.podspec +31 -0
  124. package/react-native-maps.podspec +52 -46
  125. package/react-native.config.js +16 -0
  126. package/src/AnimatedRegion.ts +169 -0
  127. package/src/Geojson.tsx +541 -0
  128. package/src/MapCallout.tsx +77 -0
  129. package/src/MapCalloutSubview.tsx +64 -0
  130. package/src/MapCircle.tsx +162 -0
  131. package/src/MapHeatmap.tsx +125 -0
  132. package/src/MapLocalTile.tsx +60 -0
  133. package/src/MapMarker.tsx +531 -0
  134. package/src/MapMarkerNativeComponent.ts +51 -0
  135. package/src/MapOverlay.tsx +178 -0
  136. package/src/MapPolygon.tsx +188 -0
  137. package/src/MapPolygon.types.ts +25 -0
  138. package/src/MapPolyline.tsx +215 -0
  139. package/src/MapUrlTile.tsx +169 -0
  140. package/src/MapView.tsx +1230 -0
  141. package/src/MapView.types.ts +212 -0
  142. package/src/MapView.web.ts +2 -0
  143. package/src/MapViewNativeComponent.ts +86 -0
  144. package/src/MapWMSTile.tsx +148 -0
  145. package/src/ProviderConstants.ts +2 -0
  146. package/src/createFabricMap.tsx +253 -0
  147. package/src/decorateMapComponent.ts +229 -0
  148. package/src/fixImageProp.ts +17 -0
  149. package/src/index.ts +52 -0
  150. package/src/sharedTypes.ts +101 -0
  151. package/{specs → src/specs}/NativeComponentCircle.ts +3 -4
  152. package/{specs → src/specs}/NativeComponentGoogleMapView.ts +15 -9
  153. package/{specs → src/specs}/NativeComponentMapView.ts +61 -32
  154. package/{specs → src/specs}/NativeComponentOverlay.ts +11 -2
  155. package/{specs → src/specs}/NativeComponentPolyline.ts +1 -1
  156. package/src/specs/NativeComponentUrlTile.ts +128 -0
  157. package/src/specs/NativeComponentWMSTile.ts +107 -0
  158. package/ios/AirGoogleMaps/AIRGoogleMapManager.m +0 -533
  159. package/lib/AnimatedRegion.d.ts +0 -19
  160. package/lib/AnimatedRegion.js +0 -134
  161. package/lib/Geojson.d.ts +0 -204
  162. package/lib/Geojson.js +0 -166
  163. package/lib/MapCallout.d.ts +0 -40
  164. package/lib/MapCallout.js +0 -51
  165. package/lib/MapCalloutSubview.d.ts +0 -34
  166. package/lib/MapCalloutSubview.js +0 -48
  167. package/lib/MapCircle.d.ts +0 -117
  168. package/lib/MapCircle.js +0 -53
  169. package/lib/MapHeatmap.d.ts +0 -78
  170. package/lib/MapHeatmap.js +0 -59
  171. package/lib/MapLocalTile.d.ts +0 -35
  172. package/lib/MapLocalTile.js +0 -44
  173. package/lib/MapMarker.d.ts +0 -322
  174. package/lib/MapMarker.js +0 -158
  175. package/lib/MapMarkerNativeComponent.d.ts +0 -15
  176. package/lib/MapMarkerNativeComponent.js +0 -15
  177. package/lib/MapOverlay.d.ts +0 -88
  178. package/lib/MapOverlay.js +0 -65
  179. package/lib/MapPolygon.d.ts +0 -140
  180. package/lib/MapPolygon.js +0 -53
  181. package/lib/MapPolygon.types.d.ts +0 -18
  182. package/lib/MapPolyline.d.ts +0 -156
  183. package/lib/MapPolyline.js +0 -53
  184. package/lib/MapUrlTile.d.ts +0 -134
  185. package/lib/MapUrlTile.js +0 -44
  186. package/lib/MapView.d.ts +0 -703
  187. package/lib/MapView.js +0 -427
  188. package/lib/MapView.types.d.ts +0 -161
  189. package/lib/MapView.types.js +0 -2
  190. package/lib/MapView.web.d.ts +0 -1
  191. package/lib/MapView.web.js +0 -9
  192. package/lib/MapViewNativeComponent.d.ts +0 -18
  193. package/lib/MapViewNativeComponent.js +0 -19
  194. package/lib/MapWMSTile.d.ts +0 -116
  195. package/lib/MapWMSTile.js +0 -44
  196. package/lib/ProviderConstants.d.ts +0 -2
  197. package/lib/ProviderConstants.js +0 -5
  198. package/lib/createFabricMap.d.ts +0 -24
  199. package/lib/createFabricMap.js +0 -188
  200. package/lib/decorateMapComponent.d.ts +0 -36
  201. package/lib/decorateMapComponent.js +0 -120
  202. package/lib/fixImageProp.d.ts +0 -4
  203. package/lib/fixImageProp.js +0 -16
  204. package/lib/index.d.ts +0 -38
  205. package/lib/index.js +0 -81
  206. package/lib/sharedTypes.d.ts +0 -81
  207. package/lib/sharedTypes.js +0 -2
  208. package/lib/sharedTypesInternal.js +0 -2
  209. package/lib/specs/NativeAirMapsModule.d.ts +0 -31
  210. package/lib/specs/NativeAirMapsModule.js +0 -4
  211. package/lib/specs/NativeComponentCallout.d.ts +0 -46
  212. package/lib/specs/NativeComponentCallout.js +0 -9
  213. package/lib/specs/NativeComponentCircle.d.ts +0 -74
  214. package/lib/specs/NativeComponentCircle.js +0 -7
  215. package/lib/specs/NativeComponentGoogleMapView.d.ts +0 -713
  216. package/lib/specs/NativeComponentGoogleMapView.js +0 -22
  217. package/lib/specs/NativeComponentGooglePolygon.d.ts +0 -75
  218. package/lib/specs/NativeComponentGooglePolygon.js +0 -7
  219. package/lib/specs/NativeComponentMapView.d.ts +0 -847
  220. package/lib/specs/NativeComponentMapView.js +0 -20
  221. package/lib/specs/NativeComponentMarker.d.ts +0 -258
  222. package/lib/specs/NativeComponentMarker.js +0 -19
  223. package/lib/specs/NativeComponentOverlay.d.ts +0 -67
  224. package/lib/specs/NativeComponentOverlay.js +0 -7
  225. package/lib/specs/NativeComponentPolyline.d.ts +0 -101
  226. package/lib/specs/NativeComponentPolyline.js +0 -7
  227. /package/ios/AirMaps/{UIView +AirMap.m → UIView+AirMap.m} +0 -0
  228. /package/ios/{AirMaps → generated}/RNMapsHostVewDelegate.h +0 -0
  229. /package/{lib/MapPolygon.types.js → plugin/build/types.js} +0 -0
  230. /package/{lib/sharedTypesInternal.d.ts → src/sharedTypesInternal.ts} +0 -0
  231. /package/{specs → src/specs}/NativeAirMapsModule.ts +0 -0
  232. /package/{specs → src/specs}/NativeComponentCallout.ts +0 -0
  233. /package/{specs → src/specs}/NativeComponentGooglePolygon.ts +0 -0
  234. /package/{specs → src/specs}/NativeComponentMarker.ts +0 -0
@@ -30,7 +30,7 @@ NSInteger const AIR_CALLOUT_OPEN_ZINDEX_BASELINE = 999;
30
30
  BOOL _calloutIsOpen;
31
31
  NSInteger _zIndexBeforeOpen;
32
32
  BOOL _useLegacyPinView;
33
-
33
+
34
34
  CADisplayLink *_displayLink;
35
35
  CLLocationCoordinate2D _startCoordinate;
36
36
  CLLocationCoordinate2D _endCoordinate;
@@ -52,13 +52,13 @@ NSInteger const AIR_CALLOUT_OPEN_ZINDEX_BASELINE = 999;
52
52
  // Make sure we use the image size when available
53
53
  CGSize size = self.image ? self.image.size : frame.size;
54
54
  CGRect bounds = {CGPointZero, size};
55
-
55
+
56
56
  // The MapView is basically in charge of figuring out the center position of the marker view. If the view changed in
57
57
  // height though, we need to compensate in such a way that the bottom of the marker stays at the same spot on the
58
58
  // map.
59
59
  CGFloat dy = (bounds.size.height - self.bounds.size.height) / 2;
60
60
  CGPoint center = (CGPoint){ self.center.x, self.center.y - dy };
61
-
61
+
62
62
  // Avoid crashes due to nan coords
63
63
  if (isnan(center.x) || isnan(center.y) ||
64
64
  isnan(bounds.origin.x) || isnan(bounds.origin.y) ||
@@ -67,7 +67,7 @@ NSInteger const AIR_CALLOUT_OPEN_ZINDEX_BASELINE = 999;
67
67
  self.reactTag, self, NSStringFromCGPoint(center), NSStringFromCGRect(bounds));
68
68
  return;
69
69
  }
70
-
70
+
71
71
  self.center = center;
72
72
  self.bounds = bounds;
73
73
  }
@@ -102,31 +102,31 @@ NSInteger const AIR_CALLOUT_OPEN_ZINDEX_BASELINE = 999;
102
102
  {
103
103
  if ([self shouldUsePinView]) {
104
104
  // In this case, we want to render a platform "default" legacy marker.
105
-
106
-
105
+
106
+
107
107
  if (_pinView == nil && _useLegacyPinView) {
108
108
  _pinView = [[MKPinAnnotationView alloc] initWithAnnotation:self reuseIdentifier: nil];
109
109
  [self addGestureRecognizerToView:_pinView];
110
110
  _pinView.annotation = self;
111
-
111
+
112
112
  if ([_pinView respondsToSelector:@selector(setPinTintColor:)]) {
113
113
  _pinView.pinTintColor = self.pinColor;
114
114
  }
115
-
115
+
116
116
  _pinView.draggable = self.draggable;
117
117
  _pinView.layer.zPosition = self.zIndex;
118
118
  _pinView.displayPriority = self.displayPriority;
119
119
  _pinView.zPriority = self.zIndex;
120
120
  return _pinView;
121
121
  }
122
-
123
-
124
-
122
+
123
+
124
+
125
125
  if (_markerView == nil && !_useLegacyPinView) {
126
126
  _markerView = [[MKMarkerAnnotationView alloc] initWithAnnotation:self reuseIdentifier: nil];
127
127
  [self addGestureRecognizerToView:_markerView];
128
128
  _markerView.annotation = self;
129
-
129
+
130
130
  _markerView.draggable = self.draggable;
131
131
  _markerView.layer.zPosition = self.zIndex;
132
132
  _markerView.markerTintColor = self.pinColor;
@@ -135,7 +135,7 @@ NSInteger const AIR_CALLOUT_OPEN_ZINDEX_BASELINE = 999;
135
135
  _markerView.displayPriority = self.displayPriority;
136
136
  _markerView.zPriority = self.zIndex;
137
137
 
138
-
138
+
139
139
  }
140
140
  return _markerView ?: _pinView;
141
141
  } else {
@@ -152,14 +152,14 @@ NSInteger const AIR_CALLOUT_OPEN_ZINDEX_BASELINE = 999;
152
152
  - (void)fillCalloutView:(SMCalloutView *)calloutView
153
153
  {
154
154
  // Set everything necessary on the calloutView before it becomes visible.
155
-
155
+
156
156
  // Apply the MKAnnotationView's desired calloutOffset (from the top-middle of the view)
157
157
  if ([self shouldUsePinView] && !_hasSetCalloutOffset && _useLegacyPinView) {
158
158
  calloutView.calloutOffset = CGPointMake(-8,0);
159
159
  } else {
160
160
  calloutView.calloutOffset = self.calloutOffset;
161
161
  }
162
-
162
+
163
163
  if (self.calloutView) {
164
164
  calloutView.title = nil;
165
165
  calloutView.subtitle = nil;
@@ -172,13 +172,13 @@ NSInteger const AIR_CALLOUT_OPEN_ZINDEX_BASELINE = 999;
172
172
  // as a result, we use the default "masked" background view.
173
173
  calloutView.backgroundView = [SMCalloutMaskedBackgroundView new];
174
174
  }
175
-
175
+
176
176
  // when this is set, the callout's content will be whatever react views the user has put as the callout's
177
177
  // children.
178
178
  calloutView.contentView = self.calloutView;
179
-
179
+
180
180
  } else {
181
-
181
+
182
182
  // if there is no calloutView, it means the user wants to use the default callout behavior with title/subtitle
183
183
  // pairs.
184
184
  calloutView.title = self.title;
@@ -192,12 +192,12 @@ NSInteger const AIR_CALLOUT_OPEN_ZINDEX_BASELINE = 999;
192
192
  {
193
193
  _calloutIsOpen = YES;
194
194
  [self setZIndex:_zIndexBeforeOpen];
195
-
195
+
196
196
  MKAnnotationView *annotationView = [self getAnnotationView];
197
-
197
+
198
198
  [self setSelected:YES animated:NO];
199
199
  [self.map selectAnnotation:self animated:NO];
200
-
200
+
201
201
  id event = @{
202
202
  @"action": @"marker-select",
203
203
  @"id": self.identifier ?: @"unknown",
@@ -206,17 +206,17 @@ NSInteger const AIR_CALLOUT_OPEN_ZINDEX_BASELINE = 999;
206
206
  @"longitude": @(self.coordinate.longitude)
207
207
  }
208
208
  };
209
-
209
+
210
210
  if (self.map.onMarkerSelect) self.map.onMarkerSelect(event);
211
211
  if (self.onSelect) self.onSelect(event);
212
-
212
+
213
213
  if (![self shouldShowCalloutView]) {
214
214
  // no callout to show
215
215
  return;
216
216
  }
217
-
217
+
218
218
  [self fillCalloutView:self.map.calloutView];
219
-
219
+
220
220
  // This is where we present our custom callout view... MapKit's built-in callout doesn't have the flexibility
221
221
  // we need, but a lot of work was done by Nick Farina to make this identical to MapKit's built-in.
222
222
  [self.map.calloutView presentCalloutFromRect:annotationView.bounds
@@ -244,12 +244,12 @@ NSInteger const AIR_CALLOUT_OPEN_ZINDEX_BASELINE = 999;
244
244
  - (void)_handleTap:(UITapGestureRecognizer *)recognizer {
245
245
  AIRMapMarker *marker = self;
246
246
  if (!marker) return;
247
-
247
+
248
248
  if (marker.selected) {
249
249
  CGPoint touchPoint = [recognizer locationInView:marker.map.calloutView];
250
250
  CGRect bubbleFrame = [self.calloutView convertRect:marker.map.calloutView.bounds toView:marker.map];
251
251
  CGPoint touchPointReal = [recognizer locationInView:self.calloutView];
252
-
252
+
253
253
  UIView *calloutView = [marker.map.calloutView hitTest:touchPoint withEvent:nil];
254
254
  if (calloutView) {
255
255
  // the callout (or its subview) got clicked, not the marker
@@ -263,7 +263,7 @@ NSInteger const AIR_CALLOUT_OPEN_ZINDEX_BASELINE = 999;
263
263
  }
264
264
  tmp = tmp.superview;
265
265
  }
266
-
266
+
267
267
  id event = @{
268
268
  @"action": calloutSubview ? @"callout-inside-press" : @"callout-press",
269
269
  @"id": marker.identifier ?: @"unknown",
@@ -278,7 +278,7 @@ NSInteger const AIR_CALLOUT_OPEN_ZINDEX_BASELINE = 999;
278
278
  @"height": @(bubbleFrame.size.height),
279
279
  }
280
280
  };
281
-
281
+
282
282
  if (calloutSubview) calloutSubview.onPress(event);
283
283
  if (marker.onCalloutPress) marker.onCalloutPress(event);
284
284
  if (marker.calloutView && marker.calloutView.onPress) marker.calloutView.onPress(event);
@@ -286,7 +286,7 @@ NSInteger const AIR_CALLOUT_OPEN_ZINDEX_BASELINE = 999;
286
286
  return;
287
287
  }
288
288
  }
289
-
289
+
290
290
  // the actual marker got clicked
291
291
  CGPoint touchPointReal = [recognizer locationInView:self.calloutView];
292
292
  id event = @{
@@ -301,10 +301,10 @@ NSInteger const AIR_CALLOUT_OPEN_ZINDEX_BASELINE = 999;
301
301
  @"y": @(touchPointReal.y),
302
302
  }
303
303
  };
304
-
304
+
305
305
  if (marker.onPress) marker.onPress(event);
306
306
  if (marker.map.onMarkerPress) marker.map.onMarkerPress(event);
307
-
307
+
308
308
  [marker.map selectAnnotation:marker animated:NO];
309
309
  }
310
310
 
@@ -314,10 +314,10 @@ NSInteger const AIR_CALLOUT_OPEN_ZINDEX_BASELINE = 999;
314
314
  [self setZIndex:_zIndexBeforeOpen];
315
315
  // hide the callout view
316
316
  [self.map.calloutView dismissCalloutAnimated:YES];
317
-
317
+
318
318
  [self setSelected:NO animated:NO];
319
319
  [self.map deselectAnnotation:self animated:NO];
320
-
320
+
321
321
  id event = @{
322
322
  @"action": @"marker-deselect",
323
323
  @"id": self.identifier ?: @"unknown",
@@ -326,7 +326,7 @@ NSInteger const AIR_CALLOUT_OPEN_ZINDEX_BASELINE = 999;
326
326
  @"longitude": @(self.coordinate.longitude)
327
327
  }
328
328
  };
329
-
329
+
330
330
  if (self.map.onMarkerDeselect) self.map.onMarkerDeselect(event);
331
331
  if (self.onDeselect) self.onDeselect(event);
332
332
  }
@@ -355,13 +355,13 @@ NSInteger const AIR_CALLOUT_OPEN_ZINDEX_BASELINE = 999;
355
355
  - (void)setImageSrc:(NSString *)imageSrc
356
356
  {
357
357
  _imageSrc = imageSrc;
358
-
358
+
359
359
  if (_reloadImageCancellationBlock) {
360
360
  _reloadImageCancellationBlock();
361
361
  _reloadImageCancellationBlock = nil;
362
362
  }
363
363
  __weak __typeof(self) weakSelf = self;
364
-
364
+
365
365
  _reloadImageCancellationBlock = [[[RCTBridge currentBridge] moduleForName:@"ImageLoader"] loadImageWithURLRequest:[RCTConvert NSURLRequest:_imageSrc]
366
366
  size:self.bounds.size
367
367
  scale:RCTScreenScale()
@@ -384,7 +384,7 @@ NSInteger const AIR_CALLOUT_OPEN_ZINDEX_BASELINE = 999;
384
384
  - (void)setPinColor:(UIColor *)pinColor
385
385
  {
386
386
  _pinColor = pinColor;
387
-
387
+
388
388
  if(_useLegacyPinView && [_pinView respondsToSelector:@selector(setPinTintColor:)]) {
389
389
  _pinView.pinTintColor = _pinColor;
390
390
  } else {
@@ -412,6 +412,19 @@ NSInteger const AIR_CALLOUT_OPEN_ZINDEX_BASELINE = 999;
412
412
  self.layer.zPosition = _zIndex;
413
413
  }
414
414
  }
415
+ - (void)layoutSubviews
416
+ {
417
+ [super layoutSubviews];
418
+
419
+ CGRect reactFrame = self.frame;
420
+
421
+ UIView *firstSubView = self.subviews.firstObject;
422
+ if (firstSubView && (CGRectGetWidth(firstSubView.frame) > CGRectGetWidth(reactFrame) ||
423
+ CGRectGetHeight(firstSubView.frame) > CGRectGetHeight(reactFrame))) {
424
+ reactFrame = firstSubView.frame;
425
+ }
426
+ [self reactSetFrame:reactFrame];
427
+ }
415
428
 
416
429
  - (void)setUseLegacyPinView:(BOOL)value {
417
430
  _useLegacyPinView = value;
@@ -422,16 +435,16 @@ NSInteger const AIR_CALLOUT_OPEN_ZINDEX_BASELINE = 999;
422
435
  NSLog(@"Animation already in progress. Rejecting new animation request.");
423
436
  return;
424
437
  }
425
-
438
+
426
439
  // Mark as animating
427
440
  _isAnimating = YES;
428
-
441
+
429
442
  // Store animation parameters
430
443
  _startCoordinate = self.coordinate;
431
444
  _endCoordinate = newCoordinate;
432
445
  _animationDuration = duration;
433
446
  _animationStartTime = [NSDate timeIntervalSinceReferenceDate];
434
-
447
+
435
448
  // Start a CADisplayLink
436
449
  if (_displayLink) {
437
450
  [_displayLink invalidate];
@@ -443,15 +456,15 @@ NSInteger const AIR_CALLOUT_OPEN_ZINDEX_BASELINE = 999;
443
456
  - (void)updatePosition {
444
457
  NSTimeInterval elapsed = [NSDate timeIntervalSinceReferenceDate] - _animationStartTime;
445
458
  CGFloat progress = MIN(elapsed / _animationDuration, 1.0);
446
-
459
+
447
460
  // Interpolate coordinates
448
461
  CLLocationDegrees currentLatitude = _startCoordinate.latitude + progress * (_endCoordinate.latitude - _startCoordinate.latitude);
449
462
  CLLocationDegrees currentLongitude = _startCoordinate.longitude + progress * (_endCoordinate.longitude - _startCoordinate.longitude);
450
-
463
+
451
464
  // Update annotation's coordinate
452
465
  CLLocationCoordinate2D currentCoordinate = CLLocationCoordinate2DMake(currentLatitude, currentLongitude);
453
466
  [self setValue:[NSValue valueWithMKCoordinate:currentCoordinate] forKey:@"coordinate"];
454
-
467
+
455
468
  // Stop the animation when complete
456
469
  if (progress == 1.0) {
457
470
  [_displayLink invalidate];
@@ -50,8 +50,8 @@
50
50
  - (void)setBoundsRect:(NSArray *)boundsRect {
51
51
  _boundsRect = boundsRect;
52
52
 
53
- _southWest = CLLocationCoordinate2DMake([boundsRect[0][0] doubleValue], [boundsRect[0][1] doubleValue]);
54
- _northEast = CLLocationCoordinate2DMake([boundsRect[1][0] doubleValue], [boundsRect[1][1] doubleValue]);
53
+ _northEast = CLLocationCoordinate2DMake([boundsRect[0][0] doubleValue], [boundsRect[0][1] doubleValue]);
54
+ _southWest = CLLocationCoordinate2DMake([boundsRect[1][0] doubleValue], [boundsRect[1][1] doubleValue]);
55
55
 
56
56
  MKMapPoint southWest = MKMapPointForCoordinate(_southWest);
57
57
  MKMapPoint northEast = MKMapPointForCoordinate(_northEast);
@@ -10,7 +10,7 @@
10
10
  #import <React/UIView+React.h>
11
11
 
12
12
  @implementation AIRMapWMSTile
13
-
13
+
14
14
  - (void)createTileOverlayAndRendererIfPossible
15
15
  {
16
16
  if (!_urlTemplateSet) return;
@@ -52,7 +52,7 @@
52
52
 
53
53
  @implementation AIRMapWMSTileOverlay
54
54
 
55
- - (id)initWithURLTemplate:(NSString *)URLTemplate
55
+ - (id)initWithURLTemplate:(NSString *)URLTemplate
56
56
  {
57
57
  self = [super initWithURLTemplate:URLTemplate];
58
58
  return self;
@@ -68,7 +68,7 @@
68
68
 
69
69
  @implementation AIRMapWMSTileCachedOverlay
70
70
 
71
- - (id)initWithURLTemplate:(NSString *)URLTemplate
71
+ - (id)initWithURLTemplate:(NSString *)URLTemplate
72
72
  {
73
73
  self = [super initWithURLTemplate:URLTemplate];
74
74
  return self;
@@ -82,7 +82,7 @@
82
82
  @end
83
83
 
84
84
 
85
- @implementation AIRMapWMSTileHelper
85
+ @implementation AIRMapWMSTileHelper
86
86
  + (NSURL *)URLForTilePath:(MKTileOverlayPath)path withURLTemplate:(NSString *)URLTemplate withTileSize:(NSInteger)tileSize
87
87
  {
88
88
  NSArray *bb = [self getBoundBox:path.x yAxis:path.y zoom:path.z];
@@ -102,15 +102,15 @@
102
102
  double MapY = 20037508.34789244;
103
103
  double FULL = 20037508.34789244 * 2;
104
104
  double tile = FULL / pow(2.0, (double)zoom);
105
-
105
+
106
106
  NSArray *result =[[NSArray alloc] initWithObjects:
107
107
  [NSNumber numberWithDouble:MapX + (double)x * tile],
108
108
  [NSNumber numberWithDouble:MapY - (double)(y + 1) * tile],
109
109
  [NSNumber numberWithDouble:MapX + (double)(x + 1) * tile],
110
110
  [NSNumber numberWithDouble:MapY - (double)y * tile],
111
111
  nil];
112
-
113
- return result;
112
+
113
+ return result;
114
114
  }
115
115
 
116
- @end
116
+ @end
@@ -0,0 +1,25 @@
1
+ //
2
+ // RNMapsGoogleMapView.h
3
+ //
4
+ //
5
+ // Created by Salah Ghanim on 23.11.24.
6
+ // Copyright © 2024 react-native-maps. All rights reserved.
7
+ //
8
+ #ifdef RCT_NEW_ARCH_ENABLED
9
+ #include "RNMapsDefines.h"
10
+
11
+ #if HAVE_GOOGLE_MAPS == 0
12
+
13
+ #import <React/RCTViewComponentView.h>
14
+ #import <UIKit/UIKit.h>
15
+
16
+ NS_ASSUME_NONNULL_BEGIN
17
+
18
+ @interface RNMapsGoogleMapView : RCTViewComponentView
19
+
20
+ @end
21
+
22
+ NS_ASSUME_NONNULL_END
23
+
24
+ #endif
25
+ #endif
@@ -0,0 +1,77 @@
1
+ //
2
+ // RNMapsGoogleMapView.mm
3
+ //
4
+ //
5
+ // Created by Salah Ghanim on 23.11.24.
6
+ // Copyright © 2024 react-native-maps. All rights reserved.
7
+ //
8
+ #include "RNMapsDefines.h"
9
+
10
+ #if HAVE_GOOGLE_MAPS == 0
11
+
12
+ #if __has_include(<ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>)
13
+ #import <ReactNativeMapsGenerated/RNMapsHostVewDelegate.h>
14
+ #import <ReactNativeMapsGenerated/ComponentDescriptors.h>
15
+ #import <ReactNativeMapsGenerated/EventEmitters.h>
16
+ #import <ReactNativeMapsGenerated/Props.h>
17
+ #import <ReactNativeMapsGenerated/RCTComponentViewHelpers.h>
18
+ #else
19
+ #import <react-native-maps-generated/ComponentDescriptors.h>
20
+ #import <react-native-maps-generated/EventEmitters.h>
21
+ #import <react-native-maps-generated/Props.h>
22
+ #import <react-native-maps-generated/RCTComponentViewHelpers.h>
23
+ #import <react-native-maps-generated/RNMapsHostVewDelegate.h>
24
+ #endif
25
+ #import "RCTFabricComponentsPlugins.h"
26
+ #import <React/RCTConversions.h>
27
+ #import "PlaceHolderGoogleMapView.h"
28
+
29
+ using namespace facebook::react;
30
+
31
+
32
+ @implementation RNMapsGoogleMapView
33
+
34
+
35
+ #pragma mark - JS Commands
36
+ - (void)animateToRegion:(NSString *)regionJSON duration:(NSInteger)duration{
37
+ }
38
+ - (void)setCamera:(NSString *)cameraJSON{
39
+ }
40
+
41
+ - (void)animateCamera:(NSString *)cameraJSON duration:(NSInteger)duration{
42
+ }
43
+
44
+ - (void)fitToElements:(NSString *)edgePaddingJSON animated:(BOOL)animated {
45
+ }
46
+
47
+ - (void)fitToSuppliedMarkers:(NSString *)markersJSON edgePaddingJSON:(NSString *)edgePaddingJSON animated:(BOOL)animated {
48
+ }
49
+ - (void)fitToCoordinates:(NSString *)coordinatesJSON edgePaddingJSON:(NSString *)edgePaddingJSON animated:(BOOL)animated {
50
+
51
+ }
52
+ - (void) setIndoorActiveLevelIndex:(NSInteger)activeLevelIndex
53
+ {
54
+
55
+ }
56
+
57
+ #pragma mark - Native commands
58
+
59
+ - (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args
60
+ {
61
+ }
62
+
63
+
64
+ + (ComponentDescriptorProvider)componentDescriptorProvider
65
+ {
66
+ return concreteComponentDescriptorProvider<RNMapsGoogleMapViewComponentDescriptor>();
67
+ }
68
+
69
+
70
+ @end
71
+
72
+ Class<RCTComponentViewProtocol> RNMapsGoogleMapViewCls(void)
73
+ {
74
+ return RNMapsGoogleMapView.class;
75
+ }
76
+
77
+ #endif
@@ -0,0 +1,25 @@
1
+ //
2
+ // RNMapsGoogleMapView.h
3
+ //
4
+ //
5
+ // Created by Salah Ghanim on 23.11.24.
6
+ // Copyright © 2024 react-native-maps. All rights reserved.
7
+ //
8
+ #ifdef RCT_NEW_ARCH_ENABLED
9
+ #include "RNMapsDefines.h"
10
+
11
+ #if HAVE_GOOGLE_MAPS == 0
12
+
13
+ #import <React/RCTViewComponentView.h>
14
+ #import <UIKit/UIKit.h>
15
+
16
+
17
+ NS_ASSUME_NONNULL_BEGIN
18
+ @interface RNMapsGooglePolygonView : RCTViewComponentView
19
+
20
+ @end
21
+
22
+ NS_ASSUME_NONNULL_END
23
+
24
+ #endif
25
+ #endif
@@ -0,0 +1,51 @@
1
+ //
2
+ // RNMapsGoogleMapView.mm
3
+ //
4
+ //
5
+ // Created by Salah Ghanim on 23.11.24.
6
+ // Copyright © 2024 react-native-maps. All rights reserved.
7
+ //
8
+ #include "RNMapsDefines.h"
9
+
10
+ #if HAVE_GOOGLE_MAPS == 0
11
+
12
+ #if __has_include(<ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>)
13
+ #import <ReactNativeMapsGenerated/RNMapsHostVewDelegate.h>
14
+ #import <ReactNativeMapsGenerated/ComponentDescriptors.h>
15
+ #import <ReactNativeMapsGenerated/EventEmitters.h>
16
+ #import <ReactNativeMapsGenerated/Props.h>
17
+ #import <ReactNativeMapsGenerated/RCTComponentViewHelpers.h>
18
+ #else
19
+ #import <react-native-maps-generated/ComponentDescriptors.h>
20
+ #import <react-native-maps-generated/EventEmitters.h>
21
+ #import <react-native-maps-generated/Props.h>
22
+ #import <react-native-maps-generated/RCTComponentViewHelpers.h>
23
+ #endif
24
+
25
+ #import "RCTFabricComponentsPlugins.h"
26
+ #import <React/RCTConversions.h>
27
+ #import "PlaceHolderPolygonView.h"
28
+
29
+ using namespace facebook::react;
30
+
31
+
32
+ @interface RNMapsGooglePolygonView () <RCTRNMapsGooglePolygonViewProtocol>
33
+ @end
34
+
35
+ @implementation RNMapsGooglePolygonView
36
+
37
+
38
+
39
+ + (ComponentDescriptorProvider)componentDescriptorProvider
40
+ {
41
+ return concreteComponentDescriptorProvider<RNMapsGooglePolygonComponentDescriptor>();
42
+ }
43
+
44
+ @end
45
+
46
+ Class<RCTComponentViewProtocol> RNMapsGooglePolygonCls(void)
47
+ {
48
+ return RNMapsGooglePolygonView.class;
49
+ }
50
+
51
+ #endif
@@ -1,13 +1,12 @@
1
- // RCTNativeLocalStorage.h
2
1
  // TurboModuleExample
3
2
  #ifdef RCT_NEW_ARCH_ENABLED
4
3
 
5
4
  #import <Foundation/Foundation.h>
6
- #import <ReactCodegen/RNMapsSpecs/RNMapsSpecs.h>
5
+
7
6
 
8
7
  NS_ASSUME_NONNULL_BEGIN
9
8
 
10
- @interface RNMapsAirModule : NSObject <NativeAirMapsModuleSpec>
9
+ @interface RNMapsAirModule : NSObject
11
10
 
12
11
  @end
13
12
 
@@ -5,6 +5,8 @@
5
5
  // Created by Salah Ghanim on 23.11.24.
6
6
  // Copyright © 2024 react-native-maps. All rights reserved.
7
7
  //
8
+ #ifdef RCT_NEW_ARCH_ENABLED
9
+
8
10
 
9
11
  #import "RNMapsAirModule.h"
10
12
  #import <React/RCTUIManager.h>
@@ -15,6 +17,16 @@
15
17
  #import <MapKit/MapKit.h>
16
18
  #import "RCTConvert+AirMap.h"
17
19
 
20
+ #if __has_include(<ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>)
21
+ #import <ReactNativeMapsGenerated/RNMapsSpecs.h>
22
+ #import <ReactNativeMapsGenerated/RNMapsHostVewDelegate.h>
23
+ #else
24
+ #import <react-native-maps-generated/RNMapsSpecs.h>
25
+ #import <react-native-maps-generated/RNMapsHostVewDelegate.h>
26
+ #endif
27
+ @interface RNMapsAirModule()<NativeAirMapsModuleSpec>
28
+ @end
29
+
18
30
  @implementation RNMapsAirModule
19
31
 
20
32
  @synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED;
@@ -148,3 +160,5 @@
148
160
 
149
161
  @end
150
162
 
163
+
164
+ #endif
@@ -0,0 +1 @@
1
+ #define HAVE_GOOGLE_MAPS 0
@@ -9,8 +9,11 @@
9
9
 
10
10
  #import <React/RCTViewComponentView.h>
11
11
  #import <UIKit/UIKit.h>
12
- #import "RNMapsHostVewDelegate.h"
13
-
12
+ #if __has_include(<ReactNativeMapsGenerated/RNMapsHostVewDelegate.h>)
13
+ #import <ReactNativeMapsGenerated/RNMapsHostVewDelegate.h>
14
+ #else
15
+ #import <react-native-maps-generated/RNMapsHostVewDelegate.h>
16
+ #endif
14
17
  @class AIRMap;
15
18
 
16
19
  NS_ASSUME_NONNULL_BEGIN
@@ -11,10 +11,20 @@
11
11
  #import "AIRMapMarker.h"
12
12
  #import "AIRMapManager.h"
13
13
  #import "RNMapsMarkerView.h"
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>
14
+ #if __has_include(<ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>)
15
+ #import <ReactNativeMapsGenerated/RNMapsSpecs.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/RNMapsSpecs.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
18
28
  #import "RCTFabricComponentsPlugins.h"
19
29
  #import <React/RCTConversions.h>
20
30
  #import "UIView+AirMap.h"
@@ -31,7 +41,7 @@ using namespace facebook::react;
31
41
 
32
42
 
33
43
  - (id<RNMapsAirModuleDelegate>) mapView {
34
- return _view;
44
+ return nil;
35
45
  }
36
46
 
37
47
  - (void) prepareForRecycle
@@ -157,7 +167,7 @@ using namespace facebook::react;
157
167
  mapViewEventEmitter->onMapReady(data);
158
168
  }
159
169
  };
160
- _view.onChange = [self](NSDictionary* dictionary) {
170
+ _view.onRegionChange = [self](NSDictionary* dictionary) {
161
171
  if (_eventEmitter) {
162
172
  NSDictionary* regionDict = dictionary[@"region"];
163
173
  auto mapViewEventEmitter = std::static_pointer_cast<RNMapsMapViewEventEmitter const>(_eventEmitter);