react-native-maps 0.31.1 → 1.0.0-beta.1

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