react-native-maps 1.26.10 → 1.26.12
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/MarkerManager.java +6 -0
- package/android/src/main/java/com/rnmaps/maps/MapMarker.java +16 -0
- 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,723 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Animated as RNAnimated, Animated, type NativeSyntheticEvent, type ViewProps } from 'react-native';
|
|
3
|
+
import type { CalloutPressEvent, ClickEvent, Frame, LatLng, MarkerDeselectEvent, MarkerDragEvent, MarkerDragStartEndEvent, MarkerPressEvent, MarkerSelectEvent, Point, Provider, Region, MKPointOfInterestCategoryType } from './sharedTypes';
|
|
4
|
+
import type { ActiveIndoorLevel, Address, BoundingBox, Camera, CameraZoomRange, ChangeEvent, Details, EdgePadding, FitToOptions, IndoorBuilding, KmlMapEvent, LongPressEvent, MapPressEvent, MapStyleElement, MapType, MapTypes, PanDragEvent, PoiClickEvent, SnapshotOptions, UserLocationChangeEvent } from './MapView.types';
|
|
5
|
+
import type { Modify } from './sharedTypesInternal';
|
|
6
|
+
import { type MapViewNativeComponentType } from './MapViewNativeComponent';
|
|
7
|
+
import AnimatedRegion from './AnimatedRegion';
|
|
8
|
+
export declare const MAP_TYPES: MapTypes;
|
|
9
|
+
export type MapViewProps = ViewProps & {
|
|
10
|
+
/**
|
|
11
|
+
* If `true` map will be cached and displayed as an image instead of being interactable, for performance usage.
|
|
12
|
+
*
|
|
13
|
+
* @default false
|
|
14
|
+
* @platform iOS: Apple Maps only
|
|
15
|
+
* @platform Android: Supported
|
|
16
|
+
*/
|
|
17
|
+
cacheEnabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The camera view the map should display.
|
|
20
|
+
*
|
|
21
|
+
* Use the camera system, instead of the region system, if you need control over
|
|
22
|
+
* the pitch or heading. Using this will ignore the `region` property.
|
|
23
|
+
* @platform iOS: Supported
|
|
24
|
+
* @platform Android: Supported
|
|
25
|
+
*/
|
|
26
|
+
camera?: Camera;
|
|
27
|
+
/**
|
|
28
|
+
* If set, changes the position of the compass.
|
|
29
|
+
*
|
|
30
|
+
* @platform iOS: Apple Maps only
|
|
31
|
+
* @platform Android: Not supported
|
|
32
|
+
*/
|
|
33
|
+
compassOffset?: Point;
|
|
34
|
+
/**
|
|
35
|
+
* Adds custom styling to the map component.
|
|
36
|
+
* See [README](https://github.com/react-native-maps/react-native-maps#customizing-the-map-style) for more information.
|
|
37
|
+
*
|
|
38
|
+
* @platform iOS: Google Maps only
|
|
39
|
+
* @platform Android: Supported
|
|
40
|
+
*/
|
|
41
|
+
customMapStyle?: MapStyleElement[];
|
|
42
|
+
/**
|
|
43
|
+
* If `true` the map will focus on the user's location.
|
|
44
|
+
* This only works if `showsUserLocation` is true and the user has shared their location.
|
|
45
|
+
*
|
|
46
|
+
* @default false
|
|
47
|
+
* @platform iOS: Apple Maps only
|
|
48
|
+
* @platform Android: Not supported
|
|
49
|
+
*/
|
|
50
|
+
followsUserLocation?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* If `false` the map will not capture PoI clicks
|
|
53
|
+
* This can improve click handling on the map for android
|
|
54
|
+
*
|
|
55
|
+
* @default true
|
|
56
|
+
* @platform iOS: Not supported
|
|
57
|
+
* @platform Android: supported
|
|
58
|
+
*/
|
|
59
|
+
poiClickEnabled?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* The initial camera view the map should use. Use this prop instead of `camera`
|
|
62
|
+
* only if you don't want to control the camera of the map besides the initial view.
|
|
63
|
+
*
|
|
64
|
+
* Use the camera system, instead of the region system, if you need control over
|
|
65
|
+
* the pitch or heading.
|
|
66
|
+
*
|
|
67
|
+
* Changing this prop after the component has mounted will not result in a camera change.
|
|
68
|
+
*
|
|
69
|
+
* This is similar to the `initialValue` prop of a text input.
|
|
70
|
+
*
|
|
71
|
+
* @platform iOS: Supported
|
|
72
|
+
* @platform Android: Supported
|
|
73
|
+
*/
|
|
74
|
+
initialCamera?: Camera;
|
|
75
|
+
/**
|
|
76
|
+
* The initial region to be displayed by the map. Use this prop instead of `region`
|
|
77
|
+
* only if you don't want to control the viewport of the map besides the initial region.
|
|
78
|
+
*
|
|
79
|
+
* Changing this prop after the component has mounted will not result in a region change.
|
|
80
|
+
*
|
|
81
|
+
* This is similar to the `initialValue` prop of a text input.
|
|
82
|
+
*
|
|
83
|
+
* @platform iOS: Supported
|
|
84
|
+
* @platform Android: Supported
|
|
85
|
+
*/
|
|
86
|
+
initialRegion?: Region;
|
|
87
|
+
/**
|
|
88
|
+
* The URL for KML file.
|
|
89
|
+
*
|
|
90
|
+
* @platform iOS: Google Maps only
|
|
91
|
+
* @platform Android: Supported
|
|
92
|
+
*/
|
|
93
|
+
kmlSrc?: string;
|
|
94
|
+
/**
|
|
95
|
+
* If set, changes the position of the "Legal" label link in Apple Maps.
|
|
96
|
+
*
|
|
97
|
+
* @platform iOS: Apple Maps only
|
|
98
|
+
* @platform Android: Not supported
|
|
99
|
+
*/
|
|
100
|
+
legalLabelInsets?: EdgePadding;
|
|
101
|
+
/**
|
|
102
|
+
* Enables lite mode on Android
|
|
103
|
+
*
|
|
104
|
+
* @platform iOS: Not supported
|
|
105
|
+
* @platform Android: Supported
|
|
106
|
+
*/
|
|
107
|
+
liteMode?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* https://developers.google.com/maps/documentation/get-map-id
|
|
110
|
+
* google cloud mapId to enable cloud styling and more
|
|
111
|
+
*/
|
|
112
|
+
googleMapId?: string;
|
|
113
|
+
/**
|
|
114
|
+
* https://developers.google.com/maps/documentation/android-sdk/renderer
|
|
115
|
+
* google maps renderer
|
|
116
|
+
* @default `LATEST`
|
|
117
|
+
* @platform iOS: Not supported
|
|
118
|
+
* @platform Android: Supported
|
|
119
|
+
*/
|
|
120
|
+
googleRenderer?: 'LATEST' | 'LEGACY';
|
|
121
|
+
/**
|
|
122
|
+
* Sets loading background color.
|
|
123
|
+
*
|
|
124
|
+
* @default `#FFFFFF`
|
|
125
|
+
* @platform iOS: Supported
|
|
126
|
+
* @platform Android: Supported
|
|
127
|
+
*/
|
|
128
|
+
loadingBackgroundColor?: string;
|
|
129
|
+
/**
|
|
130
|
+
* If `true` a loading indicator will show while the map is loading.
|
|
131
|
+
*
|
|
132
|
+
* @default false
|
|
133
|
+
* @platform iOS: Apple Maps only
|
|
134
|
+
* @platform Android: Supported
|
|
135
|
+
*/
|
|
136
|
+
loadingEnabled?: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Sets loading indicator color.
|
|
139
|
+
*
|
|
140
|
+
* @default `#606060`
|
|
141
|
+
* @platform iOS: Apple Maps only
|
|
142
|
+
* @platform Android: Supported
|
|
143
|
+
*/
|
|
144
|
+
loadingIndicatorColor?: string;
|
|
145
|
+
/**
|
|
146
|
+
* Adds custom padding to each side of the map. Useful when map elements/markers are obscured.
|
|
147
|
+
*
|
|
148
|
+
* @platform iOS: Supported
|
|
149
|
+
* @platform Android: Supported
|
|
150
|
+
*/
|
|
151
|
+
mapPadding?: EdgePadding;
|
|
152
|
+
/**
|
|
153
|
+
* The map type to be displayed
|
|
154
|
+
*
|
|
155
|
+
* @default `standard`
|
|
156
|
+
* @platform iOS: hybrid | mutedStandard | satellite | standard | terrain | hybridFlyover | satelliteFlyover
|
|
157
|
+
* @platform Android: hybrid | none | satellite | standard | terrain
|
|
158
|
+
*/
|
|
159
|
+
mapType?: MapType;
|
|
160
|
+
/**
|
|
161
|
+
* TODO: Add documentation
|
|
162
|
+
*
|
|
163
|
+
* @platform iOS: Apple Maps only
|
|
164
|
+
* @platform Android: Not supported
|
|
165
|
+
*/
|
|
166
|
+
maxDelta?: number;
|
|
167
|
+
/**
|
|
168
|
+
* Maximum zoom value for the map, must be between 0 and 20
|
|
169
|
+
*
|
|
170
|
+
* @default 20
|
|
171
|
+
* @platform iOS: Supported
|
|
172
|
+
* @platform Android: Supported
|
|
173
|
+
* @deprecated on Apple Maps, use `cameraZoomRange` instead
|
|
174
|
+
*/
|
|
175
|
+
maxZoomLevel?: number;
|
|
176
|
+
/**
|
|
177
|
+
* TODO: Add documentation
|
|
178
|
+
*
|
|
179
|
+
* @platform iOS: Apple Maps only
|
|
180
|
+
* @platform Android: Not supported
|
|
181
|
+
*/
|
|
182
|
+
minDelta?: number;
|
|
183
|
+
/**
|
|
184
|
+
* Minimum zoom value for the map, must be between 0 and 20
|
|
185
|
+
*
|
|
186
|
+
* @default 0
|
|
187
|
+
* @platform iOS: Supported
|
|
188
|
+
* @platform Android: Supported
|
|
189
|
+
* @deprecated on Apple Maps, use `cameraZoomRange` instead
|
|
190
|
+
*/
|
|
191
|
+
minZoomLevel?: number;
|
|
192
|
+
/**
|
|
193
|
+
* If `false` the map won't move to the marker when pressed.
|
|
194
|
+
*
|
|
195
|
+
* @default true
|
|
196
|
+
* @platform iOS: Not supported
|
|
197
|
+
* @platform Android: Supported
|
|
198
|
+
*/
|
|
199
|
+
moveOnMarkerPress?: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* Callback that is called when a callout is tapped by the user.
|
|
202
|
+
*
|
|
203
|
+
* @platform iOS: Apple Maps only
|
|
204
|
+
* @platform Android: Supported
|
|
205
|
+
*/
|
|
206
|
+
onCalloutPress?: (event: CalloutPressEvent) => void;
|
|
207
|
+
/**
|
|
208
|
+
* Callback that is called when user double taps on the map.
|
|
209
|
+
*
|
|
210
|
+
* @platform iOS: Apple Maps only
|
|
211
|
+
* @platform Android: Supported
|
|
212
|
+
*/
|
|
213
|
+
onDoublePress?: (event: ClickEvent) => void;
|
|
214
|
+
/**
|
|
215
|
+
* Callback that is called when an indoor building is focused/unfocused
|
|
216
|
+
*
|
|
217
|
+
* @platform iOS: Google Maps only
|
|
218
|
+
* @platform Android: Supported
|
|
219
|
+
*/
|
|
220
|
+
onIndoorBuildingFocused?: (indoorBuilding: IndoorBuilding) => void;
|
|
221
|
+
/**
|
|
222
|
+
* Callback that is called when a level on indoor building is activated
|
|
223
|
+
*
|
|
224
|
+
* @platform iOS: Google Maps only
|
|
225
|
+
* @platform Android: Supported
|
|
226
|
+
*/
|
|
227
|
+
onIndoorLevelActivated?: (indoorLevel: ActiveIndoorLevel) => void;
|
|
228
|
+
/**
|
|
229
|
+
* Callback that is called once the kml is fully loaded.
|
|
230
|
+
*
|
|
231
|
+
* @platform iOS: Google Maps only
|
|
232
|
+
* @platform Android: Supported
|
|
233
|
+
*/
|
|
234
|
+
onKmlReady?: (event: KmlMapEvent) => void;
|
|
235
|
+
/**
|
|
236
|
+
* Callback that is called when user makes a "long press" somewhere on the map.
|
|
237
|
+
*
|
|
238
|
+
* @platform iOS: Supported
|
|
239
|
+
* @platform Android: Supported
|
|
240
|
+
*/
|
|
241
|
+
onLongPress?: (event: LongPressEvent) => void;
|
|
242
|
+
/**
|
|
243
|
+
* Callback that is called when the map has finished rendering all tiles.
|
|
244
|
+
*
|
|
245
|
+
* @platform iOS: Google Maps only
|
|
246
|
+
* @platform Android: Supported
|
|
247
|
+
*/
|
|
248
|
+
onMapLoaded?: (event: NativeSyntheticEvent<null>) => void;
|
|
249
|
+
/**
|
|
250
|
+
* Callback that is called once the map is ready.
|
|
251
|
+
*
|
|
252
|
+
* Event is optional, as the first onMapReady callback is intercepted
|
|
253
|
+
* on Android, and the event is not passed on.
|
|
254
|
+
*
|
|
255
|
+
* @platform iOS: Supported
|
|
256
|
+
* @platform Android: Supported
|
|
257
|
+
*/
|
|
258
|
+
onMapReady?: (event?: NativeSyntheticEvent<null>) => void;
|
|
259
|
+
/**
|
|
260
|
+
* Callback that is called when a marker on the map becomes deselected.
|
|
261
|
+
* This will be called when the callout for that marker is about to be hidden.
|
|
262
|
+
*
|
|
263
|
+
* @platform iOS: Supported
|
|
264
|
+
* @platform Android: Supported
|
|
265
|
+
*/
|
|
266
|
+
onMarkerDeselect?: (event: MarkerDeselectEvent) => void;
|
|
267
|
+
/**
|
|
268
|
+
* Callback called continuously as a marker is dragged
|
|
269
|
+
*
|
|
270
|
+
* @platform iOS: Apple Maps only
|
|
271
|
+
* @platform Android: Supported
|
|
272
|
+
*/
|
|
273
|
+
onMarkerDrag?: (event: MarkerDragEvent) => void;
|
|
274
|
+
/**
|
|
275
|
+
* Callback that is called when a drag on a marker finishes.
|
|
276
|
+
* This is usually the point you will want to setState on the marker's coordinate again
|
|
277
|
+
*
|
|
278
|
+
* @platform iOS: Apple Maps only
|
|
279
|
+
* @platform Android: Supported
|
|
280
|
+
*/
|
|
281
|
+
onMarkerDragEnd?: (event: MarkerDragStartEndEvent) => void;
|
|
282
|
+
/**
|
|
283
|
+
* Callback that is called when the user initiates a drag on a marker (if it is draggable)
|
|
284
|
+
*
|
|
285
|
+
* @platform iOS: Apple Maps only
|
|
286
|
+
* @platform Android: Supported
|
|
287
|
+
*/
|
|
288
|
+
onMarkerDragStart?: (event: MarkerDragStartEndEvent) => void;
|
|
289
|
+
/**
|
|
290
|
+
* Callback that is called when a marker on the map is tapped by the user.
|
|
291
|
+
*
|
|
292
|
+
* @platform iOS: Supported
|
|
293
|
+
* @platform Android: Supported
|
|
294
|
+
*/
|
|
295
|
+
onMarkerPress?: (event: MarkerPressEvent) => void;
|
|
296
|
+
/**
|
|
297
|
+
* Callback that is called when a marker on the map becomes selected.
|
|
298
|
+
* This will be called when the callout for that marker is about to be shown.
|
|
299
|
+
*
|
|
300
|
+
* @platform iOS: Supported.
|
|
301
|
+
* @platform Android: Supported
|
|
302
|
+
*/
|
|
303
|
+
onMarkerSelect?: (event: MarkerSelectEvent) => void;
|
|
304
|
+
/**
|
|
305
|
+
* Callback that is called when user presses and drags the map.
|
|
306
|
+
* **NOTE**: for iOS `scrollEnabled` should be set to false to trigger the event
|
|
307
|
+
*
|
|
308
|
+
* @platform iOS: Supported
|
|
309
|
+
* @platform Android: Supported
|
|
310
|
+
*/
|
|
311
|
+
onPanDrag?: (event: PanDragEvent) => void;
|
|
312
|
+
/**
|
|
313
|
+
* Callback that is called when user click on a POI.
|
|
314
|
+
*
|
|
315
|
+
* @platform iOS: Google Maps only
|
|
316
|
+
* @platform Android: Supported
|
|
317
|
+
*/
|
|
318
|
+
onPoiClick?: (event: PoiClickEvent) => void;
|
|
319
|
+
/**
|
|
320
|
+
* Callback that is called when user taps on the map.
|
|
321
|
+
*
|
|
322
|
+
* @platform iOS: Supported
|
|
323
|
+
* @platform Android: Supported
|
|
324
|
+
*/
|
|
325
|
+
onPress?: (event: MapPressEvent) => void;
|
|
326
|
+
/**
|
|
327
|
+
* Callback that is called once before the region changes, such as when the user starts moving the map.
|
|
328
|
+
* `isGesture` property indicates if the move was from the user (true) or an animation (false).
|
|
329
|
+
* **Note**: `isGesture` is supported by Google Maps only.
|
|
330
|
+
*
|
|
331
|
+
* @platform iOS: Supported
|
|
332
|
+
* @platform Android: Supported
|
|
333
|
+
*/
|
|
334
|
+
onRegionChangeStart?: (region: Region, details: Details) => void;
|
|
335
|
+
/**
|
|
336
|
+
* Callback that is called continuously when the region changes, such as when a user is dragging the map.
|
|
337
|
+
* `isGesture` property indicates if the move was from the user (true) or an animation (false).
|
|
338
|
+
* **Note**: `isGesture` is supported by Google Maps only.
|
|
339
|
+
*
|
|
340
|
+
* @platform iOS: Supported
|
|
341
|
+
* @platform Android: Supported
|
|
342
|
+
*/
|
|
343
|
+
onRegionChange?: (region: Region, details: Details) => void;
|
|
344
|
+
/**
|
|
345
|
+
* Callback that is called once when the region changes, such as when the user is done moving the map.
|
|
346
|
+
* `isGesture` property indicates if the move was from the user (true) or an animation (false).
|
|
347
|
+
* **Note**: `isGesture` is supported by Google Maps only.
|
|
348
|
+
*
|
|
349
|
+
* @platform iOS: Supported
|
|
350
|
+
* @platform Android: Supported
|
|
351
|
+
*/
|
|
352
|
+
onRegionChangeComplete?: (region: Region, details: Details) => void;
|
|
353
|
+
/**
|
|
354
|
+
* Callback that is called when the underlying map figures our users current location
|
|
355
|
+
* (coordinate also includes isFromMockProvider value for Android API 18 and above).
|
|
356
|
+
* Make sure **showsUserLocation** is set to *true*.
|
|
357
|
+
*
|
|
358
|
+
* @platform iOS: Supported
|
|
359
|
+
* @platform Android: Supported
|
|
360
|
+
*/
|
|
361
|
+
onUserLocationChange?: (event: UserLocationChangeEvent) => void;
|
|
362
|
+
/**
|
|
363
|
+
* Indicates how/when to affect padding with safe area insets
|
|
364
|
+
*
|
|
365
|
+
* @platform iOS: Google Maps only
|
|
366
|
+
* @platform Android: Not supported
|
|
367
|
+
*/
|
|
368
|
+
paddingAdjustmentBehavior?: 'always' | 'automatic' | 'never';
|
|
369
|
+
/**
|
|
370
|
+
* If `false` the user won't be able to adjust the camera’s pitch angle.
|
|
371
|
+
*
|
|
372
|
+
* @default true
|
|
373
|
+
* @platform iOS: Google Maps only
|
|
374
|
+
* @platform Android: Supported
|
|
375
|
+
*/
|
|
376
|
+
pitchEnabled?: boolean;
|
|
377
|
+
/**
|
|
378
|
+
* The map framework to use.
|
|
379
|
+
* Either `"google"` for GoogleMaps, otherwise `undefined` to use the native map framework (`MapKit` in iOS and `GoogleMaps` in android).
|
|
380
|
+
*
|
|
381
|
+
* @platform iOS: Supported
|
|
382
|
+
* @platform Android: Supported
|
|
383
|
+
*/
|
|
384
|
+
provider?: Provider;
|
|
385
|
+
/**
|
|
386
|
+
* The region to be displayed by the map.
|
|
387
|
+
* The region is defined by the center coordinates and the span of coordinates to display.
|
|
388
|
+
*
|
|
389
|
+
* @platform iOS: Supported
|
|
390
|
+
* @platform Android: Supported
|
|
391
|
+
*/
|
|
392
|
+
region?: Region | AnimatedRegion;
|
|
393
|
+
/**
|
|
394
|
+
* If `false` the user won't be able to adjust the camera’s pitch angle.
|
|
395
|
+
*
|
|
396
|
+
* @default true
|
|
397
|
+
* @platform iOS: Google Maps only
|
|
398
|
+
* @platform Android: Supported
|
|
399
|
+
*/
|
|
400
|
+
rotateEnabled?: boolean;
|
|
401
|
+
/**
|
|
402
|
+
* If `false` the map will stay centered while rotating or zooming.
|
|
403
|
+
*
|
|
404
|
+
* @default true
|
|
405
|
+
* @platform iOS: Google Maps only
|
|
406
|
+
* @platform Android: Supported
|
|
407
|
+
*/
|
|
408
|
+
scrollDuringRotateOrZoomEnabled?: boolean;
|
|
409
|
+
/**
|
|
410
|
+
* If `false` the user won't be able to change the map region being displayed.
|
|
411
|
+
*
|
|
412
|
+
* @default true
|
|
413
|
+
* @platform iOS: Supported
|
|
414
|
+
* @platform Android: Supported
|
|
415
|
+
*/
|
|
416
|
+
scrollEnabled?: boolean;
|
|
417
|
+
/**
|
|
418
|
+
* A Boolean indicating whether the map displays extruded building information.
|
|
419
|
+
*
|
|
420
|
+
* @default true
|
|
421
|
+
* @platform iOS: Not supported
|
|
422
|
+
* @platform Android: Supported
|
|
423
|
+
*/
|
|
424
|
+
showsBuildings?: boolean;
|
|
425
|
+
/**
|
|
426
|
+
* If `false` compass is not displayed on the map.
|
|
427
|
+
*
|
|
428
|
+
* @default true
|
|
429
|
+
* @platform iOS: Supported (adaptive, visible only if the map is not pointing north)
|
|
430
|
+
* @platform Android: Supported
|
|
431
|
+
*/
|
|
432
|
+
showsCompass?: boolean;
|
|
433
|
+
/**
|
|
434
|
+
* A Boolean indicating whether indoor level picker should be enabled.
|
|
435
|
+
*
|
|
436
|
+
* @default false
|
|
437
|
+
* @platform iOS: Google Maps only
|
|
438
|
+
* @platform Android: Supported
|
|
439
|
+
*/
|
|
440
|
+
showsIndoorLevelPicker?: boolean;
|
|
441
|
+
/**
|
|
442
|
+
* A Boolean indicating whether indoor maps should be enabled.
|
|
443
|
+
*
|
|
444
|
+
* @default true
|
|
445
|
+
* @platform iOS: Google Maps only
|
|
446
|
+
* @platform Android: Supported
|
|
447
|
+
*/
|
|
448
|
+
showsIndoors?: boolean;
|
|
449
|
+
/**
|
|
450
|
+
* If `false` hide the button to move map to the current user's location.
|
|
451
|
+
*
|
|
452
|
+
* @default false
|
|
453
|
+
* @platform iOS: Google Maps only
|
|
454
|
+
* @platform Android: Supported
|
|
455
|
+
*/
|
|
456
|
+
showsMyLocationButton?: boolean;
|
|
457
|
+
/**
|
|
458
|
+
* A Boolean indicating whether points of interest should be displayed.
|
|
459
|
+
* Use `pointsOfInterestFilter` for more granular control.
|
|
460
|
+
* @see pointsOfInterestFilter
|
|
461
|
+
*/
|
|
462
|
+
showsPointsOfInterests?: boolean;
|
|
463
|
+
/**
|
|
464
|
+
* An array of category strings to show on the map.
|
|
465
|
+
* If this is set, it takes precedence over `showsPointsOfInterests`.
|
|
466
|
+
* @see showsPointsOfInterests
|
|
467
|
+
*/
|
|
468
|
+
pointsOfInterestFilter?: MKPointOfInterestCategoryType[];
|
|
469
|
+
/**
|
|
470
|
+
* A Boolean indicating whether the map shows scale information.
|
|
471
|
+
*
|
|
472
|
+
* @default false
|
|
473
|
+
* @platform iOS: Apple Maps only
|
|
474
|
+
* @platform Android: Not supported
|
|
475
|
+
*/
|
|
476
|
+
showsScale?: boolean;
|
|
477
|
+
/**
|
|
478
|
+
* A Boolean value indicating whether the map displays traffic information.
|
|
479
|
+
*
|
|
480
|
+
* @default false
|
|
481
|
+
* @platform iOS: Supported
|
|
482
|
+
* @platform Android: Supported
|
|
483
|
+
*/
|
|
484
|
+
showsTraffic?: boolean;
|
|
485
|
+
/**
|
|
486
|
+
* If `true` the users location will be displayed on the map.
|
|
487
|
+
*
|
|
488
|
+
* This will cause iOS to ask for location permissions.
|
|
489
|
+
* For iOS see: [DOCS](https://github.com/react-native-maps/react-native-maps/blob/master/docs/installation.md#set-the-usage-description-property)
|
|
490
|
+
* @default false
|
|
491
|
+
* @platform iOS: Supported
|
|
492
|
+
* @platform Android: Supported
|
|
493
|
+
*/
|
|
494
|
+
showsUserLocation?: boolean;
|
|
495
|
+
/**
|
|
496
|
+
* Sets the tint color of the map. (Changes the color of the position indicator)
|
|
497
|
+
*
|
|
498
|
+
* @default System Blue
|
|
499
|
+
* @platform iOS: Apple Maps only
|
|
500
|
+
* @platform Android: Not supported
|
|
501
|
+
*/
|
|
502
|
+
tintColor?: string;
|
|
503
|
+
/**
|
|
504
|
+
* If `false` will hide 'Navigate' and 'Open in Maps' buttons on marker press
|
|
505
|
+
*
|
|
506
|
+
* @default true
|
|
507
|
+
* @platform iOS: Not supported
|
|
508
|
+
* @platform Android: Supported
|
|
509
|
+
*/
|
|
510
|
+
toolbarEnabled?: boolean;
|
|
511
|
+
/**
|
|
512
|
+
* Sets the map to the style selected.
|
|
513
|
+
*
|
|
514
|
+
* @default System setting
|
|
515
|
+
* @platform iOS: Supported
|
|
516
|
+
* @platform Android: Supported
|
|
517
|
+
*/
|
|
518
|
+
userInterfaceStyle?: 'light' | 'dark';
|
|
519
|
+
/**
|
|
520
|
+
* The title of the annotation for current user location.
|
|
521
|
+
*
|
|
522
|
+
* This only works if `showsUserLocation` is true.
|
|
523
|
+
*
|
|
524
|
+
* @default `My Location`
|
|
525
|
+
* @platform iOS: Apple Maps only
|
|
526
|
+
* @platform Android: Not supported
|
|
527
|
+
*/
|
|
528
|
+
userLocationAnnotationTitle?: string;
|
|
529
|
+
/**
|
|
530
|
+
* If `true` clicking user location will show the default callout for userLocation annotation.
|
|
531
|
+
*
|
|
532
|
+
* @default false
|
|
533
|
+
* @platform iOS: Apple Maps only
|
|
534
|
+
* @platform Android: Not supported
|
|
535
|
+
*/
|
|
536
|
+
userLocationCalloutEnabled?: boolean;
|
|
537
|
+
/**
|
|
538
|
+
* Fastest interval the application will actively acquire locations.
|
|
539
|
+
*
|
|
540
|
+
* See [Google APIs documentation](https://developers.google.com/android/reference/com/google/android/gms/location/LocationRequest.html)
|
|
541
|
+
*
|
|
542
|
+
* @default 5000
|
|
543
|
+
* @platform iOS: Not supported
|
|
544
|
+
* @platform Android: Supported
|
|
545
|
+
*/
|
|
546
|
+
userLocationFastestInterval?: number;
|
|
547
|
+
/**
|
|
548
|
+
* Set power priority of user location tracking.
|
|
549
|
+
*
|
|
550
|
+
* See [Google APIs documentation](https://developers.google.com/android/reference/com/google/android/gms/location/LocationRequest.html)
|
|
551
|
+
*
|
|
552
|
+
* @default `high`
|
|
553
|
+
* @platform iOS: Not supported
|
|
554
|
+
* @platform Android: Supported
|
|
555
|
+
*/
|
|
556
|
+
userLocationPriority?: 'balanced' | 'high' | 'low' | 'passive';
|
|
557
|
+
/**
|
|
558
|
+
* Interval of user location updates in milliseconds.
|
|
559
|
+
*
|
|
560
|
+
* See [Google APIs documentation](https://developers.google.com/android/reference/com/google/android/gms/location/LocationRequest.html)
|
|
561
|
+
*
|
|
562
|
+
* @default 5000
|
|
563
|
+
* @platform iOS: Not supported
|
|
564
|
+
* @platform Android: Supported
|
|
565
|
+
*/
|
|
566
|
+
userLocationUpdateInterval?: number;
|
|
567
|
+
/**
|
|
568
|
+
* If `false` the zoom control at the bottom right of the map won't be visible.
|
|
569
|
+
*
|
|
570
|
+
* @default true
|
|
571
|
+
* @platform iOS: Not supported
|
|
572
|
+
* @platform Android: Supported
|
|
573
|
+
*/
|
|
574
|
+
zoomControlEnabled?: boolean;
|
|
575
|
+
/**
|
|
576
|
+
* If `false` the user won't be able to pinch/zoom the map.
|
|
577
|
+
*
|
|
578
|
+
* TODO: Why is the Android reactprop defaultvalue set to false?
|
|
579
|
+
*
|
|
580
|
+
* @default true
|
|
581
|
+
* @platform iOS: Supported
|
|
582
|
+
* @platform Android: Supported
|
|
583
|
+
*/
|
|
584
|
+
zoomEnabled?: boolean;
|
|
585
|
+
/**
|
|
586
|
+
* If `false` the user won't be able to double tap to zoom the map.
|
|
587
|
+
* **Note:** But it will greatly decrease delay of tap gesture recognition.
|
|
588
|
+
*
|
|
589
|
+
* @default true
|
|
590
|
+
* @platform iOS: Google Maps only
|
|
591
|
+
* @platform Android: Not supported
|
|
592
|
+
*/
|
|
593
|
+
zoomTapEnabled?: boolean;
|
|
594
|
+
/**
|
|
595
|
+
* Map camera distance limits. `minCenterCoordinateDistance` for minimum distance, `maxCenterCoordinateDistance` for maximum.
|
|
596
|
+
* `animated` for animated zoom changes.
|
|
597
|
+
* Takes precedence if conflicting with `minZoomLevel`, `maxZoomLevel`.
|
|
598
|
+
*
|
|
599
|
+
* @platform iOS: 13.0+
|
|
600
|
+
* @platform Android: Not supported
|
|
601
|
+
*/
|
|
602
|
+
cameraZoomRange?: CameraZoomRange;
|
|
603
|
+
};
|
|
604
|
+
type ModifiedProps = Modify<MapViewProps, {
|
|
605
|
+
region?: MapViewProps['region'] | null;
|
|
606
|
+
initialRegion?: MapViewProps['initialRegion'] | null;
|
|
607
|
+
}>;
|
|
608
|
+
export type NativeProps = Omit<ModifiedProps, 'customMapStyle' | 'onRegionChange' | 'onRegionChangeComplete'> & {
|
|
609
|
+
ref: React.RefObject<MapViewNativeComponentType | null>;
|
|
610
|
+
customMapStyleString?: string;
|
|
611
|
+
handlePanDrag?: boolean;
|
|
612
|
+
onChange?: (e: ChangeEvent) => void;
|
|
613
|
+
};
|
|
614
|
+
type State = {
|
|
615
|
+
isReady: boolean;
|
|
616
|
+
};
|
|
617
|
+
declare class MapView extends React.Component<MapViewProps, State> {
|
|
618
|
+
static Animated: Animated.AnimatedComponent<typeof MapView>;
|
|
619
|
+
private map;
|
|
620
|
+
private fabricMap;
|
|
621
|
+
constructor(props: MapViewProps);
|
|
622
|
+
setNativeProps(props: Partial<NativeProps>): void;
|
|
623
|
+
private _onMapReady;
|
|
624
|
+
getCamera(): Promise<Camera>;
|
|
625
|
+
setCamera(camera: Partial<Camera>): void;
|
|
626
|
+
animateCamera(camera: Partial<Camera>, opts?: {
|
|
627
|
+
duration?: number;
|
|
628
|
+
}): void;
|
|
629
|
+
animateToRegion(region: Region, duration?: number): void;
|
|
630
|
+
setRegion(region: Region): void;
|
|
631
|
+
fitToElements(options?: FitToOptions): void;
|
|
632
|
+
fitToSuppliedMarkers(markers: string[], options?: FitToOptions): void;
|
|
633
|
+
fitToCoordinates(coordinates?: LatLng[], options?: FitToOptions): void;
|
|
634
|
+
/**
|
|
635
|
+
* Get visible boudaries
|
|
636
|
+
*
|
|
637
|
+
* @return Promise Promise with the bounding box ({ northEast: <LatLng>, southWest: <LatLng> })
|
|
638
|
+
*/
|
|
639
|
+
getMapBoundaries(): Promise<BoundingBox>;
|
|
640
|
+
setMapBoundaries(northEast: LatLng, southWest: LatLng): void;
|
|
641
|
+
setIndoorActiveLevelIndex(activeLevelIndex: number): void | Promise<never>;
|
|
642
|
+
/**
|
|
643
|
+
* Takes a snapshot of the map and saves it to a picture
|
|
644
|
+
* file or returns the image as a base64 encoded string.
|
|
645
|
+
*
|
|
646
|
+
* @param args Configuration options
|
|
647
|
+
* @param [args.width] Width of the rendered map-view (when omitted actual view width is used).
|
|
648
|
+
* @param [args.height] Height of the rendered map-view (when omitted actual height is used).
|
|
649
|
+
* @param [args.region] Region to render (Only supported on iOS).
|
|
650
|
+
* @param [args.format] Encoding format ('png', 'jpg') (default: 'png').
|
|
651
|
+
* @param [args.quality] Compression quality (only used for jpg) (default: 1.0).
|
|
652
|
+
* @param [args.result] Result format ('file', 'base64') (default: 'file').
|
|
653
|
+
*
|
|
654
|
+
* @return Promise Promise with either the file-uri or base64 encoded string
|
|
655
|
+
*/
|
|
656
|
+
takeSnapshot(args: SnapshotOptions): Promise<string>;
|
|
657
|
+
/**
|
|
658
|
+
* Convert a coordinate to address by using default Geocoder
|
|
659
|
+
*
|
|
660
|
+
* @param coordinate Coordinate
|
|
661
|
+
* @param [coordinate.latitude] Latitude
|
|
662
|
+
* @param [coordinate.longitude] Longitude
|
|
663
|
+
*
|
|
664
|
+
* @return Promise with return type Address
|
|
665
|
+
*/
|
|
666
|
+
addressForCoordinate(coordinate: LatLng): Promise<Address>;
|
|
667
|
+
/**
|
|
668
|
+
* Convert a map coordinate to user-space point
|
|
669
|
+
*
|
|
670
|
+
* @param coordinate Coordinate
|
|
671
|
+
* @param [coordinate.latitude] Latitude
|
|
672
|
+
* @param [coordinate.longitude] Longitude
|
|
673
|
+
*
|
|
674
|
+
* @return Promise Promise with the point ({ x: Number, y: Number })
|
|
675
|
+
*/
|
|
676
|
+
pointForCoordinate(coordinate: LatLng): Promise<Point>;
|
|
677
|
+
/**
|
|
678
|
+
* Convert a user-space point to a map coordinate
|
|
679
|
+
*
|
|
680
|
+
* @param point Point
|
|
681
|
+
* @param [point.x] X
|
|
682
|
+
* @param [point.x] Y
|
|
683
|
+
*
|
|
684
|
+
* @return Promise Promise with the coordinate ({ latitude: Number, longitude: Number })
|
|
685
|
+
*/
|
|
686
|
+
coordinateForPoint(point: Point): Promise<LatLng>;
|
|
687
|
+
/**
|
|
688
|
+
* Get markers' centers and frames in user-space coordinates
|
|
689
|
+
*
|
|
690
|
+
* @param onlyVisible boolean true to include only visible markers, false to include all
|
|
691
|
+
*
|
|
692
|
+
* @return Promise Promise with { <identifier>: { point: Point, frame: Frame } }
|
|
693
|
+
*/
|
|
694
|
+
getMarkersFrames(onlyVisible?: boolean): Promise<{
|
|
695
|
+
[key: string]: {
|
|
696
|
+
point: Point;
|
|
697
|
+
frame: Frame;
|
|
698
|
+
};
|
|
699
|
+
}>;
|
|
700
|
+
/**
|
|
701
|
+
* Get bounding box from region
|
|
702
|
+
*
|
|
703
|
+
* @param region Region
|
|
704
|
+
*
|
|
705
|
+
* @return Object Object bounding box ({ northEast: <LatLng>, southWest: <LatLng> })
|
|
706
|
+
*/
|
|
707
|
+
boundingBoxForRegion(region: Region): BoundingBox;
|
|
708
|
+
private _getHandle;
|
|
709
|
+
private handleMapPress;
|
|
710
|
+
private handleMarkerPress;
|
|
711
|
+
private handleMarkerSelect;
|
|
712
|
+
private handleKmlReady;
|
|
713
|
+
private handleMarkerDeselect;
|
|
714
|
+
private handleRegionChange;
|
|
715
|
+
private handleRegionChangeStarted;
|
|
716
|
+
private handleIndoorBuildingFocused;
|
|
717
|
+
private handleIndoorLevelActivated;
|
|
718
|
+
private handleRegionChangeComplete;
|
|
719
|
+
private handleLongPress;
|
|
720
|
+
render(): React.JSX.Element;
|
|
721
|
+
}
|
|
722
|
+
export declare const AnimatedMapView: RNAnimated.AnimatedComponent<typeof MapView>;
|
|
723
|
+
export default MapView;
|