react-native-maps 1.26.11 → 1.26.13
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.
- package/android/src/main/java/com/rnmaps/fabric/MapViewManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapView.java +2 -4
- package/dist/plugin/src/android.d.ts +4 -0
- package/dist/plugin/src/index.d.ts +4 -0
- package/dist/plugin/src/ios.d.ts +15 -0
- package/dist/plugin/src/types.d.ts +4 -0
- package/dist/src/AnimatedRegion.d.ts +19 -0
- package/dist/src/Geojson.d.ts +204 -0
- package/dist/src/MapCallout.d.ts +40 -0
- package/dist/src/MapCalloutSubview.d.ts +34 -0
- package/dist/src/MapCircle.d.ts +117 -0
- package/dist/src/MapHeatmap.d.ts +78 -0
- package/dist/src/MapLocalTile.d.ts +35 -0
- package/dist/src/MapMarker.d.ts +322 -0
- package/dist/src/MapMarkerNativeComponent.d.ts +14 -0
- package/dist/src/MapOverlay.d.ts +88 -0
- package/dist/src/MapPolygon.d.ts +140 -0
- package/dist/src/MapPolygon.types.d.ts +18 -0
- package/dist/src/MapPolyline.d.ts +156 -0
- package/dist/src/MapUrlTile.d.ts +134 -0
- package/dist/src/MapView.d.ts +723 -0
- package/dist/src/MapView.types.d.ts +160 -0
- package/dist/src/MapView.web.d.ts +1 -0
- package/dist/src/MapViewNativeComponent.d.ts +17 -0
- package/dist/src/MapWMSTile.d.ts +116 -0
- package/dist/src/ProviderConstants.d.ts +2 -0
- package/dist/src/createFabricMap.d.ts +25 -0
- package/dist/src/decorateMapComponent.d.ts +35 -0
- package/dist/src/fixImageProp.d.ts +4 -0
- package/dist/src/index.d.ts +38 -0
- package/dist/src/sharedTypes.d.ts +87 -0
- package/dist/src/sharedTypesInternal.d.ts +1 -0
- package/dist/src/specs/NativeAirMapsModule.d.ts +31 -0
- package/dist/src/specs/NativeComponentCallout.d.ts +46 -0
- package/dist/src/specs/NativeComponentCircle.d.ts +74 -0
- package/dist/src/specs/NativeComponentGoogleMapView.d.ts +709 -0
- package/dist/src/specs/NativeComponentGooglePolygon.d.ts +83 -0
- package/dist/src/specs/NativeComponentMapView.d.ts +897 -0
- package/dist/src/specs/NativeComponentMarker.d.ts +278 -0
- package/dist/src/specs/NativeComponentOverlay.d.ts +76 -0
- package/dist/src/specs/NativeComponentPolyline.d.ts +101 -0
- package/dist/src/specs/NativeComponentUrlTile.d.ts +109 -0
- package/dist/src/specs/NativeComponentWMSTile.d.ts +91 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +4 -1
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Animated, type ViewProps, type ImageURISource, type ImageRequireSource } from 'react-native';
|
|
3
|
+
import { ProviderContext, type MapManagerCommand, type NativeComponent, type UIManagerCommand } from './decorateMapComponent';
|
|
4
|
+
import { type MapMarkerNativeComponentType } from './MapMarkerNativeComponent';
|
|
5
|
+
import type { AppleMarkerPriority } from './specs/NativeComponentMarker';
|
|
6
|
+
import type { CalloutPressEvent, LatLng, MarkerDeselectEvent, MarkerDragEvent, MarkerDragStartEndEvent, MarkerPressEvent, MarkerSelectEvent, Point } from './sharedTypes';
|
|
7
|
+
import type { Modify } from './sharedTypesInternal';
|
|
8
|
+
type AppleMarkerVisibility = 'hidden' | 'adaptive' | 'visible';
|
|
9
|
+
export type MapMarkerProps = ViewProps & {
|
|
10
|
+
/**
|
|
11
|
+
* Sets the anchor point for the marker.
|
|
12
|
+
* The anchor specifies the point in the icon image that is anchored to the marker's position on the Earth's surface.
|
|
13
|
+
*
|
|
14
|
+
* The anchor point is specified in the continuous space [0.0, 1.0] x [0.0, 1.0],
|
|
15
|
+
* where (0, 0) is the top-left corner of the image, and (1, 1) is the bottom-right corner.
|
|
16
|
+
*
|
|
17
|
+
* 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.
|
|
18
|
+
* For example, in a 4 x 2 image, the anchor point (0.7, 0.6) resolves to the grid point at (3, 1).
|
|
19
|
+
*
|
|
20
|
+
* @default {x: 0.5, y: 1.0}
|
|
21
|
+
* @platform iOS: Google Maps only. For Apple Maps, see the `centerOffset` prop
|
|
22
|
+
* @platform Android: Supported
|
|
23
|
+
*/
|
|
24
|
+
anchor?: Point;
|
|
25
|
+
/**
|
|
26
|
+
* Specifies the point in the marker image at which to anchor the callout when it is displayed.
|
|
27
|
+
* This is specified in the same coordinate system as the anchor.
|
|
28
|
+
*
|
|
29
|
+
* See the `anchor` prop for more details.
|
|
30
|
+
*
|
|
31
|
+
* @default {x: 0.5, y: 0.0}
|
|
32
|
+
* @platform iOS: Google Maps only. For Apple Maps, see the `calloutOffset` prop
|
|
33
|
+
* @platform Android: Supported
|
|
34
|
+
*/
|
|
35
|
+
calloutAnchor?: Point;
|
|
36
|
+
/**
|
|
37
|
+
* The offset (in points) at which to place the callout bubble.
|
|
38
|
+
* When this property is set to (0, 0),
|
|
39
|
+
* the anchor point of the callout bubble is placed on the top-center point of the marker view’s frame.
|
|
40
|
+
*
|
|
41
|
+
* Specifying positive offset values moves the callout bubble down and to the right,
|
|
42
|
+
* while specifying negative values moves it up and to the left
|
|
43
|
+
*
|
|
44
|
+
* @default {x: 0.0, y: 0.0}
|
|
45
|
+
* @platform iOS: Apple Maps only. For Google Maps, see the `calloutAnchor` prop
|
|
46
|
+
* @platform Android: Not supported. see the `calloutAnchor` prop
|
|
47
|
+
*/
|
|
48
|
+
calloutOffset?: Point;
|
|
49
|
+
/**
|
|
50
|
+
* The offset (in points) at which to display the annotation view.
|
|
51
|
+
*
|
|
52
|
+
* By default, the center point of an annotation view is placed at the coordinate point of the associated annotation.
|
|
53
|
+
*
|
|
54
|
+
* Positive offset values move the annotation view down and to the right, while negative values move it up and to the left.
|
|
55
|
+
*
|
|
56
|
+
* @default {x: 0.0, y: 0.0}
|
|
57
|
+
* @platform iOS: Apple Maps only. For Google Maps, see the `anchor` prop
|
|
58
|
+
* @platform Android: Not supported. see the `anchor` prop
|
|
59
|
+
*/
|
|
60
|
+
centerOffset?: Point;
|
|
61
|
+
/**
|
|
62
|
+
* The coordinate for the marker.
|
|
63
|
+
*
|
|
64
|
+
* @platform iOS: Supported
|
|
65
|
+
* @platform Android: Supported
|
|
66
|
+
*/
|
|
67
|
+
coordinate: LatLng;
|
|
68
|
+
/**
|
|
69
|
+
* The description of the marker.
|
|
70
|
+
*
|
|
71
|
+
* This is only used if the <Marker /> component has no children that are a `<Callout />`,
|
|
72
|
+
* in which case the default callout behavior will be used,
|
|
73
|
+
* which will show both the `title` and the `description`, if provided.
|
|
74
|
+
*
|
|
75
|
+
* @platform iOS: Supported
|
|
76
|
+
* @platform Android: Supported
|
|
77
|
+
*/
|
|
78
|
+
description?: string;
|
|
79
|
+
/**
|
|
80
|
+
* if `true` allows the marker to be draggable (re-positioned).
|
|
81
|
+
*
|
|
82
|
+
* @default false
|
|
83
|
+
* @platform iOS: Supported
|
|
84
|
+
* @platform Android: Supported
|
|
85
|
+
*/
|
|
86
|
+
draggable?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Sets whether this marker should be flat against the map true or a billboard facing the camera.
|
|
89
|
+
*
|
|
90
|
+
* @default false
|
|
91
|
+
* @platform iOS: Google Maps only
|
|
92
|
+
* @platform Android: Supported
|
|
93
|
+
*/
|
|
94
|
+
flat?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Marker icon to render (equivalent to `icon` property of GMSMarker Class).
|
|
97
|
+
* Only local image resources are allowed to be used.
|
|
98
|
+
*
|
|
99
|
+
* @platform iOS: Google Maps only
|
|
100
|
+
* @platform Android: Supported
|
|
101
|
+
*/
|
|
102
|
+
icon?: ImageURISource | ImageRequireSource;
|
|
103
|
+
/**
|
|
104
|
+
* A string that can be used to identify this marker.
|
|
105
|
+
*
|
|
106
|
+
* @platform iOS: Supported
|
|
107
|
+
* @platform Android: Supported
|
|
108
|
+
*/
|
|
109
|
+
identifier?: string;
|
|
110
|
+
/**
|
|
111
|
+
* A custom image to be used as the marker's icon. Only local image resources are allowed to be used.
|
|
112
|
+
*
|
|
113
|
+
* @platform iOS: Supported
|
|
114
|
+
* @platform Android: Supported
|
|
115
|
+
*/
|
|
116
|
+
image?: ImageURISource | ImageRequireSource;
|
|
117
|
+
/**
|
|
118
|
+
* When true, the marker will be pre-selected.
|
|
119
|
+
* Setting this to true allows the user to drag the marker without needing to tap on it first to focus it.
|
|
120
|
+
*
|
|
121
|
+
* @default false
|
|
122
|
+
* @platform iOS: Apple Maps only
|
|
123
|
+
* @platform Android: Not supported
|
|
124
|
+
*/
|
|
125
|
+
isPreselected?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Callback that is called when the user taps the callout view.
|
|
128
|
+
*
|
|
129
|
+
* @platform iOS: Apple Maps only
|
|
130
|
+
* @platform Android: Supported
|
|
131
|
+
*/
|
|
132
|
+
onCalloutPress?: (event: CalloutPressEvent) => void;
|
|
133
|
+
/**
|
|
134
|
+
* Callback that is called when the marker is deselected, before the callout is hidden.
|
|
135
|
+
*
|
|
136
|
+
* @platform iOS: Apple Maps only
|
|
137
|
+
* @platform Android: Not supported
|
|
138
|
+
*/
|
|
139
|
+
onDeselect?: (event: MarkerDeselectEvent) => void;
|
|
140
|
+
/**
|
|
141
|
+
* Callback called continuously as the marker is dragged
|
|
142
|
+
*
|
|
143
|
+
* @platform iOS: Apple Maps only
|
|
144
|
+
* @platform Android: Supported
|
|
145
|
+
*/
|
|
146
|
+
onDrag?: (event: MarkerDragEvent) => void;
|
|
147
|
+
/**
|
|
148
|
+
* Callback that is called when a drag on the marker finishes.
|
|
149
|
+
* This is usually the point you will want to setState on the marker's coordinate again
|
|
150
|
+
*
|
|
151
|
+
* @platform iOS: Apple Maps only
|
|
152
|
+
* @platform Android: Supported
|
|
153
|
+
*/
|
|
154
|
+
onDragEnd?: (event: MarkerDragStartEndEvent) => void;
|
|
155
|
+
/**
|
|
156
|
+
* Callback that is called when the user initiates a drag on the marker (if it is draggable)
|
|
157
|
+
*
|
|
158
|
+
* @platform iOS: Apple Maps only
|
|
159
|
+
* @platform Android: Supported
|
|
160
|
+
*/
|
|
161
|
+
onDragStart?: (event: MarkerDragStartEndEvent) => void;
|
|
162
|
+
/**
|
|
163
|
+
* Callback that is called when the marker is tapped by the user.
|
|
164
|
+
*
|
|
165
|
+
* @platform iOS: Supported
|
|
166
|
+
* @platform Android: Supported
|
|
167
|
+
*/
|
|
168
|
+
onPress?: (event: MarkerPressEvent) => void;
|
|
169
|
+
/**
|
|
170
|
+
* Callback that is called when the marker becomes selected.
|
|
171
|
+
* This will be called when the callout for that marker is about to be shown.
|
|
172
|
+
*
|
|
173
|
+
* @platform iOS: Supported.
|
|
174
|
+
* @platform Android: Supported
|
|
175
|
+
*/
|
|
176
|
+
onSelect?: (event: MarkerSelectEvent) => void;
|
|
177
|
+
/**
|
|
178
|
+
* The marker's opacity between 0.0 and 1.0.
|
|
179
|
+
*
|
|
180
|
+
* @default 1.0
|
|
181
|
+
* @platform iOS: Supported
|
|
182
|
+
* @platform Android: Supported
|
|
183
|
+
*/
|
|
184
|
+
opacity?: number;
|
|
185
|
+
/**
|
|
186
|
+
* If no custom marker view or custom image is provided, the platform default pin will be used, which can be customized by this color.
|
|
187
|
+
* Ignored if a custom marker is being used.<br/><br/>
|
|
188
|
+
* For Android, the set of available colors is limited. Unsupported colors will fall back to red.
|
|
189
|
+
* See [#887](https://github.com/react-community/react-native-maps/issues/887) for more information.
|
|
190
|
+
*
|
|
191
|
+
* @platform iOS: Supported
|
|
192
|
+
* @platform Android: Supported
|
|
193
|
+
*/
|
|
194
|
+
pinColor?: string;
|
|
195
|
+
/**
|
|
196
|
+
* A float number indicating marker's rotation angle, in degrees.
|
|
197
|
+
*
|
|
198
|
+
* @default 0
|
|
199
|
+
* @platform iOS: Google Maps only
|
|
200
|
+
* @platform Android: Supported
|
|
201
|
+
*/
|
|
202
|
+
rotation?: number;
|
|
203
|
+
/**
|
|
204
|
+
* Sets whether this marker should propagate `onPress` events.
|
|
205
|
+
* Enabling it will stop the parent `MapView`'s `onPress` from being called.
|
|
206
|
+
*
|
|
207
|
+
* Android does not propagate `onPress` events.
|
|
208
|
+
*
|
|
209
|
+
* See [#1132](https://github.com/react-community/react-native-maps/issues/1132) for more information.
|
|
210
|
+
*
|
|
211
|
+
* @default false
|
|
212
|
+
* @platform iOS: Apple Maps only
|
|
213
|
+
* @platform Android: Not supported
|
|
214
|
+
*/
|
|
215
|
+
stopPropagation?: boolean;
|
|
216
|
+
/**
|
|
217
|
+
* Sets whether marker should be tappable.
|
|
218
|
+
* If set to false, the marker will not have onPress events.
|
|
219
|
+
*
|
|
220
|
+
* @default true
|
|
221
|
+
* @platform iOS: Google Maps only
|
|
222
|
+
* @platform Android: Not supported
|
|
223
|
+
*/
|
|
224
|
+
tappable?: boolean;
|
|
225
|
+
/**
|
|
226
|
+
* The title of the marker.
|
|
227
|
+
* This is only used if the <Marker /> component has no `<Callout />` children.
|
|
228
|
+
*
|
|
229
|
+
* If the marker has <Callout /> children, default callout behavior will be used,
|
|
230
|
+
* which will show both the `title` and the `description`, if provided.
|
|
231
|
+
*
|
|
232
|
+
* @platform iOS: Supported
|
|
233
|
+
* @platform Android: Supported
|
|
234
|
+
*/
|
|
235
|
+
title?: string;
|
|
236
|
+
/**
|
|
237
|
+
* Sets whether this marker should track view changes in info window.
|
|
238
|
+
* Enabling it will let marker change content of info window after first render pass, but will lead to decreased performance,
|
|
239
|
+
* so it's recommended to disable it whenever you don't need it.
|
|
240
|
+
* **Note**: iOS Google Maps only.
|
|
241
|
+
*
|
|
242
|
+
* @default false
|
|
243
|
+
* @platform iOS: Google Maps only
|
|
244
|
+
* @platform Android: Not supported
|
|
245
|
+
*/
|
|
246
|
+
tracksInfoWindowChanges?: boolean;
|
|
247
|
+
/**
|
|
248
|
+
* Sets whether this marker should track view changes.
|
|
249
|
+
* It's recommended to turn it off whenever it's possible to improve custom marker performance.
|
|
250
|
+
*
|
|
251
|
+
* @default true
|
|
252
|
+
* @platform iOS: Google Maps only
|
|
253
|
+
* @platform Android: Supported
|
|
254
|
+
*/
|
|
255
|
+
tracksViewChanges?: boolean;
|
|
256
|
+
/**
|
|
257
|
+
* The order in which this tile overlay is drawn with respect to other overlays.
|
|
258
|
+
* An overlay with a larger z-index is drawn over overlays with smaller z-indices.
|
|
259
|
+
* The order of overlays with the same z-index is arbitrary.
|
|
260
|
+
*
|
|
261
|
+
* @platform iOS: Supported
|
|
262
|
+
* @platform Android: Supported
|
|
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;
|
|
276
|
+
/**
|
|
277
|
+
* Visibility of the title text rendered beneath Marker balloon
|
|
278
|
+
* @platform iOS: Apple Maps only
|
|
279
|
+
* @platform Android: Not supported
|
|
280
|
+
*/
|
|
281
|
+
titleVisibility?: AppleMarkerVisibility;
|
|
282
|
+
/**
|
|
283
|
+
* Visibility of the subtitle text rendered beneath Marker balloon
|
|
284
|
+
* @platform iOS: Apple Maps only
|
|
285
|
+
* @platform Android: Not supported
|
|
286
|
+
*/
|
|
287
|
+
subtitleVisibility?: AppleMarkerVisibility;
|
|
288
|
+
/**
|
|
289
|
+
* Indicate type of default markers if it's true MKPinAnnotationView will be used and MKMarkerAnnotationView if it's false
|
|
290
|
+
* It doesn't change anything if you are using custom Markers
|
|
291
|
+
* @platform iOS: Apple Maps only
|
|
292
|
+
* @platform Android: Not supported
|
|
293
|
+
*/
|
|
294
|
+
useLegacyPinView?: boolean;
|
|
295
|
+
};
|
|
296
|
+
type OmittedProps = Omit<MapMarkerProps, 'stopPropagation'>;
|
|
297
|
+
export type NativeProps = Modify<OmittedProps, {
|
|
298
|
+
icon?: string;
|
|
299
|
+
image?: MapMarkerProps['image'] | string;
|
|
300
|
+
}> & {
|
|
301
|
+
ref: React.RefObject<MapMarkerNativeComponentType | null>;
|
|
302
|
+
};
|
|
303
|
+
export declare class MapMarker extends React.Component<MapMarkerProps> {
|
|
304
|
+
context: React.ContextType<typeof ProviderContext>;
|
|
305
|
+
getNativeComponent: () => NativeComponent<NativeProps>;
|
|
306
|
+
getMapManagerCommand: (name: string) => MapManagerCommand;
|
|
307
|
+
getUIManagerCommand: (name: string) => UIManagerCommand;
|
|
308
|
+
static Animated: Animated.AnimatedComponent<typeof MapMarker>;
|
|
309
|
+
private marker;
|
|
310
|
+
private fabricMarker?;
|
|
311
|
+
constructor(props: MapMarkerProps);
|
|
312
|
+
setNativeProps(props: Partial<NativeProps>): void;
|
|
313
|
+
showCallout(): void;
|
|
314
|
+
hideCallout(): void;
|
|
315
|
+
setCoordinates(coordinate: LatLng): void;
|
|
316
|
+
redrawCallout(): void;
|
|
317
|
+
animateMarkerToCoordinate(coordinate: LatLng, duration?: number): void;
|
|
318
|
+
redraw(): void;
|
|
319
|
+
render(): React.JSX.Element;
|
|
320
|
+
}
|
|
321
|
+
declare const _default: typeof MapMarker;
|
|
322
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HostComponent } from 'react-native';
|
|
2
|
+
import type { NativeProps } from './MapMarker';
|
|
3
|
+
import type { LatLng } from './sharedTypes';
|
|
4
|
+
export type MapMarkerNativeComponentType = HostComponent<NativeProps>;
|
|
5
|
+
interface NativeCommands {
|
|
6
|
+
showCallout: (viewRef: NonNullable<React.RefObject<MapMarkerNativeComponentType>['current']>) => void;
|
|
7
|
+
hideCallout: (viewRef: NonNullable<React.RefObject<MapMarkerNativeComponentType>['current']>) => void;
|
|
8
|
+
setCoordinates: (viewRef: NonNullable<React.RefObject<MapMarkerNativeComponentType>['current']>, coordinate: LatLng) => void;
|
|
9
|
+
redrawCallout: (viewRef: NonNullable<React.RefObject<MapMarkerNativeComponentType>['current']>) => void;
|
|
10
|
+
animateMarkerToCoordinate: (viewRef: NonNullable<React.RefObject<MapMarkerNativeComponentType>['current']>, coordinate: LatLng, duration: number) => void;
|
|
11
|
+
redraw: (viewRef: NonNullable<React.RefObject<MapMarkerNativeComponentType>['current']>) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const Commands: NativeCommands;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Animated, type ViewProps, type ImageURISource, type ImageRequireSource, type NativeSyntheticEvent } from 'react-native';
|
|
3
|
+
import { ProviderContext, type MapManagerCommand, type NativeComponent, type UIManagerCommand } from './decorateMapComponent';
|
|
4
|
+
import type { LatLng, Point } from './sharedTypes';
|
|
5
|
+
import type { Modify } from './sharedTypesInternal';
|
|
6
|
+
export type MapOverlayProps = ViewProps & {
|
|
7
|
+
/**
|
|
8
|
+
* The bearing in degrees clockwise from north. Values outside the range [0, 360) will be normalized.
|
|
9
|
+
*
|
|
10
|
+
* @default 0
|
|
11
|
+
* @platform iOS: Google Maps only
|
|
12
|
+
* @platform Android: Supported
|
|
13
|
+
*/
|
|
14
|
+
bearing?: number;
|
|
15
|
+
/**
|
|
16
|
+
* The coordinates for the image (right-top corner, left-bottom corner). ie.```[[lat, long], [lat, long]]```
|
|
17
|
+
*
|
|
18
|
+
* @platform iOS: Supported
|
|
19
|
+
* @platform Android: Supported
|
|
20
|
+
*/
|
|
21
|
+
bounds: [Coordinate, Coordinate];
|
|
22
|
+
/**
|
|
23
|
+
* A custom image to be used as the overlay.
|
|
24
|
+
* Only required local image resources and uri (as for images located in the net) are allowed to be used.
|
|
25
|
+
*
|
|
26
|
+
* @platform iOS: Supported
|
|
27
|
+
* @platform Android: Supported
|
|
28
|
+
*/
|
|
29
|
+
image: ImageURISource | ImageRequireSource;
|
|
30
|
+
/**
|
|
31
|
+
* Callback that is called when the user presses on the overlay
|
|
32
|
+
*
|
|
33
|
+
* @platform iOS: Apple Maps only
|
|
34
|
+
* @platform Android: Supported
|
|
35
|
+
*/
|
|
36
|
+
onPress?: (event: OverlayPressEvent) => void;
|
|
37
|
+
/**
|
|
38
|
+
* The opacity of the overlay.
|
|
39
|
+
*
|
|
40
|
+
* @default 1
|
|
41
|
+
* @platform iOS: Google Maps only
|
|
42
|
+
* @platform Android: Supported
|
|
43
|
+
*/
|
|
44
|
+
opacity?: number;
|
|
45
|
+
/**
|
|
46
|
+
* Boolean to allow an overlay to be tappable and use the onPress function.
|
|
47
|
+
*
|
|
48
|
+
* @default false
|
|
49
|
+
* @platform iOS: Not supported
|
|
50
|
+
* @platform Android: Supported
|
|
51
|
+
*/
|
|
52
|
+
tappable?: boolean;
|
|
53
|
+
};
|
|
54
|
+
type NativeProps = Modify<MapOverlayProps, {
|
|
55
|
+
image?: string;
|
|
56
|
+
}>;
|
|
57
|
+
export declare class MapOverlay extends React.Component<MapOverlayProps> {
|
|
58
|
+
context: React.ContextType<typeof ProviderContext>;
|
|
59
|
+
getNativeComponent: () => NativeComponent<NativeProps>;
|
|
60
|
+
getMapManagerCommand: (name: string) => MapManagerCommand;
|
|
61
|
+
getUIManagerCommand: (name: string) => UIManagerCommand;
|
|
62
|
+
static Animated: Animated.AnimatedComponent<typeof MapOverlay>;
|
|
63
|
+
private fabricOverlay?;
|
|
64
|
+
render(): React.JSX.Element;
|
|
65
|
+
}
|
|
66
|
+
type Coordinate = [number, number];
|
|
67
|
+
type OverlayPressEvent = NativeSyntheticEvent<{
|
|
68
|
+
/**
|
|
69
|
+
* @platform iOS: Apple Maps: `image-overlay-press`
|
|
70
|
+
* @platform Android: `overlay-press`
|
|
71
|
+
*/
|
|
72
|
+
action: 'overlay-press' | 'image-overlay-press';
|
|
73
|
+
/**
|
|
74
|
+
* @platform iOS: Apple Maps
|
|
75
|
+
*/
|
|
76
|
+
name?: string;
|
|
77
|
+
/**
|
|
78
|
+
* @platform iOS: Apple Maps
|
|
79
|
+
* @platform Android
|
|
80
|
+
*/
|
|
81
|
+
coordinate?: LatLng;
|
|
82
|
+
/**
|
|
83
|
+
* @platform Android
|
|
84
|
+
*/
|
|
85
|
+
position?: Point;
|
|
86
|
+
}>;
|
|
87
|
+
declare const _default: typeof MapOverlay;
|
|
88
|
+
export default _default;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { View, type ViewProps } from 'react-native';
|
|
3
|
+
import { ProviderContext, type NativeComponent, type MapManagerCommand, type UIManagerCommand } from './decorateMapComponent';
|
|
4
|
+
import type { PolygonPressEvent } from './MapPolygon.types';
|
|
5
|
+
import type { LatLng, LineCapType, LineJoinType } from './sharedTypes';
|
|
6
|
+
export type MapPolygonProps = ViewProps & {
|
|
7
|
+
/**
|
|
8
|
+
* An array of coordinates to describe the polygon
|
|
9
|
+
*
|
|
10
|
+
* @platform iOS: Supported
|
|
11
|
+
* @platform Android: Supported
|
|
12
|
+
*/
|
|
13
|
+
coordinates: LatLng[];
|
|
14
|
+
/**
|
|
15
|
+
* The fill color to use for the path.
|
|
16
|
+
*
|
|
17
|
+
* @default `#000`, `rgba(r,g,b,0.5)`
|
|
18
|
+
* @platform iOS: Supported
|
|
19
|
+
* @platform Android: Supported
|
|
20
|
+
*/
|
|
21
|
+
fillColor?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Boolean to indicate whether to draw each segment of the line as a geodesic as opposed to straight lines on the Mercator projection.
|
|
24
|
+
* A geodesic is the shortest path between two points on the Earth's surface.
|
|
25
|
+
* The geodesic curve is constructed assuming the Earth is a sphere.
|
|
26
|
+
*
|
|
27
|
+
* @platform iOS: Google Maps only
|
|
28
|
+
* @platform Android: Supported
|
|
29
|
+
*/
|
|
30
|
+
geodesic?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* A 2d array of coordinates to describe holes of the polygon where each hole has at least 3 points.
|
|
33
|
+
*
|
|
34
|
+
* @platform iOS: Supported
|
|
35
|
+
* @platform Android: Supported
|
|
36
|
+
*/
|
|
37
|
+
holes?: LatLng[][];
|
|
38
|
+
/**
|
|
39
|
+
* The line cap style to apply to the open ends of the path
|
|
40
|
+
*
|
|
41
|
+
* @default `round`
|
|
42
|
+
* @platform iOS: Apple Maps only
|
|
43
|
+
* @platform Android: Not supported
|
|
44
|
+
*/
|
|
45
|
+
lineCap?: LineCapType;
|
|
46
|
+
/**
|
|
47
|
+
* An array of numbers specifying the dash pattern to use for the path.
|
|
48
|
+
* The array contains one or more numbers that indicate the lengths (measured in points)
|
|
49
|
+
* of the line segments and gaps in the pattern.
|
|
50
|
+
* The values in the array alternate, starting with the first line segment length,
|
|
51
|
+
* followed by the first gap length, followed by the second line segment length, and so on.
|
|
52
|
+
*
|
|
53
|
+
* @platform iOS: Apple Maps only
|
|
54
|
+
* @platform Android: Supported
|
|
55
|
+
*/
|
|
56
|
+
lineDashPattern?: number[];
|
|
57
|
+
/**
|
|
58
|
+
* The offset (in points) at which to start drawing the dash pattern.
|
|
59
|
+
* Use this property to start drawing a dashed line partway through a segment or gap.
|
|
60
|
+
* 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.
|
|
61
|
+
*
|
|
62
|
+
* @default 0
|
|
63
|
+
* @platform iOS: Apple Maps only
|
|
64
|
+
* @platform Android: Not supported
|
|
65
|
+
*/
|
|
66
|
+
lineDashPhase?: number;
|
|
67
|
+
/**
|
|
68
|
+
* The line join style to apply to corners of the path.
|
|
69
|
+
*
|
|
70
|
+
* @platform iOS: Apple Maps only
|
|
71
|
+
* @platform Android: Not supported
|
|
72
|
+
*/
|
|
73
|
+
lineJoin?: LineJoinType;
|
|
74
|
+
/**
|
|
75
|
+
* The limiting value that helps avoid spikes at junctions between connected line segments.
|
|
76
|
+
* The miter limit helps you avoid spikes in paths that use the `miter` `lineJoin` style.
|
|
77
|
+
* If the ratio of the miter length—that is, the diagonal length of the miter join—to the line thickness exceeds the miter limit,
|
|
78
|
+
* the joint is converted to a bevel join.
|
|
79
|
+
* The default miter limit is 10, which results in the conversion of miters whose angle at the joint is less than 11 degrees.
|
|
80
|
+
*
|
|
81
|
+
* @default 10
|
|
82
|
+
* @platform iOS: Apple Maps only
|
|
83
|
+
* @platform Android: Not supported
|
|
84
|
+
*/
|
|
85
|
+
miterLimit?: number;
|
|
86
|
+
/**
|
|
87
|
+
* Callback that is called when the user presses on the polygon
|
|
88
|
+
*
|
|
89
|
+
* @platform iOS: Supported
|
|
90
|
+
* @platform Android: Supported
|
|
91
|
+
*/
|
|
92
|
+
onPress?: (event: PolygonPressEvent) => void;
|
|
93
|
+
/**
|
|
94
|
+
* The stroke color to use for the path.
|
|
95
|
+
*
|
|
96
|
+
* @default `#000`, `rgba(r,g,b,0.5)`
|
|
97
|
+
* @platform iOS: Supported
|
|
98
|
+
* @platform Android: Supported
|
|
99
|
+
*/
|
|
100
|
+
strokeColor?: string;
|
|
101
|
+
/**
|
|
102
|
+
* The stroke width to use for the path.
|
|
103
|
+
*
|
|
104
|
+
* @default 1
|
|
105
|
+
* @platform iOS: Supported
|
|
106
|
+
* @platform Android: Supported
|
|
107
|
+
*/
|
|
108
|
+
strokeWidth?: number;
|
|
109
|
+
/**
|
|
110
|
+
* Boolean to allow a polygon to be tappable and use the onPress function.
|
|
111
|
+
*
|
|
112
|
+
* @platform iOS: Google Maps only
|
|
113
|
+
* @platform Android: Supported
|
|
114
|
+
*/
|
|
115
|
+
tappable?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* The order in which this tile overlay is drawn with respect to other overlays.
|
|
118
|
+
* An overlay with a larger z-index is drawn over overlays with smaller z-indices.
|
|
119
|
+
* The order of overlays with the same z-index is arbitrary.
|
|
120
|
+
*
|
|
121
|
+
* @platform iOS: Google Maps only
|
|
122
|
+
* @platform Android: Supported
|
|
123
|
+
*/
|
|
124
|
+
zIndex?: number;
|
|
125
|
+
};
|
|
126
|
+
type NativeProps = MapPolygonProps & {
|
|
127
|
+
ref: React.RefObject<View | null>;
|
|
128
|
+
};
|
|
129
|
+
export declare class MapPolygon extends React.Component<MapPolygonProps> {
|
|
130
|
+
context: React.ContextType<typeof ProviderContext>;
|
|
131
|
+
getNativeComponent: () => NativeComponent<NativeProps>;
|
|
132
|
+
getMapManagerCommand: (name: string) => MapManagerCommand;
|
|
133
|
+
getUIManagerCommand: (name: string) => UIManagerCommand;
|
|
134
|
+
private polygon;
|
|
135
|
+
constructor(props: MapPolygonProps);
|
|
136
|
+
setNativeProps(props: Partial<MapPolygonProps>): void;
|
|
137
|
+
render(): React.JSX.Element;
|
|
138
|
+
}
|
|
139
|
+
declare const _default: typeof MapPolygon;
|
|
140
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { NativeSyntheticEvent } from 'react-native';
|
|
2
|
+
import type { LatLng, Point } from './sharedTypes';
|
|
3
|
+
export type PolygonPressEvent = NativeSyntheticEvent<{
|
|
4
|
+
action: 'polygon-press';
|
|
5
|
+
/**
|
|
6
|
+
* @platform iOS: Google Maps
|
|
7
|
+
*/
|
|
8
|
+
id?: string;
|
|
9
|
+
/**
|
|
10
|
+
* @platform iOS: Apple Maps
|
|
11
|
+
* @platform Android
|
|
12
|
+
*/
|
|
13
|
+
coordinate?: LatLng;
|
|
14
|
+
/**
|
|
15
|
+
* @platform Android
|
|
16
|
+
*/
|
|
17
|
+
position?: Point;
|
|
18
|
+
}>;
|