react-native-maps 0.31.0 → 1.0.0-beta.10

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 (76) hide show
  1. package/README.md +2 -6
  2. package/android/src/main/AndroidManifest.xml +0 -3
  3. package/android/src/main/java/com/airbnb/android/react/maps/AirMapLocalTile.java +11 -4
  4. package/android/src/main/java/com/airbnb/android/react/maps/AirMapLocalTileManager.java +5 -1
  5. package/android/src/main/java/com/airbnb/android/react/maps/AirMapManager.java +2 -41
  6. package/android/src/main/java/com/airbnb/android/react/maps/AirMapTileProvider.java +5 -5
  7. package/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java +1 -33
  8. package/ios/AirGoogleMaps/AIRGoogleMap.m +37 -19
  9. package/ios/AirGoogleMaps/AIRGoogleMapManager.m +0 -95
  10. package/ios/AirGoogleMaps/AIRGoogleMapMarker.m +6 -0
  11. package/ios/AirMaps/AIRMap.h +0 -1
  12. package/ios/AirMaps/AIRMap.m +0 -12
  13. package/ios/AirMaps/AIRMapManager.m +4 -135
  14. package/lib/AnimatedRegion.d.ts +19 -0
  15. package/lib/AnimatedRegion.js +134 -0
  16. package/lib/Geojson.d.ts +166 -0
  17. package/lib/Geojson.js +165 -0
  18. package/lib/MapCallout.d.ts +40 -0
  19. package/lib/MapCallout.js +51 -0
  20. package/lib/MapCalloutSubview.d.ts +34 -0
  21. package/lib/MapCalloutSubview.js +48 -0
  22. package/lib/MapCircle.d.ts +117 -0
  23. package/lib/MapCircle.js +53 -0
  24. package/lib/MapHeatmap.d.ts +78 -0
  25. package/lib/MapHeatmap.js +59 -0
  26. package/lib/MapLocalTile.d.ts +35 -0
  27. package/lib/MapLocalTile.js +44 -0
  28. package/lib/MapMarker.d.ts +290 -0
  29. package/lib/MapMarker.js +113 -0
  30. package/lib/MapOverlay.d.ts +87 -0
  31. package/lib/MapOverlay.js +63 -0
  32. package/lib/MapPolygon.d.ts +156 -0
  33. package/lib/MapPolygon.js +74 -0
  34. package/lib/MapPolyline.d.ts +156 -0
  35. package/lib/MapPolyline.js +53 -0
  36. package/lib/MapUrlTile.d.ts +134 -0
  37. package/lib/MapUrlTile.js +44 -0
  38. package/lib/MapView.d.ts +677 -0
  39. package/lib/MapView.js +418 -0
  40. package/lib/MapView.types.d.ts +153 -0
  41. package/lib/MapView.types.js +2 -0
  42. package/{src/MapView.web.js → lib/MapView.web.d.ts} +0 -0
  43. package/lib/MapView.web.js +9 -0
  44. package/lib/MapWMSTile.d.ts +116 -0
  45. package/lib/MapWMSTile.js +44 -0
  46. package/lib/ProviderConstants.d.ts +2 -0
  47. package/lib/ProviderConstants.js +5 -0
  48. package/lib/decorateMapComponent.d.ts +35 -0
  49. package/lib/decorateMapComponent.js +80 -0
  50. package/lib/index.d.ts +37 -0
  51. package/lib/index.js +81 -0
  52. package/lib/sharedTypes.d.ts +81 -0
  53. package/lib/sharedTypes.js +2 -0
  54. package/lib/sharedTypesInternal.d.ts +1 -0
  55. package/lib/sharedTypesInternal.js +2 -0
  56. package/package.json +21 -29
  57. package/react-native-google-maps.podspec +6 -7
  58. package/react-native-maps.podspec +5 -6
  59. package/index.d.ts +0 -637
  60. package/src/AnimatedRegion.js +0 -164
  61. package/src/Geojson.js +0 -334
  62. package/src/MapCallout.js +0 -51
  63. package/src/MapCalloutSubview.js +0 -44
  64. package/src/MapCircle.js +0 -150
  65. package/src/MapHeatmap.js +0 -99
  66. package/src/MapLocalTile.js +0 -52
  67. package/src/MapMarker.js +0 -377
  68. package/src/MapOverlay.js +0 -86
  69. package/src/MapPolygon.js +0 -202
  70. package/src/MapPolyline.js +0 -168
  71. package/src/MapUrlTile.js +0 -131
  72. package/src/MapView.js +0 -1160
  73. package/src/MapWMSTile.js +0 -122
  74. package/src/ProviderConstants.js +0 -2
  75. package/src/decorateMapComponent.js +0 -112
  76. package/src/index.js +0 -31
@@ -0,0 +1,290 @@
1
+ import * as React from 'react';
2
+ import { Animated, ViewProps, ImageURISource, ImageRequireSource, View } from 'react-native';
3
+ import { MapManagerCommand, NativeComponent, ProviderContext, UIManagerCommand } from './decorateMapComponent';
4
+ import { CalloutPressEvent, LatLng, MarkerDeselectEvent, MarkerDragEvent, MarkerDragStartEndEvent, MarkerPressEvent, MarkerSelectEvent, Point } from './sharedTypes';
5
+ import { Modify } from './sharedTypesInternal';
6
+ export declare type MapMarkerProps = ViewProps & {
7
+ /**
8
+ * Sets the anchor point for the marker.
9
+ * The anchor specifies the point in the icon image that is anchored to the marker's position on the Earth's surface.
10
+ *
11
+ * The anchor point is specified in the continuous space [0.0, 1.0] x [0.0, 1.0],
12
+ * where (0, 0) is the top-left corner of the image, and (1, 1) is the bottom-right corner.
13
+ *
14
+ * 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.
15
+ * For example, in a 4 x 2 image, the anchor point (0.7, 0.6) resolves to the grid point at (3, 1).
16
+ *
17
+ * @default {x: 0.5, y: 1.0}
18
+ * @platform iOS: Google Maps only. For Apple Maps, see the `centerOffset` prop
19
+ * @platform Android: Supported
20
+ */
21
+ anchor?: Point;
22
+ /**
23
+ * Specifies the point in the marker image at which to anchor the callout when it is displayed.
24
+ * This is specified in the same coordinate system as the anchor.
25
+ *
26
+ * See the `anchor` prop for more details.
27
+ *
28
+ * @default {x: 0.5, y: 0.0}
29
+ * @platform iOS: Google Maps only. For Apple Maps, see the `calloutOffset` prop
30
+ * @platform Android: Supported
31
+ */
32
+ calloutAnchor?: Point;
33
+ /**
34
+ * The offset (in points) at which to place the callout bubble.
35
+ * When this property is set to (0, 0),
36
+ * the anchor point of the callout bubble is placed on the top-center point of the marker view’s frame.
37
+ *
38
+ * Specifying positive offset values moves the callout bubble down and to the right,
39
+ * while specifying negative values moves it up and to the left
40
+ *
41
+ * @default {x: 0.0, y: 0.0}
42
+ * @platform iOS: Apple Maps only. For Google Maps, see the `calloutAnchor` prop
43
+ * @platform Android: Not supported. See see the `calloutAnchor` prop
44
+ */
45
+ calloutOffset?: Point;
46
+ /**
47
+ * The offset (in points) at which to display the annotation view.
48
+ *
49
+ * By default, the center point of an annotation view is placed at the coordinate point of the associated annotation.
50
+ *
51
+ * Positive offset values move the annotation view down and to the right, while negative values move it up and to the left.
52
+ *
53
+ * @default {x: 0.0, y: 0.0}
54
+ * @platform iOS: Apple Maps only. For Google Maps, see the `anchor` prop
55
+ * @platform Android: Not supported. See see the `anchor` prop
56
+ */
57
+ centerOffset?: Point;
58
+ /**
59
+ * The coordinate for the marker.
60
+ *
61
+ * @platform iOS: Supported
62
+ * @platform Android: Supported
63
+ */
64
+ coordinate: LatLng;
65
+ /**
66
+ * The description of the marker.
67
+ *
68
+ * This is only used if the <Marker /> component has no children that are a `<Callout />`,
69
+ * in which case the default callout behavior will be used,
70
+ * which will show both the `title` and the `description`, if provided.
71
+ *
72
+ * @platform iOS: Supported
73
+ * @platform Android: Supported
74
+ */
75
+ description?: string;
76
+ /**
77
+ * if `true` allows the marker to be draggable (re-positioned).
78
+ *
79
+ * @default false
80
+ * @platform iOS: Supported
81
+ * @platform Android: Supported
82
+ */
83
+ draggable?: boolean;
84
+ /**
85
+ * Sets whether this marker should be flat against the map true or a billboard facing the camera.
86
+ *
87
+ * @default false
88
+ * @platform iOS: Google Maps only
89
+ * @platform Android: Supported
90
+ */
91
+ flat?: boolean;
92
+ /**
93
+ * Marker icon to render (equivalent to `icon` property of GMSMarker Class).
94
+ * Only local image resources are allowed to be used.
95
+ *
96
+ * @platform iOS: Google Maps only
97
+ * @platform Android: Supported
98
+ */
99
+ icon?: ImageURISource | ImageRequireSource;
100
+ /**
101
+ * A string that can be used to identify this marker.
102
+ *
103
+ * @platform iOS: Supported
104
+ * @platform Android: Supported
105
+ */
106
+ identifier?: string;
107
+ /**
108
+ * A custom image to be used as the marker's icon. Only local image resources are allowed to be used.
109
+ *
110
+ * @platform iOS: Supported
111
+ * @platform Android: Supported
112
+ */
113
+ image?: ImageURISource | ImageRequireSource;
114
+ /**
115
+ * When true, the marker will be pre-selected.
116
+ * Setting this to true allows the user to drag the marker without needing to tap on it first to focus it.
117
+ *
118
+ * @default false
119
+ * @platform iOS: Apple Maps only
120
+ * @platform Android: Not supported
121
+ */
122
+ isPreselected?: boolean;
123
+ /**
124
+ * Callback that is called when the user taps the callout view.
125
+ *
126
+ * @platform iOS: Apple Maps only
127
+ * @platform Android: Supported
128
+ */
129
+ onCalloutPress?: (event: CalloutPressEvent) => void;
130
+ /**
131
+ * Callback that is called when the marker is deselected, before the callout is hidden.
132
+ *
133
+ * @platform iOS: Apple Maps only
134
+ * @platform Android: Not supported
135
+ */
136
+ onDeselect?: (event: MarkerDeselectEvent) => void;
137
+ /**
138
+ * Callback called continuously as the marker is dragged
139
+ *
140
+ * @platform iOS: Apple Maps only
141
+ * @platform Android: Supported
142
+ */
143
+ onDrag?: (event: MarkerDragEvent) => void;
144
+ /**
145
+ * Callback that is called when a drag on the marker finishes.
146
+ * This is usually the point you will want to setState on the marker's coordinate again
147
+ *
148
+ * @platform iOS: Apple Maps only
149
+ * @platform Android: Supported
150
+ */
151
+ onDragEnd?: (event: MarkerDragStartEndEvent) => void;
152
+ /**
153
+ * Callback that is called when the user initiates a drag on the marker (if it is draggable)
154
+ *
155
+ * @platform iOS: Apple Maps only
156
+ * @platform Android: Supported
157
+ */
158
+ onDragStart?: (event: MarkerDragStartEndEvent) => void;
159
+ /**
160
+ * Callback that is called when the marker is tapped by the user.
161
+ *
162
+ * @platform iOS: Supported
163
+ * @platform Android: Supported
164
+ */
165
+ onPress?: (event: MarkerPressEvent) => void;
166
+ /**
167
+ * Callback that is called when the marker becomes selected.
168
+ * This will be called when the callout for that marker is about to be shown.
169
+ *
170
+ * @platform iOS: Apple Maps only.
171
+ * @platform Android: Not supported
172
+ */
173
+ onSelect?: (event: MarkerSelectEvent) => void;
174
+ /**
175
+ * The marker's opacity between 0.0 and 1.0.
176
+ *
177
+ * @default 1.0
178
+ * @platform iOS: Supported
179
+ * @platform Android: Supported
180
+ */
181
+ opacity?: number;
182
+ /**
183
+ * If no custom marker view or custom image is provided, the platform default pin will be used, which can be customized by this color.
184
+ * Ignored if a custom marker is being used.<br/><br/>
185
+ * For Android, the set of available colors is limited. Unsupported colors will fall back to red.
186
+ * See [#887](https://github.com/react-community/react-native-maps/issues/887) for more information.
187
+ *
188
+ * @platform iOS: Supported
189
+ * @platform Android: Supported
190
+ */
191
+ pinColor?: string;
192
+ /**
193
+ * A float number indicating marker's rotation angle, in degrees.
194
+ *
195
+ * @default 0
196
+ * @platform iOS: Google Maps only
197
+ * @platform Android: Supported
198
+ */
199
+ rotation?: number;
200
+ /**
201
+ * Sets whether this marker should propagate `onPress` events.
202
+ * Enabling it will stop the parent `MapView`'s `onPress` from being called.
203
+ *
204
+ * Android does not propagate `onPress` events.
205
+ *
206
+ * See [#1132](https://github.com/react-community/react-native-maps/issues/1132) for more information.
207
+ *
208
+ * @default false
209
+ * @platform iOS: Apple Maps only
210
+ * @platform Android: Not supported
211
+ */
212
+ stopPropagation?: boolean;
213
+ /**
214
+ * Sets whether marker should be tappable.
215
+ * If set to false, the marker will not have onPress events.
216
+ *
217
+ * @default true
218
+ * @platform iOS: Google Maps only
219
+ * @platform Android: Not supported
220
+ */
221
+ tappable?: boolean;
222
+ /**
223
+ * The title of the marker.
224
+ * This is only used if the <Marker /> component has no `<Callout />` children.
225
+ *
226
+ * If the marker has <Callout /> children, default callout behavior will be used,
227
+ * which will show both the `title` and the `description`, if provided.
228
+ *
229
+ * @platform iOS: Supported
230
+ * @platform Android: Supported
231
+ */
232
+ title?: string;
233
+ /**
234
+ * Sets whether this marker should track view changes in info window.
235
+ * Enabling it will let marker change content of info window after first render pass, but will lead to decreased performance,
236
+ * so it's recommended to disable it whenever you don't need it.
237
+ * **Note**: iOS Google Maps only.
238
+ *
239
+ * @default false
240
+ * @platform iOS: Google Maps only
241
+ * @platform Android: Not supported
242
+ */
243
+ tracksInfoWindowChanges?: boolean;
244
+ /**
245
+ * Sets whether this marker should track view changes.
246
+ * It's recommended to turn it off whenever it's possible to improve custom marker performance.
247
+ *
248
+ * @default true
249
+ * @platform iOS: Google Maps only
250
+ * @platform Android: Supported
251
+ */
252
+ tracksViewChanges?: boolean;
253
+ /**
254
+ * The order in which this tile overlay is drawn with respect to other overlays.
255
+ * An overlay with a larger z-index is drawn over overlays with smaller z-indices.
256
+ * The order of overlays with the same z-index is arbitrary.
257
+ *
258
+ * @platform iOS: Supported
259
+ * @platform Android: Supported
260
+ */
261
+ zIndex?: number;
262
+ };
263
+ declare type OmittedProps = Omit<MapMarkerProps, 'stopPropagation'>;
264
+ declare type NativeProps = Modify<OmittedProps, {
265
+ icon?: string;
266
+ image?: MapMarkerProps['image'] | string;
267
+ }> & {
268
+ ref: React.RefObject<View>;
269
+ };
270
+ export declare class MapMarker extends React.Component<MapMarkerProps> {
271
+ context: React.ContextType<typeof ProviderContext>;
272
+ getNativeComponent: () => NativeComponent<NativeProps>;
273
+ getMapManagerCommand: (name: string) => MapManagerCommand;
274
+ getUIManagerCommand: (name: string) => UIManagerCommand;
275
+ static Animated: Animated.AnimatedComponent<typeof MapMarker>;
276
+ private marker;
277
+ constructor(props: MapMarkerProps);
278
+ setNativeProps(props: Partial<NativeProps>): void;
279
+ showCallout(): void;
280
+ hideCallout(): void;
281
+ redrawCallout(): void;
282
+ animateMarkerToCoordinate(coordinate: LatLng, duration?: number): void;
283
+ redraw(): void;
284
+ _getHandle(): number | null;
285
+ _runCommand(name: NativeCommandName, args: any[]): void;
286
+ render(): JSX.Element;
287
+ }
288
+ declare const _default: typeof MapMarker;
289
+ export default _default;
290
+ declare type NativeCommandName = 'showCallout' | 'hideCallout' | 'redrawCallout' | 'animateMarkerToCoordinate' | 'redraw';
@@ -0,0 +1,113 @@
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
+ class MapMarker extends React.Component {
31
+ getNativeComponent;
32
+ getMapManagerCommand;
33
+ getUIManagerCommand;
34
+ static Animated;
35
+ marker;
36
+ constructor(props) {
37
+ super(props);
38
+ this.marker = React.createRef();
39
+ this.showCallout = this.showCallout.bind(this);
40
+ this.hideCallout = this.hideCallout.bind(this);
41
+ this.redrawCallout = this.redrawCallout.bind(this);
42
+ this.animateMarkerToCoordinate = this.animateMarkerToCoordinate.bind(this);
43
+ }
44
+ setNativeProps(props) {
45
+ this.marker.current?.setNativeProps(props);
46
+ }
47
+ showCallout() {
48
+ this._runCommand('showCallout', []);
49
+ }
50
+ hideCallout() {
51
+ this._runCommand('hideCallout', []);
52
+ }
53
+ redrawCallout() {
54
+ this._runCommand('redrawCallout', []);
55
+ }
56
+ animateMarkerToCoordinate(coordinate, duration = 500) {
57
+ this._runCommand('animateMarkerToCoordinate', [coordinate, duration]);
58
+ }
59
+ redraw() {
60
+ this._runCommand('redraw', []);
61
+ }
62
+ _getHandle() {
63
+ return (0, react_native_1.findNodeHandle)(this.marker.current);
64
+ }
65
+ _runCommand(name, args) {
66
+ switch (react_native_1.Platform.OS) {
67
+ case 'android':
68
+ react_native_1.UIManager.dispatchViewManagerCommand(this._getHandle(), this.getUIManagerCommand(name), args);
69
+ break;
70
+ case 'ios':
71
+ this.getMapManagerCommand(name)(this._getHandle(), ...args);
72
+ break;
73
+ default:
74
+ break;
75
+ }
76
+ }
77
+ render() {
78
+ const { stopPropagation = false } = this.props;
79
+ let image;
80
+ if (this.props.image) {
81
+ image = react_native_1.Image.resolveAssetSource(this.props.image) || {};
82
+ image = image.uri || this.props.image;
83
+ }
84
+ let icon;
85
+ if (this.props.icon) {
86
+ icon = react_native_1.Image.resolveAssetSource(this.props.icon) || {};
87
+ icon = icon.uri;
88
+ }
89
+ const AIRMapMarker = this.getNativeComponent();
90
+ return (<AIRMapMarker {...this.props} ref={this.marker} image={image} icon={icon} style={[styles.marker, this.props.style]} onPress={event => {
91
+ if (stopPropagation) {
92
+ event.stopPropagation();
93
+ }
94
+ if (this.props.onPress) {
95
+ this.props.onPress(event);
96
+ }
97
+ }}/>);
98
+ }
99
+ }
100
+ exports.MapMarker = MapMarker;
101
+ const styles = react_native_1.StyleSheet.create({
102
+ marker: {
103
+ position: 'absolute',
104
+ backgroundColor: 'transparent',
105
+ },
106
+ });
107
+ MapMarker.Animated = react_native_1.Animated.createAnimatedComponent(MapMarker);
108
+ exports.default = (0, decorateMapComponent_1.default)(MapMarker, 'Marker', {
109
+ google: {
110
+ ios: decorateMapComponent_1.SUPPORTED,
111
+ android: decorateMapComponent_1.USES_DEFAULT_IMPLEMENTATION,
112
+ },
113
+ });
@@ -0,0 +1,87 @@
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 declare 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
+ declare 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(): JSX.Element;
64
+ }
65
+ declare type Coordinate = [number, number];
66
+ declare 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;
@@ -0,0 +1,63 @@
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
+ });