react-native-maps 1.21.0-alpha.1 → 1.21.0-alpha.100

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 (144) hide show
  1. package/android/build.gradle +86 -51
  2. package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  3. package/android/gradlew +1 -2
  4. package/android/src/main/java/com/rnmaps/fabric/CalloutManager.java +77 -0
  5. package/android/src/main/java/com/rnmaps/fabric/CircleManager.java +94 -0
  6. package/android/src/main/java/com/rnmaps/fabric/JSONUtil.java +86 -0
  7. package/android/src/main/java/com/rnmaps/fabric/MapViewManager.java +619 -0
  8. package/android/src/main/java/com/rnmaps/fabric/MarkerManager.java +258 -0
  9. package/android/src/main/java/com/rnmaps/fabric/NativeAirMapsModule.java +284 -0
  10. package/android/src/main/java/com/rnmaps/fabric/OverlayManager.java +95 -0
  11. package/android/src/main/java/com/rnmaps/fabric/PolygonManager.java +89 -0
  12. package/android/src/main/java/com/rnmaps/fabric/PolylineManager.java +121 -0
  13. package/android/src/main/java/com/rnmaps/fabric/event/OnCalloutPressEvent.java +25 -0
  14. package/android/src/main/java/com/rnmaps/fabric/event/OnDeselectEvent.java +28 -0
  15. package/android/src/main/java/com/rnmaps/fabric/event/OnDoublePressEvent.java +27 -0
  16. package/android/src/main/java/com/rnmaps/fabric/event/OnDragEndEvent.java +28 -0
  17. package/android/src/main/java/com/rnmaps/fabric/event/OnDragEvent.java +28 -0
  18. package/android/src/main/java/com/rnmaps/fabric/event/OnDragStartEvent.java +28 -0
  19. package/android/src/main/java/com/rnmaps/fabric/event/OnIndoorBuildingFocusedEvent.java +28 -0
  20. package/android/src/main/java/com/rnmaps/fabric/event/OnIndoorLevelActivatedEvent.java +28 -0
  21. package/android/src/main/java/com/rnmaps/fabric/event/OnKmlReadyEvent.java +28 -0
  22. package/android/src/main/java/com/rnmaps/fabric/event/OnLongPressEvent.java +28 -0
  23. package/android/src/main/java/com/rnmaps/fabric/event/OnMapLoadedEvent.java +29 -0
  24. package/android/src/main/java/com/rnmaps/fabric/event/OnMapReadyEvent.java +29 -0
  25. package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDeselectEvent.java +28 -0
  26. package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragEndEvent.java +28 -0
  27. package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragEvent.java +28 -0
  28. package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragStartEvent.java +28 -0
  29. package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerPressEvent.java +28 -0
  30. package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerSelectEvent.java +28 -0
  31. package/android/src/main/java/com/rnmaps/fabric/event/OnPanDragEvent.java +28 -0
  32. package/android/src/main/java/com/rnmaps/fabric/event/OnPoiClickEvent.java +27 -0
  33. package/android/src/main/java/com/rnmaps/fabric/event/OnPressEvent.java +27 -0
  34. package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeCompleteEvent.java +30 -0
  35. package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeEvent.java +48 -0
  36. package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeStartEvent.java +33 -0
  37. package/android/src/main/java/com/rnmaps/fabric/event/OnSelectEvent.java +28 -0
  38. package/android/src/main/java/com/rnmaps/fabric/event/OnUserLocationChangeEvent.java +28 -0
  39. package/android/src/main/java/com/rnmaps/maps/MapAirModulePackage.java +82 -0
  40. package/android/src/main/java/com/rnmaps/maps/MapCallout.java +18 -0
  41. package/android/src/main/java/com/rnmaps/maps/MapCircle.java +24 -0
  42. package/android/src/main/java/com/rnmaps/maps/MapManager.java +14 -14
  43. package/android/src/main/java/com/rnmaps/maps/MapMarker.java +79 -3
  44. package/android/src/main/java/com/rnmaps/maps/MapModule.java +206 -206
  45. package/android/src/main/java/com/rnmaps/maps/MapOverlay.java +267 -151
  46. package/android/src/main/java/com/rnmaps/maps/MapPolygon.java +31 -1
  47. package/android/src/main/java/com/rnmaps/maps/MapPolyline.java +207 -141
  48. package/android/src/main/java/com/rnmaps/maps/MapPolylineManager.java +1 -16
  49. package/android/src/main/java/com/rnmaps/maps/MapView.java +1654 -1337
  50. package/ios/AirGoogleMaps/AIRGoogleMap.h +8 -2
  51. package/ios/AirGoogleMaps/AIRGoogleMap.m +245 -57
  52. package/ios/AirGoogleMaps/AIRGoogleMapCircle.h +0 -1
  53. package/ios/AirGoogleMaps/AIRGoogleMapCircle.m +23 -11
  54. package/ios/AirGoogleMaps/AIRGoogleMapCoordinate.h +13 -0
  55. package/ios/AirGoogleMaps/AIRGoogleMapCoordinate.m +10 -0
  56. package/ios/AirGoogleMaps/AIRGoogleMapManager.h +7 -0
  57. package/ios/AirGoogleMaps/AIRGoogleMapManager.m +30 -119
  58. package/ios/AirGoogleMaps/AIRGoogleMapMarker.h +2 -0
  59. package/ios/AirGoogleMaps/AIRGoogleMapMarker.m +347 -243
  60. package/ios/AirGoogleMaps/AIRGoogleMapMarkerManager.m +0 -1
  61. package/ios/AirGoogleMaps/AIRGoogleMapOverlay.h +0 -1
  62. package/ios/AirGoogleMaps/AIRGoogleMapPolygon.h +5 -4
  63. package/ios/AirGoogleMaps/AIRGoogleMapPolygon.m +32 -2
  64. package/ios/AirGoogleMaps/AIRGoogleMapPolygonManager.m +3 -3
  65. package/ios/AirGoogleMaps/AIRGoogleMapPolyline.h +3 -3
  66. package/ios/AirGoogleMaps/AIRGoogleMapPolyline.m +2 -10
  67. package/ios/AirGoogleMaps/AIRGoogleMapPolylineManager.m +2 -2
  68. package/ios/AirGoogleMaps/AIRGoogleMapWMSTile.h +1 -1
  69. package/ios/AirGoogleMaps/AIRGoogleMapWMSTile.m +2 -2
  70. package/ios/AirGoogleMaps/RCTConvert+GMSMapViewType.h +3 -0
  71. package/ios/AirGoogleMaps/RCTConvert+GMSMapViewType.m +18 -0
  72. package/ios/AirGoogleMaps/RNMapsGoogleMapView.h +26 -0
  73. package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +670 -0
  74. package/ios/AirGoogleMaps/RNMapsGoogleMapViewManager.mm +25 -0
  75. package/ios/AirGoogleMaps/RNMapsGooglePolygonView.h +26 -0
  76. package/ios/AirGoogleMaps/RNMapsGooglePolygonView.mm +217 -0
  77. package/ios/AirGoogleMaps/RNMapsGooglePolygonViewManager.mm +25 -0
  78. package/ios/AirMaps/AIRMap.h +8 -5
  79. package/ios/AirMaps/AIRMap.m +291 -147
  80. package/ios/AirMaps/AIRMapManager.m +12 -21
  81. package/ios/AirMaps/AIRMapMarker.h +1 -0
  82. package/ios/AirMaps/AIRMapMarker.m +165 -103
  83. package/ios/AirMaps/Callout/SMCalloutView.m +1 -1
  84. package/ios/AirMaps/RCTConvert+AirMap.h +4 -0
  85. package/ios/AirMaps/RCTConvert+AirMap.m +2 -0
  86. package/ios/AirMaps/RNMapsAirModule.h +4 -1
  87. package/ios/AirMaps/RNMapsAirModule.mm +42 -172
  88. package/ios/AirMaps/RNMapsAirModuleDelegate.h +24 -0
  89. package/ios/AirMaps/RNMapsHostVewDelegate.h +17 -0
  90. package/ios/AirMaps/RNMapsMapView.h +6 -3
  91. package/ios/AirMaps/RNMapsMapView.mm +348 -329
  92. package/ios/AirMaps/RNMapsMarkerView.h +24 -0
  93. package/ios/AirMaps/RNMapsMarkerView.mm +430 -0
  94. package/ios/AirMaps/RNMapsMarkerViewManager.mm +21 -0
  95. package/ios/AirMaps/UIView +AirMap.m +20 -0
  96. package/ios/AirMaps/UIView+AirMap.h +11 -0
  97. package/ios/AirMaps.xcodeproj/project.pbxproj +60 -0
  98. package/lib/MapCircle.d.ts +1 -1
  99. package/lib/MapHeatmap.d.ts +2 -2
  100. package/lib/MapHeatmap.js +1 -1
  101. package/lib/MapMarker.d.ts +16 -3
  102. package/lib/MapMarker.js +55 -13
  103. package/lib/MapMarkerNativeComponent.js +0 -2
  104. package/lib/MapOverlay.d.ts +2 -1
  105. package/lib/MapOverlay.js +11 -9
  106. package/lib/MapPolygon.d.ts +1 -1
  107. package/lib/MapPolyline.d.ts +7 -7
  108. package/lib/MapView.d.ts +17 -29
  109. package/lib/MapView.js +111 -124
  110. package/lib/MapView.types.d.ts +1 -1
  111. package/lib/{FabricMapView.d.ts → createFabricMap.d.ts} +8 -6
  112. package/lib/createFabricMap.js +188 -0
  113. package/lib/decorateMapComponent.js +40 -0
  114. package/lib/fixImageProp.d.ts +4 -0
  115. package/lib/fixImageProp.js +16 -0
  116. package/lib/specs/NativeAirMapsModule.d.ts +2 -2
  117. package/lib/specs/NativeComponentCallout.d.ts +46 -0
  118. package/lib/specs/NativeComponentCallout.js +9 -0
  119. package/lib/specs/NativeComponentCircle.d.ts +74 -0
  120. package/lib/specs/NativeComponentCircle.js +7 -0
  121. package/lib/specs/NativeComponentGoogleMapView.d.ts +713 -0
  122. package/lib/specs/NativeComponentGoogleMapView.js +22 -0
  123. package/lib/specs/NativeComponentGooglePolygon.d.ts +75 -0
  124. package/lib/specs/NativeComponentGooglePolygon.js +7 -0
  125. package/lib/specs/NativeComponentMapView.d.ts +32 -47
  126. package/lib/specs/NativeComponentMapView.js +2 -3
  127. package/lib/specs/NativeComponentMarker.d.ts +258 -0
  128. package/lib/specs/NativeComponentMarker.js +19 -0
  129. package/lib/specs/NativeComponentOverlay.d.ts +67 -0
  130. package/lib/specs/NativeComponentOverlay.js +7 -0
  131. package/lib/specs/NativeComponentPolyline.d.ts +101 -0
  132. package/lib/specs/NativeComponentPolyline.js +7 -0
  133. package/package.json +27 -22
  134. package/react-native-maps.podspec +61 -16
  135. package/specs/NativeAirMapsModule.ts +36 -0
  136. package/specs/NativeComponentCallout.ts +63 -0
  137. package/specs/NativeComponentCircle.ts +94 -0
  138. package/specs/NativeComponentGoogleMapView.ts +916 -0
  139. package/specs/NativeComponentGooglePolygon.ts +94 -0
  140. package/specs/NativeComponentMapView.ts +1071 -0
  141. package/specs/NativeComponentMarker.ts +326 -0
  142. package/specs/NativeComponentOverlay.ts +89 -0
  143. package/specs/NativeComponentPolyline.ts +124 -0
  144. package/lib/FabricMapView.js +0 -175
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  import { Animated, ViewProps, ImageURISource, ImageRequireSource } from 'react-native';
3
3
  import { MapManagerCommand, NativeComponent, ProviderContext, UIManagerCommand } from './decorateMapComponent';
4
4
  import { MapMarkerNativeComponentType } from './MapMarkerNativeComponent';
5
+ import type { AppleMarkerPriority } from './specs/NativeComponentMarker';
5
6
  import { CalloutPressEvent, LatLng, MarkerDeselectEvent, MarkerDragEvent, MarkerDragStartEndEvent, MarkerPressEvent, MarkerSelectEvent, Point } from './sharedTypes';
6
7
  import { Modify } from './sharedTypesInternal';
7
8
  type AppleMarkerVisibility = 'hidden' | 'adaptive' | 'visible';
@@ -42,7 +43,7 @@ export type MapMarkerProps = ViewProps & {
42
43
  *
43
44
  * @default {x: 0.0, y: 0.0}
44
45
  * @platform iOS: Apple Maps only. For Google Maps, see the `calloutAnchor` prop
45
- * @platform Android: Not supported. See see the `calloutAnchor` prop
46
+ * @platform Android: Not supported. see the `calloutAnchor` prop
46
47
  */
47
48
  calloutOffset?: Point;
48
49
  /**
@@ -54,7 +55,7 @@ export type MapMarkerProps = ViewProps & {
54
55
  *
55
56
  * @default {x: 0.0, y: 0.0}
56
57
  * @platform iOS: Apple Maps only. For Google Maps, see the `anchor` prop
57
- * @platform Android: Not supported. See see the `anchor` prop
58
+ * @platform Android: Not supported. see the `anchor` prop
58
59
  */
59
60
  centerOffset?: Point;
60
61
  /**
@@ -261,6 +262,17 @@ export type MapMarkerProps = ViewProps & {
261
262
  * @platform Android: Supported
262
263
  */
263
264
  zIndex?: number;
265
+ /**
266
+ Constants that indicates the display priority for annotations.
267
+ @default required
268
+ @platform iOS: Apple Maps only.
269
+ @platform Android: Not supported
270
+
271
+ Required: A constant indicating that the item is required.
272
+ High: A constant indicating that the item’s display priority is high.
273
+ Low: A constant indicating that the item’s display priority is Low.
274
+ */
275
+ displayPriority?: AppleMarkerPriority;
264
276
  /**
265
277
  * Visibility of the title text rendered beneath Marker balloon
266
278
  * @platform iOS: Apple Maps only
@@ -286,7 +298,7 @@ export type NativeProps = Modify<OmittedProps, {
286
298
  icon?: string;
287
299
  image?: MapMarkerProps['image'] | string;
288
300
  }> & {
289
- ref: React.RefObject<MapMarkerNativeComponentType>;
301
+ ref: React.RefObject<MapMarkerNativeComponentType | null>;
290
302
  };
291
303
  export declare class MapMarker extends React.Component<MapMarkerProps> {
292
304
  context: React.ContextType<typeof ProviderContext>;
@@ -295,6 +307,7 @@ export declare class MapMarker extends React.Component<MapMarkerProps> {
295
307
  getUIManagerCommand: (name: string) => UIManagerCommand;
296
308
  static Animated: Animated.AnimatedComponent<typeof MapMarker>;
297
309
  private marker;
310
+ private fabricMarker?;
298
311
  constructor(props: MapMarkerProps);
299
312
  setNativeProps(props: Partial<NativeProps>): void;
300
313
  showCallout(): void;
package/lib/MapMarker.js CHANGED
@@ -28,12 +28,16 @@ const React = __importStar(require("react"));
28
28
  const react_native_1 = require("react-native");
29
29
  const decorateMapComponent_1 = __importStar(require("./decorateMapComponent"));
30
30
  const MapMarkerNativeComponent_1 = require("./MapMarkerNativeComponent");
31
+ const NativeComponentMarker_1 = require("./specs/NativeComponentMarker");
32
+ const ProviderConstants_1 = require("./ProviderConstants");
33
+ const fixImageProp_1 = require("./fixImageProp");
31
34
  class MapMarker extends React.Component {
32
35
  getNativeComponent;
33
36
  getMapManagerCommand;
34
37
  getUIManagerCommand;
35
38
  static Animated;
36
39
  marker;
40
+ fabricMarker = undefined;
37
41
  constructor(props) {
38
42
  super(props);
39
43
  this.marker = React.createRef();
@@ -49,27 +53,59 @@ class MapMarker extends React.Component {
49
53
  }
50
54
  showCallout() {
51
55
  if (this.marker.current) {
52
- MapMarkerNativeComponent_1.Commands.showCallout(this.marker.current);
56
+ if (this.fabricMarker) {
57
+ // @ts-ignore
58
+ NativeComponentMarker_1.Commands.showCallout(this.marker.current);
59
+ }
60
+ else {
61
+ MapMarkerNativeComponent_1.Commands.showCallout(this.marker.current);
62
+ }
53
63
  }
54
64
  }
55
65
  hideCallout() {
56
66
  if (this.marker.current) {
57
- MapMarkerNativeComponent_1.Commands.hideCallout(this.marker.current);
67
+ if (this.fabricMarker) {
68
+ // @ts-ignore
69
+ NativeComponentMarker_1.Commands.hideCallout(this.marker.current);
70
+ }
71
+ else {
72
+ MapMarkerNativeComponent_1.Commands.hideCallout(this.marker.current);
73
+ }
58
74
  }
59
75
  }
60
76
  setCoordinates(coordinate) {
61
77
  if (this.marker.current) {
62
- MapMarkerNativeComponent_1.Commands.setCoordinates(this.marker.current, coordinate);
78
+ if (this.fabricMarker) {
79
+ NativeComponentMarker_1.Commands.setCoordinates(
80
+ // @ts-ignore
81
+ this.marker.current, coordinate.latitude, coordinate.longitude);
82
+ }
83
+ else {
84
+ MapMarkerNativeComponent_1.Commands.setCoordinates(this.marker.current, coordinate);
85
+ }
63
86
  }
64
87
  }
65
88
  redrawCallout() {
66
89
  if (this.marker.current) {
67
- MapMarkerNativeComponent_1.Commands.redrawCallout(this.marker.current);
90
+ if (this.fabricMarker) {
91
+ // @ts-ignore
92
+ NativeComponentMarker_1.Commands.redrawCallout(this.marker.current);
93
+ }
94
+ else {
95
+ MapMarkerNativeComponent_1.Commands.redrawCallout(this.marker.current);
96
+ }
68
97
  }
69
98
  }
70
99
  animateMarkerToCoordinate(coordinate, duration = 500) {
71
100
  if (this.marker.current) {
72
- MapMarkerNativeComponent_1.Commands.animateMarkerToCoordinate(this.marker.current, coordinate, duration);
101
+ if (this.fabricMarker) {
102
+ NativeComponentMarker_1.Commands.animateToCoordinates(
103
+ // @ts-ignore
104
+ this.marker.current, coordinate.latitude, coordinate.longitude, duration);
105
+ }
106
+ else {
107
+ MapMarkerNativeComponent_1.Commands.animateMarkerToCoordinate(this.marker.current, coordinate, duration);
108
+ }
73
109
  }
74
110
  }
75
111
  redraw() {
@@ -79,18 +115,24 @@ class MapMarker extends React.Component {
79
115
  }
80
116
  render() {
81
117
  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;
118
+ if (this.fabricMarker === undefined) {
119
+ const provider = this.context;
120
+ this.fabricMarker = !(react_native_1.Platform.OS === 'ios' && provider === ProviderConstants_1.PROVIDER_GOOGLE);
86
121
  }
87
122
  let icon;
88
- if (this.props.icon) {
89
- icon = react_native_1.Image.resolveAssetSource(this.props.icon) || {};
90
- icon = icon.uri;
123
+ if (this.props.icon && this.fabricMarker) {
124
+ icon = (0, fixImageProp_1.fixImageProp)(this.props.icon);
125
+ }
126
+ let image;
127
+ if (this.props.image && this.fabricMarker) {
128
+ image = (0, fixImageProp_1.fixImageProp)(this.props.image);
91
129
  }
92
130
  const AIRMapMarker = this.getNativeComponent();
93
- return (<AIRMapMarker {...this.props} ref={this.marker} image={image} icon={icon} style={[styles.marker, this.props.style]} onPress={event => {
131
+ return (<AIRMapMarker {...this.props} ref={this.marker}
132
+ // @ts-ignore
133
+ image={image}
134
+ // @ts-ignore
135
+ icon={icon} style={[styles.marker, this.props.style]} onPress={event => {
94
136
  if (stopPropagation) {
95
137
  event.stopPropagation();
96
138
  }
@@ -9,9 +9,7 @@ exports.Commands = (0, codegenNativeCommands_1.default)({
9
9
  supportedCommands: [
10
10
  'showCallout',
11
11
  'hideCallout',
12
- 'redrawCallout',
13
12
  'animateMarkerToCoordinate',
14
- 'redraw',
15
13
  'setCoordinates',
16
14
  ],
17
15
  });
@@ -60,6 +60,7 @@ export declare class MapOverlay extends React.Component<MapOverlayProps> {
60
60
  getMapManagerCommand: (name: string) => MapManagerCommand;
61
61
  getUIManagerCommand: (name: string) => UIManagerCommand;
62
62
  static Animated: Animated.AnimatedComponent<typeof MapOverlay>;
63
+ private fabricOverlay?;
63
64
  render(): React.JSX.Element;
64
65
  }
65
66
  type Coordinate = [number, number];
@@ -70,7 +71,7 @@ type OverlayPressEvent = NativeSyntheticEvent<{
70
71
  */
71
72
  action: 'overlay-press' | 'image-overlay-press';
72
73
  /**
73
- * @platform iOS: Apple maps
74
+ * @platform iOS: Apple Maps
74
75
  */
75
76
  name?: string;
76
77
  /**
package/lib/MapOverlay.js CHANGED
@@ -27,24 +27,26 @@ exports.MapOverlay = void 0;
27
27
  const React = __importStar(require("react"));
28
28
  const react_native_1 = require("react-native");
29
29
  const decorateMapComponent_1 = __importStar(require("./decorateMapComponent"));
30
+ const fixImageProp_1 = require("./fixImageProp");
30
31
  class MapOverlay extends React.Component {
31
32
  getNativeComponent;
32
33
  getMapManagerCommand;
33
34
  getUIManagerCommand;
34
35
  static Animated;
36
+ fabricOverlay = undefined;
35
37
  render() {
36
38
  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;
39
+ if (this.fabricOverlay === undefined) {
40
+ this.fabricOverlay = react_native_1.Platform.OS === 'android';
45
41
  }
46
42
  const AIRMapOverlay = this.getNativeComponent();
47
- return (<AIRMapOverlay {...this.props} opacity={opacity} image={image} style={[styles.overlay, this.props.style]}/>);
43
+ let image = this.props.image;
44
+ if (this.props.image && this.fabricOverlay) {
45
+ image = (0, fixImageProp_1.fixImageProp)(this.props.image);
46
+ }
47
+ return (<AIRMapOverlay {...this.props} opacity={opacity}
48
+ // @ts-ignore
49
+ image={image} style={[styles.overlay, this.props.style]}/>);
48
50
  }
49
51
  }
50
52
  exports.MapOverlay = MapOverlay;
@@ -124,7 +124,7 @@ export type MapPolygonProps = ViewProps & {
124
124
  zIndex?: number;
125
125
  };
126
126
  type NativeProps = MapPolygonProps & {
127
- ref: React.RefObject<View>;
127
+ ref: React.RefObject<View | null>;
128
128
  };
129
129
  export declare class MapPolygon extends React.Component<MapPolygonProps> {
130
130
  context: React.ContextType<typeof ProviderContext>;
@@ -14,7 +14,7 @@ export type MapPolylineProps = ViewProps & {
14
14
  * The fill color to use for the path.
15
15
  *
16
16
  * @default `#000`, `rgba(r,g,b,0.5)`
17
- * @platform iOS: Supported
17
+ * @platform iOS: Apple Maps only
18
18
  * @platform Android: Not supported
19
19
  */
20
20
  fillColor?: string;
@@ -32,8 +32,8 @@ export type MapPolylineProps = ViewProps & {
32
32
  *
33
33
  * @default `round`
34
34
  * @platform iOS: Apple Maps only
35
- * @platform Android: Supported
36
- */
35
+ * @platform Android: supported
36
+ * */
37
37
  lineCap?: LineCapType;
38
38
  /**
39
39
  * An array of numbers specifying the dash pattern to use for the path.
@@ -42,8 +42,8 @@ export type MapPolylineProps = ViewProps & {
42
42
  * The values in the array alternate, starting with the first line segment length,
43
43
  * followed by the first gap length, followed by the second line segment length, and so on.
44
44
  *
45
- * @platform iOS: Supported
46
- * @platform Android: Supported
45
+ * @platform iOS: Apple Maps only
46
+ * @platform Android: supported
47
47
  */
48
48
  lineDashPattern?: number[];
49
49
  /**
@@ -60,7 +60,7 @@ export type MapPolylineProps = ViewProps & {
60
60
  * The line join style to apply to corners of the path.
61
61
  *
62
62
  * @platform iOS: Apple Maps only
63
- * @platform Android: Not supported
63
+ * @platform Android: supported
64
64
  */
65
65
  lineJoin?: LineJoinType;
66
66
  /**
@@ -125,7 +125,7 @@ export type MapPolylineProps = ViewProps & {
125
125
  zIndex?: number;
126
126
  };
127
127
  type NativeProps = MapPolylineProps & {
128
- ref: React.RefObject<View>;
128
+ ref: React.RefObject<View | null>;
129
129
  };
130
130
  export declare class MapPolyline extends React.Component<MapPolylineProps> {
131
131
  context: React.ContextType<typeof ProviderContext>;
package/lib/MapView.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { Animated as RNAnimated, Animated, NativeSyntheticEvent, ViewProps } from 'react-native';
3
3
  import { CalloutPressEvent, ClickEvent, Frame, LatLng, MarkerDeselectEvent, MarkerDragEvent, MarkerDragStartEndEvent, MarkerPressEvent, MarkerSelectEvent, Point, Provider, Region } from './sharedTypes';
4
- import { Address, BoundingBox, Camera, CameraZoomRange, ChangeEvent, Details, EdgePadding, FitToOptions, IndoorBuildingEvent, IndoorLevelActivatedEvent, KmlMapEvent, LongPressEvent, MapPressEvent, MapStyleElement, MapType, MapTypes, PanDragEvent, PoiClickEvent, SnapshotOptions, UserLocationChangeEvent } from './MapView.types';
4
+ import { ActiveIndoorLevel, Address, BoundingBox, Camera, CameraZoomRange, ChangeEvent, Details, EdgePadding, FitToOptions, IndoorBuilding, KmlMapEvent, LongPressEvent, MapPressEvent, MapStyleElement, MapType, MapTypes, PanDragEvent, PoiClickEvent, SnapshotOptions, UserLocationChangeEvent } from './MapView.types';
5
5
  import { Modify } from './sharedTypesInternal';
6
6
  import { MapViewNativeComponentType } from './MapViewNativeComponent';
7
7
  import AnimatedRegion from './AnimatedRegion';
@@ -11,7 +11,7 @@ export type MapViewProps = ViewProps & {
11
11
  * If `true` map will be cached and displayed as an image instead of being interactable, for performance usage.
12
12
  *
13
13
  * @default false
14
- * @platform iOS: Apple maps only
14
+ * @platform iOS: Apple Maps only
15
15
  * @platform Android: Supported
16
16
  */
17
17
  cacheEnabled?: boolean;
@@ -92,7 +92,7 @@ export type MapViewProps = ViewProps & {
92
92
  */
93
93
  kmlSrc?: string;
94
94
  /**
95
- * If set, changes the position of the "Legal" label link in Apple maps.
95
+ * If set, changes the position of the "Legal" label link in Apple Maps.
96
96
  *
97
97
  * @platform iOS: Apple Maps only
98
98
  * @platform Android: Not supported
@@ -217,14 +217,14 @@ export type MapViewProps = ViewProps & {
217
217
  * @platform iOS: Google Maps only
218
218
  * @platform Android: Supported
219
219
  */
220
- onIndoorBuildingFocused?: (event: IndoorBuildingEvent) => void;
220
+ onIndoorBuildingFocused?: (indoorBuilding: IndoorBuilding) => void;
221
221
  /**
222
222
  * Callback that is called when a level on indoor building is activated
223
223
  *
224
224
  * @platform iOS: Google Maps only
225
225
  * @platform Android: Supported
226
226
  */
227
- onIndoorLevelActivated?: (event: IndoorLevelActivatedEvent) => void;
227
+ onIndoorLevelActivated?: (indoorLevel: ActiveIndoorLevel) => void;
228
228
  /**
229
229
  * Callback that is called once the kml is fully loaded.
230
230
  *
@@ -426,7 +426,7 @@ export type MapViewProps = ViewProps & {
426
426
  * If `false` compass won't be displayed on the map.
427
427
  *
428
428
  * @default true
429
- * @platform iOS: Supported
429
+ * @platform iOS: Supported (adaptive on Apple Maps, visible only if map is not pointing north)
430
430
  * @platform Android: Supported
431
431
  */
432
432
  showsCompass?: boolean;
@@ -454,32 +454,14 @@ export type MapViewProps = ViewProps & {
454
454
  * @platform Android: Supported
455
455
  */
456
456
  showsMyLocationButton?: boolean;
457
- /**
458
- * If `false` points of interest won't be displayed on the map.
459
- * TODO: DEPRECATED? Doesn't seem to do anything
460
- *
461
- * @default true
462
- * @platform iOS: Maybe Apple Maps?
463
- * @platform Android: Not supported
464
- */
465
- showsPointsOfInterest?: boolean;
466
457
  /**
467
458
  * A Boolean indicating whether the map shows scale information.
468
459
  *
469
- * @default true
460
+ * @default false
470
461
  * @platform iOS: Apple Maps only
471
462
  * @platform Android: Not supported
472
463
  */
473
464
  showsScale?: boolean;
474
- /**
475
- * A Boolean value indicating whether the map displays traffic information.
476
- * TODO: Look into android support
477
- *
478
- * @default false
479
- * @platform iOS: Supported
480
- * @platform Android: Not supported?
481
- */
482
- showsTraffic?: boolean;
483
465
  /**
484
466
  * If `true` the users location will be displayed on the map.
485
467
  *
@@ -510,8 +492,8 @@ export type MapViewProps = ViewProps & {
510
492
  * Sets the map to the style selected.
511
493
  *
512
494
  * @default System setting
513
- * @platform iOS: Apple Maps only (iOS >= 13.0)
514
- * @platform Android: Not supported
495
+ * @platform iOS: Supported
496
+ * @platform Android: Supported
515
497
  */
516
498
  userInterfaceStyle?: 'light' | 'dark';
517
499
  /**
@@ -604,7 +586,7 @@ type ModifiedProps = Modify<MapViewProps, {
604
586
  initialRegion?: MapViewProps['initialRegion'] | null;
605
587
  }>;
606
588
  export type NativeProps = Omit<ModifiedProps, 'customMapStyle' | 'onRegionChange' | 'onRegionChangeComplete'> & {
607
- ref: React.RefObject<MapViewNativeComponentType>;
589
+ ref: React.RefObject<MapViewNativeComponentType | null>;
608
590
  customMapStyleString?: string;
609
591
  handlePanDrag?: boolean;
610
592
  onChange?: (e: ChangeEvent) => void;
@@ -626,6 +608,7 @@ declare class MapView extends React.Component<MapViewProps, State> {
626
608
  duration?: number;
627
609
  }): void;
628
610
  animateToRegion(region: Region, duration?: number): void;
611
+ setRegion(region: Region): void;
629
612
  fitToElements(options?: FitToOptions): void;
630
613
  fitToSuppliedMarkers(markers: string[], options?: FitToOptions): void;
631
614
  fitToCoordinates(coordinates?: LatLng[], options?: FitToOptions): void;
@@ -636,7 +619,7 @@ declare class MapView extends React.Component<MapViewProps, State> {
636
619
  */
637
620
  getMapBoundaries(): Promise<BoundingBox>;
638
621
  setMapBoundaries(northEast: LatLng, southWest: LatLng): void;
639
- setIndoorActiveLevelIndex(activeLevelIndex: number): void;
622
+ setIndoorActiveLevelIndex(activeLevelIndex: number): void | Promise<never>;
640
623
  /**
641
624
  * Takes a snapshot of the map and saves it to a picture
642
625
  * file or returns the image as a base64 encoded string.
@@ -707,8 +690,13 @@ declare class MapView extends React.Component<MapViewProps, State> {
707
690
  private handleMapPress;
708
691
  private handleMarkerPress;
709
692
  private handleMarkerSelect;
693
+ private handleKmlReady;
710
694
  private handleMarkerDeselect;
711
695
  private handleRegionChange;
696
+ private handleRegionChangeStarted;
697
+ private handleIndoorBuildingFocused;
698
+ private handleIndoorLevelActivated;
699
+ private handleRegionChangeComplete;
712
700
  render(): React.JSX.Element;
713
701
  }
714
702
  export declare const AnimatedMapView: RNAnimated.AnimatedComponent<typeof MapView>;