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