react-native-maps 1.21.0-alpha.7 → 1.21.0-alpha.70

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 (132) hide show
  1. package/android/build.gradle +38 -13
  2. package/android/generated/java/com/facebook/fbreact/specs/NativeAirMapsModuleSpec.java +63 -0
  3. package/android/generated/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerDelegate.java +200 -0
  4. package/android/generated/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerInterface.java +71 -0
  5. package/android/generated/java/com/facebook/react/viewmanagers/RNMapsMarkerManagerDelegate.java +104 -0
  6. package/android/generated/java/com/facebook/react/viewmanagers/RNMapsMarkerManagerInterface.java +39 -0
  7. package/android/generated/jni/CMakeLists.txt +36 -0
  8. package/android/generated/jni/RNMapsSpecs-generated.cpp +68 -0
  9. package/android/generated/jni/RNMapsSpecs.h +31 -0
  10. package/android/generated/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.cpp +26 -0
  11. package/android/generated/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.h +28 -0
  12. package/android/generated/jni/react/renderer/components/RNMapsSpecs/EventEmitters.cpp +918 -0
  13. package/android/generated/jni/react/renderer/components/RNMapsSpecs/EventEmitters.h +787 -0
  14. package/android/generated/jni/react/renderer/components/RNMapsSpecs/Props.cpp +154 -0
  15. package/android/generated/jni/react/renderer/components/RNMapsSpecs/Props.h +1058 -0
  16. package/android/generated/jni/react/renderer/components/RNMapsSpecs/RNMapsSpecsJSI-generated.cpp +74 -0
  17. package/android/generated/jni/react/renderer/components/RNMapsSpecs/RNMapsSpecsJSI.h +268 -0
  18. package/android/generated/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.cpp +21 -0
  19. package/android/generated/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.h +76 -0
  20. package/android/generated/jni/react/renderer/components/RNMapsSpecs/States.cpp +16 -0
  21. package/android/generated/jni/react/renderer/components/RNMapsSpecs/States.h +77 -0
  22. package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  23. package/android/src/main/java/com/rnmaps/fabric/CalloutManager.java +77 -0
  24. package/android/src/main/java/com/rnmaps/fabric/JSONUtil.java +86 -0
  25. package/android/src/main/java/com/rnmaps/fabric/MapViewManager.java +593 -0
  26. package/android/src/main/java/com/rnmaps/fabric/MarkerManager.java +259 -0
  27. package/android/src/main/java/com/rnmaps/fabric/NativeAirMapsModule.java +137 -4
  28. package/android/src/main/java/com/rnmaps/fabric/event/OnCalloutPressEvent.java +25 -0
  29. package/android/src/main/java/com/rnmaps/fabric/event/OnDeselectEvent.java +28 -0
  30. package/android/src/main/java/com/rnmaps/fabric/event/OnDragEndEvent.java +28 -0
  31. package/android/src/main/java/com/rnmaps/fabric/event/OnDragEvent.java +28 -0
  32. package/android/src/main/java/com/rnmaps/fabric/event/OnDragStartEvent.java +28 -0
  33. package/android/src/main/java/com/rnmaps/fabric/event/OnLongPressEvent.java +28 -0
  34. package/android/src/main/java/com/rnmaps/fabric/event/OnMapLoadedEvent.java +29 -0
  35. package/android/src/main/java/com/rnmaps/fabric/event/OnMapReadyEvent.java +29 -0
  36. package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDeselectEvent.java +28 -0
  37. package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragEndEvent.java +28 -0
  38. package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragEvent.java +28 -0
  39. package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragStartEvent.java +28 -0
  40. package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerPressEvent.java +28 -0
  41. package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerSelectEvent.java +28 -0
  42. package/android/src/main/java/com/rnmaps/fabric/event/OnPoiClickEvent.java +27 -0
  43. package/android/src/main/java/com/rnmaps/fabric/event/OnPressEvent.java +27 -0
  44. package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeCompleteEvent.java +30 -0
  45. package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeEvent.java +48 -0
  46. package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeStartEvent.java +33 -0
  47. package/android/src/main/java/com/rnmaps/fabric/event/OnSelectEvent.java +28 -0
  48. package/android/src/main/java/com/rnmaps/fabric/event/OnUserLocationChangeEvent.java +28 -0
  49. package/android/src/main/java/com/rnmaps/maps/MapAirModulePackage.java +22 -2
  50. package/android/src/main/java/com/rnmaps/maps/MapCallout.java +18 -0
  51. package/android/src/main/java/com/rnmaps/maps/MapManager.java +14 -14
  52. package/android/src/main/java/com/rnmaps/maps/MapMarker.java +79 -3
  53. package/android/src/main/java/com/rnmaps/maps/MapModule.java +206 -206
  54. package/android/src/main/java/com/rnmaps/maps/MapView.java +1588 -1346
  55. package/ios/AirGoogleMaps/AIRGoogleMap.h +3 -2
  56. package/ios/AirGoogleMaps/AIRGoogleMap.m +153 -48
  57. package/ios/AirGoogleMaps/AIRGoogleMapCircle.m +23 -11
  58. package/ios/AirGoogleMaps/AIRGoogleMapManager.m +17 -28
  59. package/ios/AirGoogleMaps/AIRGoogleMapMarker.h +2 -0
  60. package/ios/AirGoogleMaps/AIRGoogleMapMarker.m +347 -243
  61. package/ios/AirGoogleMaps/AIRGoogleMapPolygon.h +2 -1
  62. package/ios/AirGoogleMaps/AIRGoogleMapPolygon.m +30 -0
  63. package/ios/AirGoogleMaps/AIRGoogleMapPolyline.h +0 -1
  64. package/ios/AirGoogleMaps/AIRGoogleMapPolyline.m +0 -7
  65. package/ios/AirGoogleMaps/AIRGoogleMapWMSTile.h +1 -1
  66. package/ios/AirGoogleMaps/AIRGoogleMapWMSTile.m +2 -2
  67. package/ios/AirGoogleMaps/RCTConvert+GMSMapViewType.h +3 -0
  68. package/ios/AirGoogleMaps/RCTConvert+GMSMapViewType.m +2 -0
  69. package/ios/AirGoogleMaps/RNMapsGoogleMapView.h +3 -3
  70. package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +161 -61
  71. package/ios/AirGoogleMaps/RNMapsGooglePolygonView.h +26 -0
  72. package/ios/AirGoogleMaps/RNMapsGooglePolygonView.mm +217 -0
  73. package/ios/AirGoogleMaps/RNMapsGooglePolygonViewManager.mm +25 -0
  74. package/ios/AirMaps/AIRMap.h +6 -3
  75. package/ios/AirMaps/AIRMap.m +289 -145
  76. package/ios/AirMaps/AIRMapManager.m +8 -17
  77. package/ios/AirMaps/AIRMapMarker.h +1 -0
  78. package/ios/AirMaps/AIRMapMarker.m +165 -103
  79. package/ios/AirMaps/Callout/SMCalloutView.m +1 -1
  80. package/ios/AirMaps/RCTConvert+AirMap.h +4 -0
  81. package/ios/AirMaps/RCTConvert+AirMap.m +2 -0
  82. package/ios/AirMaps/RNMapsAirModule.h +1 -1
  83. package/ios/AirMaps/RNMapsAirModule.mm +42 -172
  84. package/ios/AirMaps/RNMapsAirModuleDelegate.h +24 -0
  85. package/ios/AirMaps/RNMapsHostVewDelegate.h +17 -0
  86. package/ios/AirMaps/RNMapsMapView.h +3 -3
  87. package/ios/AirMaps/RNMapsMapView.mm +344 -307
  88. package/ios/AirMaps/RNMapsMarkerView.h +24 -0
  89. package/ios/AirMaps/RNMapsMarkerView.mm +430 -0
  90. package/ios/AirMaps/RNMapsMarkerViewManager.mm +21 -0
  91. package/ios/AirMaps/UIView +AirMap.m +20 -0
  92. package/ios/AirMaps/UIView+AirMap.h +11 -0
  93. package/ios/AirMaps.xcodeproj/project.pbxproj +60 -0
  94. package/ios/generated/RNMapsSpecs/ComponentDescriptors.cpp +26 -0
  95. package/ios/generated/RNMapsSpecs/ComponentDescriptors.h +28 -0
  96. package/ios/generated/RNMapsSpecs/EventEmitters.cpp +918 -0
  97. package/ios/generated/RNMapsSpecs/EventEmitters.h +787 -0
  98. package/ios/generated/RNMapsSpecs/Props.cpp +154 -0
  99. package/ios/generated/RNMapsSpecs/Props.h +1058 -0
  100. package/ios/generated/RNMapsSpecs/RCTComponentViewHelpers.h +549 -0
  101. package/ios/generated/RNMapsSpecs/RNMapsSpecs-generated.mm +92 -0
  102. package/ios/generated/RNMapsSpecs/RNMapsSpecs.h +137 -0
  103. package/ios/generated/RNMapsSpecs/ShadowNodes.cpp +21 -0
  104. package/ios/generated/RNMapsSpecs/ShadowNodes.h +76 -0
  105. package/ios/generated/RNMapsSpecs/States.cpp +16 -0
  106. package/ios/generated/RNMapsSpecs/States.h +77 -0
  107. package/ios/generated/RNMapsSpecsJSI-generated.cpp +74 -0
  108. package/ios/generated/RNMapsSpecsJSI.h +268 -0
  109. package/lib/MapCallout.js +1 -0
  110. package/lib/MapMarker.d.ts +15 -2
  111. package/lib/MapMarker.js +53 -9
  112. package/lib/MapMarkerNativeComponent.js +0 -2
  113. package/lib/MapOverlay.js +2 -8
  114. package/lib/MapPolyline.d.ts +1 -1
  115. package/lib/MapView.d.ts +7 -22
  116. package/lib/MapView.js +80 -89
  117. package/lib/{FabricMapView.d.ts → createFabricMap.d.ts} +7 -11
  118. package/lib/createFabricMap.js +175 -0
  119. package/lib/decorateMapComponent.js +22 -0
  120. package/lib/specs/NativeAirMapsModule.d.ts +2 -2
  121. package/lib/specs/NativeComponentCallout.d.ts +46 -0
  122. package/lib/specs/NativeComponentCallout.js +9 -0
  123. package/lib/specs/NativeComponentGoogleMapView.d.ts +12 -12
  124. package/lib/specs/NativeComponentGooglePolygon.d.ts +75 -0
  125. package/lib/specs/NativeComponentGooglePolygon.js +9 -0
  126. package/lib/specs/NativeComponentMapView.d.ts +19 -36
  127. package/lib/specs/NativeComponentMapView.js +1 -3
  128. package/lib/specs/NativeComponentMarker.d.ts +258 -0
  129. package/lib/specs/NativeComponentMarker.js +19 -0
  130. package/package.json +15 -10
  131. package/react-native-maps.podspec +2 -1
  132. package/lib/FabricMapView.js +0 -181
@@ -0,0 +1,175 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ const react_1 = __importStar(require("react"));
30
+ const react_native_1 = require("react-native");
31
+ const NativeAirMapsModule_1 = __importDefault(require("./specs/NativeAirMapsModule"));
32
+ const createFabricMap = (ViewComponent, Commands) => {
33
+ return (0, react_1.forwardRef)((props, ref) => {
34
+ const fabricRef = (0, react_1.useRef)(null);
35
+ (0, react_1.useImperativeHandle)(ref, () => ({
36
+ async getMarkersFrames(onlyVisible) {
37
+ if (fabricRef.current) {
38
+ return NativeAirMapsModule_1.default.getMarkersFrames((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, onlyVisible);
39
+ }
40
+ else {
41
+ throw new Error('getMarkersFrames is only supported on iOS with Fabric.');
42
+ }
43
+ },
44
+ async getCoordinateForPoint(point) {
45
+ if (fabricRef.current) {
46
+ return NativeAirMapsModule_1.default.getCoordinateForPoint((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, point);
47
+ }
48
+ else {
49
+ throw new Error('getCoordinateForPoint is only supported on iOS with Fabric.');
50
+ }
51
+ },
52
+ async getPointForCoordinate(coordinate) {
53
+ if (fabricRef.current) {
54
+ return NativeAirMapsModule_1.default.getPointForCoordinate((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, coordinate);
55
+ }
56
+ else {
57
+ throw new Error('getPointForCoordinate is only supported on iOS with Fabric.');
58
+ }
59
+ },
60
+ async getAddressFromCoordinates(coordinate) {
61
+ if (fabricRef.current) {
62
+ return NativeAirMapsModule_1.default.getAddressFromCoordinates((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, coordinate);
63
+ }
64
+ else {
65
+ throw new Error('getAddressFromCoordinates is only supported on iOS with Fabric.');
66
+ }
67
+ },
68
+ async takeSnapshot(config) {
69
+ if (fabricRef.current) {
70
+ return NativeAirMapsModule_1.default.takeSnapshot((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, JSON.stringify(config));
71
+ }
72
+ else {
73
+ throw new Error('takeSnapshot is only supported on iOS with Fabric.');
74
+ }
75
+ },
76
+ async getCamera() {
77
+ if (fabricRef.current) {
78
+ return NativeAirMapsModule_1.default.getCamera((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1);
79
+ }
80
+ else {
81
+ throw new Error('getCamera is only supported on iOS with Fabric.');
82
+ }
83
+ },
84
+ async getMapBoundaries() {
85
+ if (fabricRef.current) {
86
+ return NativeAirMapsModule_1.default.getMapBoundaries((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1);
87
+ }
88
+ else {
89
+ throw new Error('getMapBoundaries is only supported on iOS with Fabric.');
90
+ }
91
+ },
92
+ animateToRegion(region, duration) {
93
+ if (fabricRef.current) {
94
+ try {
95
+ Commands.animateToRegion(fabricRef.current, JSON.stringify(region), duration);
96
+ }
97
+ catch (error) {
98
+ throw new Error('Failed to animateToRegion');
99
+ }
100
+ }
101
+ else {
102
+ throw new Error('animateToRegion is only supported on iOS with Fabric.');
103
+ }
104
+ },
105
+ fitToElements(edgePadding, animated) {
106
+ if (fabricRef.current) {
107
+ try {
108
+ Commands.fitToElements(fabricRef.current, JSON.stringify(edgePadding), animated);
109
+ }
110
+ catch (error) {
111
+ throw new Error('Failed to fitToElements');
112
+ }
113
+ }
114
+ else {
115
+ throw new Error('fitToElements is only supported on iOS with Fabric.');
116
+ }
117
+ },
118
+ fitToSuppliedMarkers(markers, edgePadding, animated) {
119
+ if (fabricRef.current) {
120
+ try {
121
+ Commands.fitToSuppliedMarkers(fabricRef.current, JSON.stringify(markers), JSON.stringify(edgePadding), animated);
122
+ }
123
+ catch (error) {
124
+ throw new Error('Failed to fitToSuppliedMarkers');
125
+ }
126
+ }
127
+ else {
128
+ throw new Error('fitToSuppliedMarkers is only supported on iOS with Fabric.');
129
+ }
130
+ },
131
+ animateCamera(camera, duration) {
132
+ if (fabricRef.current) {
133
+ try {
134
+ Commands.animateCamera(fabricRef.current, JSON.stringify(camera), duration);
135
+ }
136
+ catch (error) {
137
+ throw new Error('Failed to animateCamera');
138
+ }
139
+ }
140
+ else {
141
+ throw new Error('animateCamera is only supported on iOS with Fabric.');
142
+ }
143
+ },
144
+ fitToCoordinates(coordinates, edgePadding, animated) {
145
+ if (fabricRef.current) {
146
+ try {
147
+ Commands.fitToCoordinates(fabricRef.current, JSON.stringify(coordinates), JSON.stringify(edgePadding), animated);
148
+ }
149
+ catch (error) {
150
+ throw new Error('Failed to fitToCoordinates');
151
+ }
152
+ }
153
+ else {
154
+ throw new Error('fitToCoordinates is only supported on iOS with Fabric.');
155
+ }
156
+ },
157
+ setCamera(camera) {
158
+ if (fabricRef.current) {
159
+ try {
160
+ Commands.setCamera(fabricRef.current, JSON.stringify(camera));
161
+ }
162
+ catch (error) {
163
+ console.error('Failed to set camera:', error);
164
+ }
165
+ }
166
+ else {
167
+ console.warn('setCamera is only supported on iOS with Fabric.');
168
+ }
169
+ },
170
+ }));
171
+ // @ts-ignore
172
+ return <ViewComponent {...props} ref={fabricRef}/>;
173
+ });
174
+ };
175
+ exports.default = createFabricMap;
@@ -1,9 +1,15 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.googleMapIsInstalled = exports.createNotSupportedComponent = exports.getNativeMapName = exports.ProviderContext = exports.NOT_SUPPORTED = exports.USES_DEFAULT_IMPLEMENTATION = exports.SUPPORTED = void 0;
4
7
  const react_1 = require("react");
5
8
  const react_native_1 = require("react-native");
6
9
  const ProviderConstants_1 = require("./ProviderConstants");
10
+ const NativeComponentGooglePolygon_1 = __importDefault(require("./specs/NativeComponentGooglePolygon"));
11
+ const NativeComponentMarker_1 = __importDefault(require("./specs/NativeComponentMarker"));
12
+ const NativeComponentCallout_1 = __importDefault(require("./specs/NativeComponentCallout"));
7
13
  exports.SUPPORTED = 'SUPPORTED';
8
14
  exports.USES_DEFAULT_IMPLEMENTATION = 'USES_DEFAULT_IMPLEMENTATION';
9
15
  exports.NOT_SUPPORTED = 'NOT_SUPPORTED';
@@ -34,6 +40,15 @@ function decorateMapComponent(Component, componentName, providers) {
34
40
  Component.prototype.getNativeComponent =
35
41
  function getNativeComponent() {
36
42
  const provider = this.context;
43
+ if (componentName === 'Marker' &&
44
+ (react_native_1.Platform.OS !== 'ios' || provider !== ProviderConstants_1.PROVIDER_GOOGLE)) {
45
+ // @ts-ignore
46
+ return NativeComponentMarker_1.default;
47
+ }
48
+ if (componentName === 'Callout' && react_native_1.Platform.OS === 'android') {
49
+ // @ts-ignore
50
+ return NativeComponentCallout_1.default;
51
+ }
37
52
  const key = provider || 'default';
38
53
  if (components[key]) {
39
54
  return components[key];
@@ -47,6 +62,13 @@ function decorateMapComponent(Component, componentName, providers) {
47
62
  if (react_native_1.Platform.OS !== 'android' && react_native_1.Platform.OS !== 'ios') {
48
63
  throw new Error(`react-native-maps doesn't support ${react_native_1.Platform.OS}`);
49
64
  }
65
+ if (componentName === 'Polygon' &&
66
+ provider === ProviderConstants_1.PROVIDER_GOOGLE &&
67
+ react_native_1.Platform.OS === 'ios' &&
68
+ exports.googleMapIsInstalled) {
69
+ // @ts-ignore
70
+ return NativeComponentGooglePolygon_1.default;
71
+ }
50
72
  const platformSupport = providerInfo[react_native_1.Platform.OS];
51
73
  const nativeComponentName = getNativeComponentName(provider, componentName);
52
74
  if (platformSupport === exports.NOT_SUPPORTED) {
@@ -1,5 +1,5 @@
1
1
  import type { TurboModule } from 'react-native';
2
- import type { Double, UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';
2
+ import type { Double } from 'react-native/Libraries/Types/CodegenTypes';
3
3
  import type { Camera } from './NativeComponentMapView';
4
4
  import { Address } from 'react-native-maps';
5
5
  type LatLng = {
@@ -22,7 +22,7 @@ export interface Spec extends TurboModule {
22
22
  getCamera(tag: Double): Promise<Camera>;
23
23
  getMarkersFrames(tag: Double, onlyVisible: boolean): Promise<unknown>;
24
24
  getMapBoundaries(tag: Double): Promise<MapBoundaries>;
25
- takeSnapshot(tag: Double, config: UnsafeObject): Promise<string>;
25
+ takeSnapshot(tag: Double, config: string): Promise<string>;
26
26
  getAddressFromCoordinates(tag: Double, coordinate: LatLng): Promise<Address>;
27
27
  getPointForCoordinate(tag: Double, coordinate: LatLng): Promise<Point>;
28
28
  getCoordinateForPoint(tag: Double, point: Point): Promise<LatLng>;
@@ -0,0 +1,46 @@
1
+ import type { HostComponent, ViewProps } from 'react-native';
2
+ import { Double, BubblingEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
3
+ export type LatLng = Readonly<{
4
+ latitude: Double;
5
+ longitude: Double;
6
+ }>;
7
+ export type CalloutPressEvent = BubblingEventHandler<Readonly<{
8
+ action?: string;
9
+ id: string;
10
+ coordinate: {
11
+ latitude: Double;
12
+ longitude: Double;
13
+ };
14
+ position?: {
15
+ x: Double;
16
+ y: Double;
17
+ };
18
+ }>>;
19
+ export interface CalloutFabricNativeProps extends ViewProps {
20
+ /**
21
+ * If `true`, clicks on transparent areas in callout will be passed to map.
22
+ *
23
+ * @default false
24
+ * @platform iOS: Supported
25
+ * @platform Android: Not supported
26
+ */
27
+ alphaHitTest?: boolean;
28
+ /**
29
+ * Callback that is called when the user presses on the callout
30
+ *
31
+ * @platform iOS: Apple Maps only
32
+ * @platform Android: Supported
33
+ */
34
+ onPress?: CalloutPressEvent;
35
+ /**
36
+ * If `false`, a default "tooltip" bubble window will be drawn around this callouts children.
37
+ * If `true`, the child views can fully customize their appearance, including any "bubble" like styles.
38
+ *
39
+ * @default false
40
+ * @platform iOS: Supported
41
+ * @platform Android: Supported
42
+ */
43
+ tooltip?: boolean;
44
+ }
45
+ declare const _default: HostComponent<CalloutFabricNativeProps>;
46
+ export default _default;
@@ -0,0 +1,9 @@
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
+ const codegenNativeComponent_1 = __importDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));
7
+ exports.default = (0, codegenNativeComponent_1.default)('RNMapsCallout', {
8
+ excludedPlatforms: ['iOS'],
9
+ });
@@ -517,7 +517,7 @@ export interface MapFabricNativeProps extends ViewProps {
517
517
  * @platform iOS: Google Maps only
518
518
  * @platform Android: Supported
519
519
  */
520
- pitchEnabled?: boolean;
520
+ pitchEnabled?: WithDefault<boolean, true>;
521
521
  /**
522
522
  * The region to be displayed by the map.
523
523
  * The region is defined by the center coordinates and the span of coordinates to display.
@@ -533,7 +533,7 @@ export interface MapFabricNativeProps extends ViewProps {
533
533
  * @platform iOS: Google Maps only
534
534
  * @platform Android: Supported
535
535
  */
536
- rotateEnabled?: boolean;
536
+ rotateEnabled?: WithDefault<boolean, true>;
537
537
  /**
538
538
  * If `false` the map will stay centered while rotating or zooming.
539
539
  *
@@ -541,7 +541,7 @@ export interface MapFabricNativeProps extends ViewProps {
541
541
  * @platform iOS: Google Maps only
542
542
  * @platform Android: Supported
543
543
  */
544
- scrollDuringRotateOrZoomEnabled?: boolean;
544
+ scrollDuringRotateOrZoomEnabled?: WithDefault<boolean, true>;
545
545
  /**
546
546
  * If `false` the user won't be able to change the map region being displayed.
547
547
  *
@@ -549,7 +549,7 @@ export interface MapFabricNativeProps extends ViewProps {
549
549
  * @platform iOS: Supported
550
550
  * @platform Android: Supported
551
551
  */
552
- scrollEnabled?: boolean;
552
+ scrollEnabled?: WithDefault<boolean, true>;
553
553
  /**
554
554
  * A Boolean indicating whether the map displays extruded building information.
555
555
  *
@@ -557,7 +557,7 @@ export interface MapFabricNativeProps extends ViewProps {
557
557
  * @platform iOS: Not supported
558
558
  * @platform Android: Supported
559
559
  */
560
- showsBuildings?: boolean;
560
+ showsBuildings?: WithDefault<boolean, true>;
561
561
  /**
562
562
  * If `false` compass won't be displayed on the map.
563
563
  *
@@ -565,7 +565,7 @@ export interface MapFabricNativeProps extends ViewProps {
565
565
  * @platform iOS: Supported
566
566
  * @platform Android: Supported
567
567
  */
568
- showsCompass?: boolean;
568
+ showsCompass?: WithDefault<boolean, true>;
569
569
  /**
570
570
  * A Boolean indicating whether indoor level picker should be enabled.
571
571
  *
@@ -581,7 +581,7 @@ export interface MapFabricNativeProps extends ViewProps {
581
581
  * @platform iOS: Google Maps only
582
582
  * @platform Android: Supported
583
583
  */
584
- showsIndoors?: boolean;
584
+ showsIndoors?: WithDefault<boolean, true>;
585
585
  /**
586
586
  * If `false` hide the button to move map to the current user's location.
587
587
  *
@@ -589,7 +589,7 @@ export interface MapFabricNativeProps extends ViewProps {
589
589
  * @platform iOS: Google Maps only
590
590
  * @platform Android: Supported
591
591
  */
592
- showsMyLocationButton?: boolean;
592
+ showsMyLocationButton?: WithDefault<boolean, true>;
593
593
  /**
594
594
  * If `false` points of interest won't be displayed on the map.
595
595
  * TODO: DEPRECATED? Doesn't seem to do anything
@@ -630,8 +630,8 @@ export interface MapFabricNativeProps extends ViewProps {
630
630
  * Sets the map to the style selected.
631
631
  *
632
632
  * @default System setting
633
- * @platform iOS: Apple Maps only (iOS >= 13.0)
634
- * @platform Android: Not supported
633
+ * @platform iOS: Supported
634
+ * @platform Android: Supported
635
635
  */
636
636
  userInterfaceStyle?: WithDefault<'system' | 'light' | 'dark', 'system'>;
637
637
  /**
@@ -689,7 +689,7 @@ export interface MapFabricNativeProps extends ViewProps {
689
689
  * @platform iOS: Supported
690
690
  * @platform Android: Supported
691
691
  */
692
- zoomEnabled?: boolean;
692
+ zoomEnabled?: WithDefault<boolean, true>;
693
693
  /**
694
694
  * If `false` the user won't be able to double tap to zoom the map.
695
695
  * **Note:** But it will greatly decrease delay of tap gesture recognition.
@@ -698,7 +698,7 @@ export interface MapFabricNativeProps extends ViewProps {
698
698
  * @platform iOS: Google Maps only
699
699
  * @platform Android: Not supported
700
700
  */
701
- zoomTapEnabled?: boolean;
701
+ zoomTapEnabled?: WithDefault<boolean, true>;
702
702
  }
703
703
  export interface NativeCommands {
704
704
  animateToRegion: (viewRef: React.ElementRef<React.ComponentType>, regionJSON: string, duration: Int32) => void;
@@ -0,0 +1,75 @@
1
+ import type { HostComponent, ViewProps, ColorValue } from 'react-native';
2
+ import { Double, BubblingEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
3
+ export type LatLng = Readonly<{
4
+ latitude: Double;
5
+ longitude: Double;
6
+ }>;
7
+ export type PolygonPressEventHandler = BubblingEventHandler<Readonly<{
8
+ action?: string;
9
+ id: string;
10
+ coordinate: {
11
+ latitude: Double;
12
+ longitude: Double;
13
+ };
14
+ position?: {
15
+ x: Double;
16
+ y: Double;
17
+ };
18
+ }>>;
19
+ export interface PolygonFabricNativeProps extends ViewProps {
20
+ /**
21
+ * An array of coordinates to describe the polygon
22
+ *
23
+ * @platform iOS: Supported
24
+ * @platform Android: Supported
25
+ */
26
+ coordinates: ReadonlyArray<LatLng>;
27
+ /**
28
+ * The fill color to use for the path.
29
+ *
30
+ * @default `#000`, `rgba(r,g,b,0.5)`
31
+ * @platform iOS: Supported
32
+ * @platform Android: Supported
33
+ */
34
+ fillColor?: ColorValue;
35
+ /**
36
+ * The stroke color to use for the path.
37
+ *
38
+ * @default `#000`, `rgba(r,g,b,0.5)`
39
+ * @platform iOS: Supported
40
+ * @platform Android: Supported
41
+ */
42
+ strokeColor?: ColorValue;
43
+ /**
44
+ * Boolean to indicate whether to draw each segment of the line as a geodesic as opposed to straight lines on the Mercator projection.
45
+ * A geodesic is the shortest path between two points on the Earth's surface.
46
+ * The geodesic curve is constructed assuming the Earth is a sphere.
47
+ *
48
+ * @platform iOS: Google Maps only
49
+ * @platform Android: Supported
50
+ */
51
+ geodesic?: boolean;
52
+ /**
53
+ * A 2d array of coordinates to describe holes of the polygon where each hole has at least 3 points.
54
+ *
55
+ * @platform iOS: Supported
56
+ * @platform Android: Supported
57
+ */
58
+ holes?: ReadonlyArray<ReadonlyArray<LatLng>>;
59
+ /**
60
+ * Boolean to allow a polygon to be tappable and use the onPress function.
61
+ *
62
+ * @platform iOS: Google Maps only
63
+ * @platform Android: Supported
64
+ */
65
+ tappable?: boolean;
66
+ /**
67
+ * Callback that is called when user taps on the map.
68
+ *
69
+ * @platform iOS: Supported
70
+ * @platform Android: Supported
71
+ */
72
+ onPress?: PolygonPressEventHandler;
73
+ }
74
+ declare const _default: HostComponent<PolygonFabricNativeProps>;
75
+ export default _default;
@@ -0,0 +1,9 @@
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
+ const codegenNativeComponent_1 = __importDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));
7
+ exports.default = (0, codegenNativeComponent_1.default)('RNMapsGooglePolygon', {
8
+ excludedPlatforms: ['android'],
9
+ });
@@ -447,7 +447,7 @@ export interface MapFabricNativeProps extends ViewProps {
447
447
  * @platform iOS: Not supported
448
448
  * @platform Android: Supported
449
449
  */
450
- moveOnMarkerPress?: boolean;
450
+ moveOnMarkerPress?: WithDefault<boolean, true>;
451
451
  /**
452
452
  * Callback that is called when a callout is tapped by the user.
453
453
  *
@@ -560,6 +560,7 @@ export interface MapFabricNativeProps extends ViewProps {
560
560
  * @platform Android: Supported
561
561
  */
562
562
  onPanDrag?: PanDragEventHandler;
563
+ handlePanDrag?: boolean;
563
564
  /**
564
565
  * Callback that is called when user click on a POI.
565
566
  *
@@ -624,7 +625,7 @@ export interface MapFabricNativeProps extends ViewProps {
624
625
  * @platform iOS: Google Maps only
625
626
  * @platform Android: Supported
626
627
  */
627
- pitchEnabled?: boolean;
628
+ pitchEnabled?: WithDefault<boolean, true>;
628
629
  /**
629
630
  * The region to be displayed by the map.
630
631
  * The region is defined by the center coordinates and the span of coordinates to display.
@@ -640,7 +641,7 @@ export interface MapFabricNativeProps extends ViewProps {
640
641
  * @platform iOS: Google Maps only
641
642
  * @platform Android: Supported
642
643
  */
643
- rotateEnabled?: boolean;
644
+ rotateEnabled?: WithDefault<boolean, true>;
644
645
  /**
645
646
  * If `false` the map will stay centered while rotating or zooming.
646
647
  *
@@ -648,7 +649,7 @@ export interface MapFabricNativeProps extends ViewProps {
648
649
  * @platform iOS: Google Maps only
649
650
  * @platform Android: Supported
650
651
  */
651
- scrollDuringRotateOrZoomEnabled?: boolean;
652
+ scrollDuringRotateOrZoomEnabled?: WithDefault<boolean, true>;
652
653
  /**
653
654
  * If `false` the user won't be able to change the map region being displayed.
654
655
  *
@@ -656,7 +657,7 @@ export interface MapFabricNativeProps extends ViewProps {
656
657
  * @platform iOS: Supported
657
658
  * @platform Android: Supported
658
659
  */
659
- scrollEnabled?: boolean;
660
+ scrollEnabled?: WithDefault<boolean, true>;
660
661
  /**
661
662
  * A Boolean indicating whether the map displays extruded building information.
662
663
  *
@@ -664,7 +665,7 @@ export interface MapFabricNativeProps extends ViewProps {
664
665
  * @platform iOS: Not supported
665
666
  * @platform Android: Supported
666
667
  */
667
- showsBuildings?: boolean;
668
+ showsBuildings?: WithDefault<boolean, true>;
668
669
  /**
669
670
  * If `false` compass won't be displayed on the map.
670
671
  *
@@ -672,7 +673,7 @@ export interface MapFabricNativeProps extends ViewProps {
672
673
  * @platform iOS: Supported
673
674
  * @platform Android: Supported
674
675
  */
675
- showsCompass?: boolean;
676
+ showsCompass?: WithDefault<boolean, true>;
676
677
  /**
677
678
  * A Boolean indicating whether indoor level picker should be enabled.
678
679
  *
@@ -688,7 +689,7 @@ export interface MapFabricNativeProps extends ViewProps {
688
689
  * @platform iOS: Google Maps only
689
690
  * @platform Android: Supported
690
691
  */
691
- showsIndoors?: boolean;
692
+ showsIndoors?: WithDefault<boolean, true>;
692
693
  /**
693
694
  * If `false` hide the button to move map to the current user's location.
694
695
  *
@@ -696,33 +697,15 @@ export interface MapFabricNativeProps extends ViewProps {
696
697
  * @platform iOS: Google Maps only
697
698
  * @platform Android: Supported
698
699
  */
699
- showsMyLocationButton?: boolean;
700
- /**
701
- * If `false` points of interest won't be displayed on the map.
702
- * TODO: DEPRECATED? Doesn't seem to do anything
703
- *
704
- * @default true
705
- * @platform iOS: Maybe Apple Maps?
706
- * @platform Android: Not supported
707
- */
708
- showsPointsOfInterest?: boolean;
700
+ showsMyLocationButton?: WithDefault<boolean, true>;
709
701
  /**
710
702
  * A Boolean indicating whether the map shows scale information.
711
703
  *
712
- * @default true
704
+ * @default false
713
705
  * @platform iOS: Apple Maps only
714
706
  * @platform Android: Not supported
715
707
  */
716
708
  showsScale?: boolean;
717
- /**
718
- * A Boolean value indicating whether the map displays traffic information.
719
- * TODO: Look into android support
720
- *
721
- * @default false
722
- * @platform iOS: Supported
723
- * @platform Android: Not supported?
724
- */
725
- showsTraffic?: boolean;
726
709
  /**
727
710
  * If `true` the users location will be displayed on the map.
728
711
  *
@@ -748,13 +731,13 @@ export interface MapFabricNativeProps extends ViewProps {
748
731
  * @platform iOS: Not supported
749
732
  * @platform Android: Supported
750
733
  */
751
- toolbarEnabled?: boolean;
734
+ toolbarEnabled?: WithDefault<boolean, true>;
752
735
  /**
753
736
  * Sets the map to the style selected.
754
737
  *
755
738
  * @default System setting
756
- * @platform iOS: Apple Maps only (iOS >= 13.0)
757
- * @platform Android: Not supported
739
+ * @platform iOS: Supported
740
+ * @platform Android: Supported
758
741
  */
759
742
  userInterfaceStyle?: WithDefault<'system' | 'light' | 'dark', 'system'>;
760
743
  /**
@@ -784,7 +767,7 @@ export interface MapFabricNativeProps extends ViewProps {
784
767
  * @platform iOS: Not supported
785
768
  * @platform Android: Supported
786
769
  */
787
- userLocationFastestInterval?: Int32;
770
+ userLocationFastestInterval?: WithDefault<Int32, 5000>;
788
771
  /**
789
772
  * Set power priority of user location tracking.
790
773
  *
@@ -804,7 +787,7 @@ export interface MapFabricNativeProps extends ViewProps {
804
787
  * @platform iOS: Not supported
805
788
  * @platform Android: Supported
806
789
  */
807
- userLocationUpdateInterval?: Int32;
790
+ userLocationUpdateInterval?: WithDefault<Int32, 5000>;
808
791
  /**
809
792
  * If `false` the zoom control at the bottom right of the map won't be visible.
810
793
  *
@@ -812,7 +795,7 @@ export interface MapFabricNativeProps extends ViewProps {
812
795
  * @platform iOS: Not supported
813
796
  * @platform Android: Supported
814
797
  */
815
- zoomControlEnabled?: boolean;
798
+ zoomControlEnabled?: WithDefault<boolean, true>;
816
799
  /**
817
800
  * If `false` the user won't be able to pinch/zoom the map.
818
801
  *
@@ -822,7 +805,7 @@ export interface MapFabricNativeProps extends ViewProps {
822
805
  * @platform iOS: Supported
823
806
  * @platform Android: Supported
824
807
  */
825
- zoomEnabled?: boolean;
808
+ zoomEnabled?: WithDefault<boolean, true>;
826
809
  /**
827
810
  * If `false` the user won't be able to double tap to zoom the map.
828
811
  * **Note:** But it will greatly decrease delay of tap gesture recognition.
@@ -831,7 +814,7 @@ export interface MapFabricNativeProps extends ViewProps {
831
814
  * @platform iOS: Google Maps only
832
815
  * @platform Android: Not supported
833
816
  */
834
- zoomTapEnabled?: boolean;
817
+ zoomTapEnabled?: WithDefault<boolean, true>;
835
818
  /**
836
819
  * Map camera distance limits. `minCenterCoordinateDistance` for minimum distance, `maxCenterCoordinateDistance` for maximum.
837
820
  * `animated` for animated zoom changes.
@@ -16,6 +16,4 @@ exports.Commands = (0, codegenNativeCommands_1.default)({
16
16
  'fitToCoordinates',
17
17
  ],
18
18
  });
19
- exports.default = (0, codegenNativeComponent_1.default)('RNMapsMapView', {
20
- excludedPlatforms: ['android'],
21
- });
19
+ exports.default = (0, codegenNativeComponent_1.default)('RNMapsMapView', {});