react-native-maps 1.21.0-alpha.14 → 1.21.0-alpha.141

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 (258) hide show
  1. package/android/build.gradle +73 -53
  2. package/android/gradlew +1 -2
  3. package/android/src/main/RCTAppDependencyProvider.h +25 -0
  4. package/android/src/main/RCTAppDependencyProvider.mm +55 -0
  5. package/android/src/main/RCTModulesConformingToProtocolsProvider.h +18 -0
  6. package/android/src/main/RCTModulesConformingToProtocolsProvider.mm +33 -0
  7. package/android/src/main/RCTThirdPartyComponentsProvider.h +16 -0
  8. package/android/src/main/RCTThirdPartyComponentsProvider.mm +28 -0
  9. package/android/src/main/ReactAppDependencyProvider.podspec +34 -0
  10. package/android/src/main/java/com/facebook/fbreact/specs/NativeAirMapsModuleSpec.java +63 -0
  11. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsCalloutManagerDelegate.java +35 -0
  12. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsCalloutManagerInterface.java +17 -0
  13. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsCircleManagerDelegate.java +49 -0
  14. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsCircleManagerInterface.java +23 -0
  15. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsGooglePolygonManagerDelegate.java +49 -0
  16. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsGooglePolygonManagerInterface.java +23 -0
  17. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerDelegate.java +209 -0
  18. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerInterface.java +74 -0
  19. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsMarkerManagerDelegate.java +104 -0
  20. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsMarkerManagerInterface.java +39 -0
  21. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsOverlayManagerDelegate.java +45 -0
  22. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsOverlayManagerInterface.java +22 -0
  23. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsPolylineManagerDelegate.java +58 -0
  24. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsPolylineManagerInterface.java +26 -0
  25. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsUrlTileManagerDelegate.java +62 -0
  26. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsUrlTileManagerInterface.java +27 -0
  27. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsWMSTileManagerDelegate.java +56 -0
  28. package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsWMSTileManagerInterface.java +25 -0
  29. package/android/src/main/java/com/rnmaps/fabric/CalloutManager.java +77 -0
  30. package/android/src/main/java/com/rnmaps/fabric/CircleManager.java +94 -0
  31. package/android/src/main/java/com/rnmaps/fabric/JSONUtil.java +86 -0
  32. package/android/src/main/java/com/rnmaps/fabric/MapViewManager.java +624 -0
  33. package/android/src/main/java/com/rnmaps/fabric/MarkerManager.java +258 -0
  34. package/android/src/main/java/com/rnmaps/fabric/NativeAirMapsModule.java +235 -2
  35. package/android/src/main/java/com/rnmaps/fabric/OverlayManager.java +101 -0
  36. package/android/src/main/java/com/rnmaps/fabric/PolygonManager.java +89 -0
  37. package/android/src/main/java/com/rnmaps/fabric/PolylineManager.java +121 -0
  38. package/android/src/main/java/com/rnmaps/fabric/UrlTileManager.java +124 -0
  39. package/android/src/main/java/com/rnmaps/fabric/WMSTileManager.java +114 -0
  40. package/android/src/main/java/com/rnmaps/fabric/event/OnCalloutPressEvent.java +25 -0
  41. package/android/src/main/java/com/rnmaps/fabric/event/OnDeselectEvent.java +28 -0
  42. package/android/src/main/java/com/rnmaps/fabric/event/OnDoublePressEvent.java +27 -0
  43. package/android/src/main/java/com/rnmaps/fabric/event/OnDragEndEvent.java +28 -0
  44. package/android/src/main/java/com/rnmaps/fabric/event/OnDragEvent.java +28 -0
  45. package/android/src/main/java/com/rnmaps/fabric/event/OnDragStartEvent.java +28 -0
  46. package/android/src/main/java/com/rnmaps/fabric/event/OnIndoorBuildingFocusedEvent.java +28 -0
  47. package/android/src/main/java/com/rnmaps/fabric/event/OnIndoorLevelActivatedEvent.java +28 -0
  48. package/android/src/main/java/com/rnmaps/fabric/event/OnKmlReadyEvent.java +28 -0
  49. package/android/src/main/java/com/rnmaps/fabric/event/OnLongPressEvent.java +28 -0
  50. package/android/src/main/java/com/rnmaps/fabric/event/OnMapLoadedEvent.java +29 -0
  51. package/android/src/main/java/com/rnmaps/fabric/event/OnMapReadyEvent.java +29 -0
  52. package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDeselectEvent.java +28 -0
  53. package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragEndEvent.java +28 -0
  54. package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragEvent.java +28 -0
  55. package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragStartEvent.java +28 -0
  56. package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerPressEvent.java +28 -0
  57. package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerSelectEvent.java +28 -0
  58. package/android/src/main/java/com/rnmaps/fabric/event/OnPanDragEvent.java +28 -0
  59. package/android/src/main/java/com/rnmaps/fabric/event/OnPoiClickEvent.java +27 -0
  60. package/android/src/main/java/com/rnmaps/fabric/event/OnPressEvent.java +27 -0
  61. package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeCompleteEvent.java +30 -0
  62. package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeEvent.java +48 -0
  63. package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeStartEvent.java +33 -0
  64. package/android/src/main/java/com/rnmaps/fabric/event/OnSelectEvent.java +28 -0
  65. package/android/src/main/java/com/rnmaps/fabric/event/OnUserLocationChangeEvent.java +28 -0
  66. package/android/src/main/java/com/rnmaps/maps/MapAirModulePackage.java +55 -3
  67. package/android/src/main/java/com/rnmaps/maps/MapCallout.java +18 -0
  68. package/android/src/main/java/com/rnmaps/maps/MapCircle.java +24 -0
  69. package/android/src/main/java/com/rnmaps/maps/MapManager.java +14 -14
  70. package/android/src/main/java/com/rnmaps/maps/MapMarker.java +637 -556
  71. package/android/src/main/java/com/rnmaps/maps/MapMarkerManager.java +3 -3
  72. package/android/src/main/java/com/rnmaps/maps/MapModule.java +206 -206
  73. package/android/src/main/java/com/rnmaps/maps/MapOverlay.java +247 -151
  74. package/android/src/main/java/com/rnmaps/maps/MapOverlayManager.java +23 -1
  75. package/android/src/main/java/com/rnmaps/maps/MapPolygon.java +31 -1
  76. package/android/src/main/java/com/rnmaps/maps/MapPolyline.java +207 -141
  77. package/android/src/main/java/com/rnmaps/maps/MapPolylineManager.java +1 -16
  78. package/android/src/main/java/com/rnmaps/maps/MapUrlTile.java +18 -18
  79. package/android/src/main/java/com/rnmaps/maps/MapUrlTileManager.java +10 -14
  80. package/android/src/main/java/com/rnmaps/maps/MapView.java +1649 -1336
  81. package/android/src/main/java/com/rnmaps/maps/MapWMSTile.java +3 -3
  82. package/android/src/main/java/com/rnmaps/maps/MapWMSTileManager.java +10 -10
  83. package/android/src/main/jni/CMakeLists.txt +36 -0
  84. package/android/src/main/jni/RNMapsSpecs-generated.cpp +68 -0
  85. package/android/src/main/jni/RNMapsSpecs.h +31 -0
  86. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.cpp +31 -0
  87. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.h +33 -0
  88. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/EventEmitters.cpp +979 -0
  89. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/EventEmitters.h +860 -0
  90. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/Props.cpp +227 -0
  91. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/Props.h +1297 -0
  92. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/RNMapsSpecsJSI-generated.cpp +74 -0
  93. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/RNMapsSpecsJSI.h +268 -0
  94. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.cpp +26 -0
  95. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.h +131 -0
  96. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/States.cpp +16 -0
  97. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/States.h +137 -0
  98. package/ios/AirGoogleMaps/AIRGoogleMap.h +10 -11
  99. package/ios/AirGoogleMaps/AIRGoogleMap.m +104 -71
  100. package/ios/AirGoogleMaps/AIRGoogleMapCircle.m +23 -11
  101. package/ios/AirGoogleMaps/AIRGoogleMapManager.h +1 -0
  102. package/ios/AirGoogleMaps/AIRGoogleMapManager.m +254 -250
  103. package/ios/AirGoogleMaps/AIRGoogleMapMarker.m +6 -3
  104. package/ios/AirGoogleMaps/AIRGoogleMapMarkerManager.m +1 -1
  105. package/ios/AirGoogleMaps/AIRGoogleMapPolygon.m +3 -0
  106. package/ios/AirGoogleMaps/AIRGoogleMapPolyline.h +0 -1
  107. package/ios/AirGoogleMaps/AIRGoogleMapPolyline.m +0 -7
  108. package/ios/AirGoogleMaps/AIRGoogleMapUrlTile.m +2 -2
  109. package/ios/AirGoogleMaps/AIRGoogleMapWMSTile.h +1 -1
  110. package/ios/AirGoogleMaps/AIRGoogleMapWMSTile.m +4 -4
  111. package/ios/AirGoogleMaps/RNMapsGoogleMapView.h +1 -1
  112. package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +123 -43
  113. package/ios/AirGoogleMaps/RNMapsGoogleMapViewManager.mm +16 -1
  114. package/ios/AirGoogleMaps/RNMapsGooglePolygonView.h +26 -0
  115. package/ios/AirGoogleMaps/RNMapsGooglePolygonView.mm +217 -0
  116. package/ios/AirGoogleMaps/RNMapsGooglePolygonViewManager.mm +26 -0
  117. package/ios/AirMaps/AIRMap.h +8 -9
  118. package/ios/AirMaps/AIRMap.m +222 -239
  119. package/ios/AirMaps/AIRMapManager.m +10 -7
  120. package/ios/AirMaps/AIRMapMarker.h +1 -0
  121. package/ios/AirMaps/AIRMapMarker.m +142 -67
  122. package/ios/AirMaps/AIRMapOverlay.m +2 -2
  123. package/ios/AirMaps/Callout/SMCalloutView.m +1 -1
  124. package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMapView.h +28 -0
  125. package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMapView.mm +68 -0
  126. package/ios/AirMaps/FabricPlaceholders/PlaceHolderPolygonView.h +25 -0
  127. package/ios/AirMaps/FabricPlaceholders/PlaceHolderPolygonView.mm +43 -0
  128. package/ios/AirMaps/RNMapsAirModule.h +1 -1
  129. package/ios/AirMaps/RNMapsAirModule.mm +4 -3
  130. package/ios/AirMaps/RNMapsDefines.h +1 -0
  131. package/ios/AirMaps/RNMapsMapView.h +1 -1
  132. package/ios/AirMaps/RNMapsMapView.mm +119 -95
  133. package/ios/AirMaps/RNMapsMapViewManager.mm +19 -1
  134. package/ios/AirMaps/RNMapsMarkerView.h +24 -0
  135. package/ios/AirMaps/RNMapsMarkerView.mm +430 -0
  136. package/ios/AirMaps/RNMapsMarkerViewManager.mm +28 -0
  137. package/ios/AirMaps.xcodeproj/project.pbxproj +20 -0
  138. package/ios/generated/RCTAppDependencyProvider.h +25 -0
  139. package/ios/generated/RCTAppDependencyProvider.mm +55 -0
  140. package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
  141. package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
  142. package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
  143. package/ios/generated/RCTThirdPartyComponentsProvider.mm +26 -0
  144. package/ios/{AirMaps → generated}/RNMapsAirModuleDelegate.h +2 -2
  145. package/ios/generated/RNMapsSpecs/ComponentDescriptors.cpp +29 -0
  146. package/ios/generated/RNMapsSpecs/ComponentDescriptors.h +31 -0
  147. package/ios/generated/RNMapsSpecs/EventEmitters.cpp +977 -0
  148. package/ios/generated/RNMapsSpecs/EventEmitters.h +846 -0
  149. package/ios/generated/RNMapsSpecs/Props.cpp +194 -0
  150. package/ios/generated/RNMapsSpecs/Props.h +1224 -0
  151. package/ios/generated/RNMapsSpecs/RCTComponentViewHelpers.h +591 -0
  152. package/ios/generated/RNMapsSpecs/RNMapsSpecs-generated.mm +92 -0
  153. package/ios/generated/RNMapsSpecs/RNMapsSpecs.h +137 -0
  154. package/ios/generated/RNMapsSpecs/ShadowNodes.cpp +24 -0
  155. package/ios/generated/RNMapsSpecs/ShadowNodes.h +109 -0
  156. package/ios/generated/RNMapsSpecs/States.cpp +16 -0
  157. package/ios/generated/RNMapsSpecs/States.h +113 -0
  158. package/ios/generated/RNMapsSpecsJSI-generated.cpp +74 -0
  159. package/ios/generated/RNMapsSpecsJSI.h +268 -0
  160. package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
  161. package/package.json +26 -19
  162. package/react-native-google-maps.podspec +26 -0
  163. package/react-native-maps-generated.podspec +31 -0
  164. package/react-native-maps.podspec +55 -15
  165. package/react-native.config.js +16 -0
  166. package/src/AnimatedRegion.ts +169 -0
  167. package/src/Geojson.tsx +541 -0
  168. package/src/MapCallout.tsx +77 -0
  169. package/src/MapCalloutSubview.tsx +64 -0
  170. package/src/MapCircle.tsx +162 -0
  171. package/src/MapHeatmap.tsx +125 -0
  172. package/src/MapLocalTile.tsx +60 -0
  173. package/src/MapMarker.tsx +531 -0
  174. package/src/MapMarkerNativeComponent.ts +51 -0
  175. package/src/MapOverlay.tsx +178 -0
  176. package/src/MapPolygon.tsx +188 -0
  177. package/src/MapPolygon.types.ts +25 -0
  178. package/src/MapPolyline.tsx +215 -0
  179. package/src/MapUrlTile.tsx +169 -0
  180. package/src/MapView.tsx +1230 -0
  181. package/src/MapView.types.ts +212 -0
  182. package/src/MapView.web.ts +2 -0
  183. package/src/MapViewNativeComponent.ts +86 -0
  184. package/src/MapWMSTile.tsx +148 -0
  185. package/src/ProviderConstants.ts +2 -0
  186. package/src/createFabricMap.tsx +253 -0
  187. package/src/decorateMapComponent.ts +227 -0
  188. package/src/fixImageProp.ts +17 -0
  189. package/src/index.ts +52 -0
  190. package/src/sharedTypes.ts +101 -0
  191. package/src/specs/NativeAirMapsModule.ts +36 -0
  192. package/src/specs/NativeComponentCallout.ts +63 -0
  193. package/src/specs/NativeComponentCircle.ts +93 -0
  194. package/src/specs/NativeComponentGoogleMapView.ts +922 -0
  195. package/src/specs/NativeComponentGooglePolygon.ts +94 -0
  196. package/src/specs/NativeComponentMapView.ts +1100 -0
  197. package/src/specs/NativeComponentMarker.ts +326 -0
  198. package/src/specs/NativeComponentOverlay.ts +98 -0
  199. package/src/specs/NativeComponentPolyline.ts +124 -0
  200. package/src/specs/NativeComponentUrlTile.ts +128 -0
  201. package/src/specs/NativeComponentWMSTile.ts +107 -0
  202. package/lib/AnimatedRegion.d.ts +0 -19
  203. package/lib/AnimatedRegion.js +0 -134
  204. package/lib/Geojson.d.ts +0 -204
  205. package/lib/Geojson.js +0 -166
  206. package/lib/MapCallout.d.ts +0 -40
  207. package/lib/MapCallout.js +0 -51
  208. package/lib/MapCalloutSubview.d.ts +0 -34
  209. package/lib/MapCalloutSubview.js +0 -48
  210. package/lib/MapCircle.d.ts +0 -117
  211. package/lib/MapCircle.js +0 -53
  212. package/lib/MapHeatmap.d.ts +0 -78
  213. package/lib/MapHeatmap.js +0 -59
  214. package/lib/MapLocalTile.d.ts +0 -35
  215. package/lib/MapLocalTile.js +0 -44
  216. package/lib/MapMarker.d.ts +0 -309
  217. package/lib/MapMarker.js +0 -116
  218. package/lib/MapMarkerNativeComponent.d.ts +0 -15
  219. package/lib/MapMarkerNativeComponent.js +0 -17
  220. package/lib/MapOverlay.d.ts +0 -87
  221. package/lib/MapOverlay.js +0 -63
  222. package/lib/MapPolygon.d.ts +0 -140
  223. package/lib/MapPolygon.js +0 -53
  224. package/lib/MapPolygon.types.d.ts +0 -18
  225. package/lib/MapPolygon.types.js +0 -2
  226. package/lib/MapPolyline.d.ts +0 -156
  227. package/lib/MapPolyline.js +0 -53
  228. package/lib/MapUrlTile.d.ts +0 -134
  229. package/lib/MapUrlTile.js +0 -44
  230. package/lib/MapView.d.ts +0 -715
  231. package/lib/MapView.js +0 -447
  232. package/lib/MapView.types.d.ts +0 -161
  233. package/lib/MapView.types.js +0 -2
  234. package/lib/MapView.web.d.ts +0 -1
  235. package/lib/MapView.web.js +0 -9
  236. package/lib/MapViewNativeComponent.d.ts +0 -18
  237. package/lib/MapViewNativeComponent.js +0 -19
  238. package/lib/MapWMSTile.d.ts +0 -116
  239. package/lib/MapWMSTile.js +0 -44
  240. package/lib/ProviderConstants.d.ts +0 -2
  241. package/lib/ProviderConstants.js +0 -5
  242. package/lib/createFabricMap.d.ts +0 -23
  243. package/lib/createFabricMap.js +0 -175
  244. package/lib/decorateMapComponent.d.ts +0 -36
  245. package/lib/decorateMapComponent.js +0 -80
  246. package/lib/index.d.ts +0 -38
  247. package/lib/index.js +0 -81
  248. package/lib/sharedTypes.d.ts +0 -81
  249. package/lib/sharedTypes.js +0 -2
  250. package/lib/sharedTypesInternal.js +0 -2
  251. package/lib/specs/NativeAirMapsModule.d.ts +0 -31
  252. package/lib/specs/NativeAirMapsModule.js +0 -4
  253. package/lib/specs/NativeComponentGoogleMapView.d.ts +0 -713
  254. package/lib/specs/NativeComponentGoogleMapView.js +0 -21
  255. package/lib/specs/NativeComponentMapView.d.ts +0 -855
  256. package/lib/specs/NativeComponentMapView.js +0 -21
  257. /package/ios/{AirMaps → generated}/RNMapsHostVewDelegate.h +0 -0
  258. /package/{lib/sharedTypesInternal.d.ts → src/sharedTypesInternal.ts} +0 -0
@@ -1,309 +0,0 @@
1
- import * as React from 'react';
2
- import { Animated, ViewProps, ImageURISource, ImageRequireSource } from 'react-native';
3
- import { MapManagerCommand, NativeComponent, ProviderContext, UIManagerCommand } from './decorateMapComponent';
4
- import { MapMarkerNativeComponentType } from './MapMarkerNativeComponent';
5
- import { CalloutPressEvent, LatLng, MarkerDeselectEvent, MarkerDragEvent, MarkerDragStartEndEvent, MarkerPressEvent, MarkerSelectEvent, Point } from './sharedTypes';
6
- import { Modify } from './sharedTypesInternal';
7
- type AppleMarkerVisibility = 'hidden' | 'adaptive' | 'visible';
8
- export type MapMarkerProps = ViewProps & {
9
- /**
10
- * Sets the anchor point for the marker.
11
- * The anchor specifies the point in the icon image that is anchored to the marker's position on the Earth's surface.
12
- *
13
- * The anchor point is specified in the continuous space [0.0, 1.0] x [0.0, 1.0],
14
- * where (0, 0) is the top-left corner of the image, and (1, 1) is the bottom-right corner.
15
- *
16
- * The anchoring point in a W x H image is the nearest discrete grid point in a (W + 1) x (H + 1) grid, obtained by scaling the then rounding.
17
- * For example, in a 4 x 2 image, the anchor point (0.7, 0.6) resolves to the grid point at (3, 1).
18
- *
19
- * @default {x: 0.5, y: 1.0}
20
- * @platform iOS: Google Maps only. For Apple Maps, see the `centerOffset` prop
21
- * @platform Android: Supported
22
- */
23
- anchor?: Point;
24
- /**
25
- * Specifies the point in the marker image at which to anchor the callout when it is displayed.
26
- * This is specified in the same coordinate system as the anchor.
27
- *
28
- * See the `anchor` prop for more details.
29
- *
30
- * @default {x: 0.5, y: 0.0}
31
- * @platform iOS: Google Maps only. For Apple Maps, see the `calloutOffset` prop
32
- * @platform Android: Supported
33
- */
34
- calloutAnchor?: Point;
35
- /**
36
- * The offset (in points) at which to place the callout bubble.
37
- * When this property is set to (0, 0),
38
- * the anchor point of the callout bubble is placed on the top-center point of the marker view’s frame.
39
- *
40
- * Specifying positive offset values moves the callout bubble down and to the right,
41
- * while specifying negative values moves it up and to the left
42
- *
43
- * @default {x: 0.0, y: 0.0}
44
- * @platform iOS: Apple Maps only. For Google Maps, see the `calloutAnchor` prop
45
- * @platform Android: Not supported. See see the `calloutAnchor` prop
46
- */
47
- calloutOffset?: Point;
48
- /**
49
- * The offset (in points) at which to display the annotation view.
50
- *
51
- * By default, the center point of an annotation view is placed at the coordinate point of the associated annotation.
52
- *
53
- * Positive offset values move the annotation view down and to the right, while negative values move it up and to the left.
54
- *
55
- * @default {x: 0.0, y: 0.0}
56
- * @platform iOS: Apple Maps only. For Google Maps, see the `anchor` prop
57
- * @platform Android: Not supported. See see the `anchor` prop
58
- */
59
- centerOffset?: Point;
60
- /**
61
- * The coordinate for the marker.
62
- *
63
- * @platform iOS: Supported
64
- * @platform Android: Supported
65
- */
66
- coordinate: LatLng;
67
- /**
68
- * The description of the marker.
69
- *
70
- * This is only used if the <Marker /> component has no children that are a `<Callout />`,
71
- * in which case the default callout behavior will be used,
72
- * which will show both the `title` and the `description`, if provided.
73
- *
74
- * @platform iOS: Supported
75
- * @platform Android: Supported
76
- */
77
- description?: string;
78
- /**
79
- * if `true` allows the marker to be draggable (re-positioned).
80
- *
81
- * @default false
82
- * @platform iOS: Supported
83
- * @platform Android: Supported
84
- */
85
- draggable?: boolean;
86
- /**
87
- * Sets whether this marker should be flat against the map true or a billboard facing the camera.
88
- *
89
- * @default false
90
- * @platform iOS: Google Maps only
91
- * @platform Android: Supported
92
- */
93
- flat?: boolean;
94
- /**
95
- * Marker icon to render (equivalent to `icon` property of GMSMarker Class).
96
- * Only local image resources are allowed to be used.
97
- *
98
- * @platform iOS: Google Maps only
99
- * @platform Android: Supported
100
- */
101
- icon?: ImageURISource | ImageRequireSource;
102
- /**
103
- * A string that can be used to identify this marker.
104
- *
105
- * @platform iOS: Supported
106
- * @platform Android: Supported
107
- */
108
- identifier?: string;
109
- /**
110
- * A custom image to be used as the marker's icon. Only local image resources are allowed to be used.
111
- *
112
- * @platform iOS: Supported
113
- * @platform Android: Supported
114
- */
115
- image?: ImageURISource | ImageRequireSource;
116
- /**
117
- * When true, the marker will be pre-selected.
118
- * Setting this to true allows the user to drag the marker without needing to tap on it first to focus it.
119
- *
120
- * @default false
121
- * @platform iOS: Apple Maps only
122
- * @platform Android: Not supported
123
- */
124
- isPreselected?: boolean;
125
- /**
126
- * Callback that is called when the user taps the callout view.
127
- *
128
- * @platform iOS: Apple Maps only
129
- * @platform Android: Supported
130
- */
131
- onCalloutPress?: (event: CalloutPressEvent) => void;
132
- /**
133
- * Callback that is called when the marker is deselected, before the callout is hidden.
134
- *
135
- * @platform iOS: Apple Maps only
136
- * @platform Android: Not supported
137
- */
138
- onDeselect?: (event: MarkerDeselectEvent) => void;
139
- /**
140
- * Callback called continuously as the marker is dragged
141
- *
142
- * @platform iOS: Apple Maps only
143
- * @platform Android: Supported
144
- */
145
- onDrag?: (event: MarkerDragEvent) => void;
146
- /**
147
- * Callback that is called when a drag on the marker finishes.
148
- * This is usually the point you will want to setState on the marker's coordinate again
149
- *
150
- * @platform iOS: Apple Maps only
151
- * @platform Android: Supported
152
- */
153
- onDragEnd?: (event: MarkerDragStartEndEvent) => void;
154
- /**
155
- * Callback that is called when the user initiates a drag on the marker (if it is draggable)
156
- *
157
- * @platform iOS: Apple Maps only
158
- * @platform Android: Supported
159
- */
160
- onDragStart?: (event: MarkerDragStartEndEvent) => void;
161
- /**
162
- * Callback that is called when the marker is tapped by the user.
163
- *
164
- * @platform iOS: Supported
165
- * @platform Android: Supported
166
- */
167
- onPress?: (event: MarkerPressEvent) => void;
168
- /**
169
- * Callback that is called when the marker becomes selected.
170
- * This will be called when the callout for that marker is about to be shown.
171
- *
172
- * @platform iOS: Supported.
173
- * @platform Android: Supported
174
- */
175
- onSelect?: (event: MarkerSelectEvent) => void;
176
- /**
177
- * The marker's opacity between 0.0 and 1.0.
178
- *
179
- * @default 1.0
180
- * @platform iOS: Supported
181
- * @platform Android: Supported
182
- */
183
- opacity?: number;
184
- /**
185
- * If no custom marker view or custom image is provided, the platform default pin will be used, which can be customized by this color.
186
- * Ignored if a custom marker is being used.<br/><br/>
187
- * For Android, the set of available colors is limited. Unsupported colors will fall back to red.
188
- * See [#887](https://github.com/react-community/react-native-maps/issues/887) for more information.
189
- *
190
- * @platform iOS: Supported
191
- * @platform Android: Supported
192
- */
193
- pinColor?: string;
194
- /**
195
- * A float number indicating marker's rotation angle, in degrees.
196
- *
197
- * @default 0
198
- * @platform iOS: Google Maps only
199
- * @platform Android: Supported
200
- */
201
- rotation?: number;
202
- /**
203
- * Sets whether this marker should propagate `onPress` events.
204
- * Enabling it will stop the parent `MapView`'s `onPress` from being called.
205
- *
206
- * Android does not propagate `onPress` events.
207
- *
208
- * See [#1132](https://github.com/react-community/react-native-maps/issues/1132) for more information.
209
- *
210
- * @default false
211
- * @platform iOS: Apple Maps only
212
- * @platform Android: Not supported
213
- */
214
- stopPropagation?: boolean;
215
- /**
216
- * Sets whether marker should be tappable.
217
- * If set to false, the marker will not have onPress events.
218
- *
219
- * @default true
220
- * @platform iOS: Google Maps only
221
- * @platform Android: Not supported
222
- */
223
- tappable?: boolean;
224
- /**
225
- * The title of the marker.
226
- * This is only used if the <Marker /> component has no `<Callout />` children.
227
- *
228
- * If the marker has <Callout /> children, default callout behavior will be used,
229
- * which will show both the `title` and the `description`, if provided.
230
- *
231
- * @platform iOS: Supported
232
- * @platform Android: Supported
233
- */
234
- title?: string;
235
- /**
236
- * Sets whether this marker should track view changes in info window.
237
- * Enabling it will let marker change content of info window after first render pass, but will lead to decreased performance,
238
- * so it's recommended to disable it whenever you don't need it.
239
- * **Note**: iOS Google Maps only.
240
- *
241
- * @default false
242
- * @platform iOS: Google Maps only
243
- * @platform Android: Not supported
244
- */
245
- tracksInfoWindowChanges?: boolean;
246
- /**
247
- * Sets whether this marker should track view changes.
248
- * It's recommended to turn it off whenever it's possible to improve custom marker performance.
249
- *
250
- * @default true
251
- * @platform iOS: Google Maps only
252
- * @platform Android: Supported
253
- */
254
- tracksViewChanges?: boolean;
255
- /**
256
- * The order in which this tile overlay is drawn with respect to other overlays.
257
- * An overlay with a larger z-index is drawn over overlays with smaller z-indices.
258
- * The order of overlays with the same z-index is arbitrary.
259
- *
260
- * @platform iOS: Supported
261
- * @platform Android: Supported
262
- */
263
- zIndex?: number;
264
- /**
265
- * Visibility of the title text rendered beneath Marker balloon
266
- * @platform iOS: Apple Maps only
267
- * @platform Android: Not supported
268
- */
269
- titleVisibility?: AppleMarkerVisibility;
270
- /**
271
- * Visibility of the subtitle text rendered beneath Marker balloon
272
- * @platform iOS: Apple Maps only
273
- * @platform Android: Not supported
274
- */
275
- subtitleVisibility?: AppleMarkerVisibility;
276
- /**
277
- * Indicate type of default markers if it's true MKPinAnnotationView will be used and MKMarkerAnnotationView if it's false
278
- * It doesn't change anything if you are using custom Markers
279
- * @platform iOS: Apple Maps only
280
- * @platform Android: Not supported
281
- */
282
- useLegacyPinView?: boolean;
283
- };
284
- type OmittedProps = Omit<MapMarkerProps, 'stopPropagation'>;
285
- export type NativeProps = Modify<OmittedProps, {
286
- icon?: string;
287
- image?: MapMarkerProps['image'] | string;
288
- }> & {
289
- ref: React.RefObject<MapMarkerNativeComponentType>;
290
- };
291
- export declare class MapMarker extends React.Component<MapMarkerProps> {
292
- context: React.ContextType<typeof ProviderContext>;
293
- getNativeComponent: () => NativeComponent<NativeProps>;
294
- getMapManagerCommand: (name: string) => MapManagerCommand;
295
- getUIManagerCommand: (name: string) => UIManagerCommand;
296
- static Animated: Animated.AnimatedComponent<typeof MapMarker>;
297
- private marker;
298
- constructor(props: MapMarkerProps);
299
- setNativeProps(props: Partial<NativeProps>): void;
300
- showCallout(): void;
301
- hideCallout(): void;
302
- setCoordinates(coordinate: LatLng): void;
303
- redrawCallout(): void;
304
- animateMarkerToCoordinate(coordinate: LatLng, duration?: number): void;
305
- redraw(): void;
306
- render(): React.JSX.Element;
307
- }
308
- declare const _default: typeof MapMarker;
309
- export default _default;
package/lib/MapMarker.js DELETED
@@ -1,116 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.MapMarker = void 0;
27
- const React = __importStar(require("react"));
28
- const react_native_1 = require("react-native");
29
- const decorateMapComponent_1 = __importStar(require("./decorateMapComponent"));
30
- const MapMarkerNativeComponent_1 = require("./MapMarkerNativeComponent");
31
- class MapMarker extends React.Component {
32
- getNativeComponent;
33
- getMapManagerCommand;
34
- getUIManagerCommand;
35
- static Animated;
36
- marker;
37
- constructor(props) {
38
- super(props);
39
- this.marker = React.createRef();
40
- this.showCallout = this.showCallout.bind(this);
41
- this.hideCallout = this.hideCallout.bind(this);
42
- this.setCoordinates = this.setCoordinates.bind(this);
43
- this.redrawCallout = this.redrawCallout.bind(this);
44
- this.animateMarkerToCoordinate = this.animateMarkerToCoordinate.bind(this);
45
- }
46
- setNativeProps(props) {
47
- // @ts-ignore
48
- this.marker.current?.setNativeProps(props);
49
- }
50
- showCallout() {
51
- if (this.marker.current) {
52
- MapMarkerNativeComponent_1.Commands.showCallout(this.marker.current);
53
- }
54
- }
55
- hideCallout() {
56
- if (this.marker.current) {
57
- MapMarkerNativeComponent_1.Commands.hideCallout(this.marker.current);
58
- }
59
- }
60
- setCoordinates(coordinate) {
61
- if (this.marker.current) {
62
- MapMarkerNativeComponent_1.Commands.setCoordinates(this.marker.current, coordinate);
63
- }
64
- }
65
- redrawCallout() {
66
- if (this.marker.current) {
67
- MapMarkerNativeComponent_1.Commands.redrawCallout(this.marker.current);
68
- }
69
- }
70
- animateMarkerToCoordinate(coordinate, duration = 500) {
71
- if (this.marker.current) {
72
- MapMarkerNativeComponent_1.Commands.animateMarkerToCoordinate(this.marker.current, coordinate, duration);
73
- }
74
- }
75
- redraw() {
76
- if (this.marker.current) {
77
- MapMarkerNativeComponent_1.Commands.redraw(this.marker.current);
78
- }
79
- }
80
- render() {
81
- const { stopPropagation = false } = this.props;
82
- let image;
83
- if (this.props.image) {
84
- image = react_native_1.Image.resolveAssetSource(this.props.image) || {};
85
- image = image.uri || this.props.image;
86
- }
87
- let icon;
88
- if (this.props.icon) {
89
- icon = react_native_1.Image.resolveAssetSource(this.props.icon) || {};
90
- icon = icon.uri;
91
- }
92
- const AIRMapMarker = this.getNativeComponent();
93
- return (<AIRMapMarker {...this.props} ref={this.marker} image={image} icon={icon} style={[styles.marker, this.props.style]} onPress={event => {
94
- if (stopPropagation) {
95
- event.stopPropagation();
96
- }
97
- if (this.props.onPress) {
98
- this.props.onPress(event);
99
- }
100
- }}/>);
101
- }
102
- }
103
- exports.MapMarker = MapMarker;
104
- const styles = react_native_1.StyleSheet.create({
105
- marker: {
106
- position: 'absolute',
107
- backgroundColor: 'transparent',
108
- },
109
- });
110
- MapMarker.Animated = react_native_1.Animated.createAnimatedComponent(MapMarker);
111
- exports.default = (0, decorateMapComponent_1.default)(MapMarker, 'Marker', {
112
- google: {
113
- ios: decorateMapComponent_1.SUPPORTED,
114
- android: decorateMapComponent_1.USES_DEFAULT_IMPLEMENTATION,
115
- },
116
- });
@@ -1,15 +0,0 @@
1
- /// <reference types="react" />
2
- import type { HostComponent } from 'react-native';
3
- import { NativeProps } from './MapMarker';
4
- import { LatLng } from './sharedTypes';
5
- export type MapMarkerNativeComponentType = HostComponent<NativeProps>;
6
- interface NativeCommands {
7
- showCallout: (viewRef: NonNullable<React.RefObject<MapMarkerNativeComponentType>['current']>) => void;
8
- hideCallout: (viewRef: NonNullable<React.RefObject<MapMarkerNativeComponentType>['current']>) => void;
9
- setCoordinates: (viewRef: NonNullable<React.RefObject<MapMarkerNativeComponentType>['current']>, coordinate: LatLng) => void;
10
- redrawCallout: (viewRef: NonNullable<React.RefObject<MapMarkerNativeComponentType>['current']>) => void;
11
- animateMarkerToCoordinate: (viewRef: NonNullable<React.RefObject<MapMarkerNativeComponentType>['current']>, coordinate: LatLng, duration: number) => void;
12
- redraw: (viewRef: NonNullable<React.RefObject<MapMarkerNativeComponentType>['current']>) => void;
13
- }
14
- export declare const Commands: NativeCommands;
15
- export {};
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Commands = void 0;
7
- const codegenNativeCommands_1 = __importDefault(require("react-native/Libraries/Utilities/codegenNativeCommands"));
8
- exports.Commands = (0, codegenNativeCommands_1.default)({
9
- supportedCommands: [
10
- 'showCallout',
11
- 'hideCallout',
12
- 'redrawCallout',
13
- 'animateMarkerToCoordinate',
14
- 'redraw',
15
- 'setCoordinates',
16
- ],
17
- });
@@ -1,87 +0,0 @@
1
- import * as React from 'react';
2
- import { Animated, ViewProps, ImageURISource, ImageRequireSource, NativeSyntheticEvent } from 'react-native';
3
- import { MapManagerCommand, NativeComponent, ProviderContext, UIManagerCommand } from './decorateMapComponent';
4
- import { LatLng, Point } from './sharedTypes';
5
- import { Modify } from './sharedTypesInternal';
6
- export type MapOverlayProps = ViewProps & {
7
- /**
8
- * The bearing in degrees clockwise from north. Values outside the range [0, 360) will be normalized.
9
- *
10
- * @default 0
11
- * @platform iOS: Google Maps only
12
- * @platform Android: Supported
13
- */
14
- bearing?: number;
15
- /**
16
- * The coordinates for the image (left-top corner, right-bottom corner). ie.```[[lat, long], [lat, long]]```
17
- *
18
- * @platform iOS: Supported
19
- * @platform Android: Supported
20
- */
21
- bounds: [Coordinate, Coordinate];
22
- /**
23
- * A custom image to be used as the overlay.
24
- * Only required local image resources and uri (as for images located in the net) are allowed to be used.
25
- *
26
- * @platform iOS: Supported
27
- * @platform Android: Supported
28
- */
29
- image: ImageURISource | ImageRequireSource;
30
- /**
31
- * Callback that is called when the user presses on the overlay
32
- *
33
- * @platform iOS: Apple Maps only
34
- * @platform Android: Supported
35
- */
36
- onPress?: (event: OverlayPressEvent) => void;
37
- /**
38
- * The opacity of the overlay.
39
- *
40
- * @default 1
41
- * @platform iOS: Google Maps only
42
- * @platform Android: Supported
43
- */
44
- opacity?: number;
45
- /**
46
- * Boolean to allow an overlay to be tappable and use the onPress function.
47
- *
48
- * @default false
49
- * @platform iOS: Not supported
50
- * @platform Android: Supported
51
- */
52
- tappable?: boolean;
53
- };
54
- type NativeProps = Modify<MapOverlayProps, {
55
- image?: string;
56
- }>;
57
- export declare class MapOverlay extends React.Component<MapOverlayProps> {
58
- context: React.ContextType<typeof ProviderContext>;
59
- getNativeComponent: () => NativeComponent<NativeProps>;
60
- getMapManagerCommand: (name: string) => MapManagerCommand;
61
- getUIManagerCommand: (name: string) => UIManagerCommand;
62
- static Animated: Animated.AnimatedComponent<typeof MapOverlay>;
63
- render(): React.JSX.Element;
64
- }
65
- type Coordinate = [number, number];
66
- type OverlayPressEvent = NativeSyntheticEvent<{
67
- /**
68
- * @platform iOS: Apple Maps: `image-overlay-press`
69
- * @platform Android: `overlay-press`
70
- */
71
- action: 'overlay-press' | 'image-overlay-press';
72
- /**
73
- * @platform iOS: Apple Maps
74
- */
75
- name?: string;
76
- /**
77
- * @platform iOS: Apple Maps
78
- * @platform Android
79
- */
80
- coordinate?: LatLng;
81
- /**
82
- * @platform Android
83
- */
84
- position?: Point;
85
- }>;
86
- declare const _default: typeof MapOverlay;
87
- export default _default;
package/lib/MapOverlay.js DELETED
@@ -1,63 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.MapOverlay = void 0;
27
- const React = __importStar(require("react"));
28
- const react_native_1 = require("react-native");
29
- const decorateMapComponent_1 = __importStar(require("./decorateMapComponent"));
30
- class MapOverlay extends React.Component {
31
- getNativeComponent;
32
- getMapManagerCommand;
33
- getUIManagerCommand;
34
- static Animated;
35
- render() {
36
- const { opacity = 1.0 } = this.props;
37
- let image;
38
- if (typeof this.props.image !== 'number' &&
39
- this.props.image.uri?.startsWith('http')) {
40
- image = this.props.image.uri;
41
- }
42
- else {
43
- const sourceAsset = react_native_1.Image.resolveAssetSource(this.props.image) || {};
44
- image = sourceAsset.uri;
45
- }
46
- const AIRMapOverlay = this.getNativeComponent();
47
- return (<AIRMapOverlay {...this.props} opacity={opacity} image={image} style={[styles.overlay, this.props.style]}/>);
48
- }
49
- }
50
- exports.MapOverlay = MapOverlay;
51
- const styles = react_native_1.StyleSheet.create({
52
- overlay: {
53
- position: 'absolute',
54
- backgroundColor: 'transparent',
55
- },
56
- });
57
- MapOverlay.Animated = react_native_1.Animated.createAnimatedComponent(MapOverlay);
58
- exports.default = (0, decorateMapComponent_1.default)(MapOverlay, 'Overlay', {
59
- google: {
60
- ios: decorateMapComponent_1.SUPPORTED,
61
- android: decorateMapComponent_1.USES_DEFAULT_IMPLEMENTATION,
62
- },
63
- });