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