react-native-maps 1.20.1 → 1.21.0-alpha.2

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.
@@ -0,0 +1,175 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.FabricMap = void 0;
30
+ const react_1 = __importStar(require("react"));
31
+ const NativeAirMapsModule_1 = __importDefault(require("./specs/NativeAirMapsModule"));
32
+ const NativeComponentMapView_1 = __importStar(require("./specs/NativeComponentMapView"));
33
+ const react_native_1 = require("react-native");
34
+ exports.FabricMap = (0, react_1.forwardRef)((props, ref) => {
35
+ const fabricRef = (0, react_1.useRef)(null);
36
+ // Use Imperative Handle to expose commands
37
+ (0, react_1.useImperativeHandle)(ref, () => ({
38
+ async getMarkersFrames(onlyVisible) {
39
+ if (fabricRef.current) {
40
+ return NativeAirMapsModule_1.default.getMarkersFrames((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, onlyVisible);
41
+ }
42
+ else {
43
+ throw new Error('getMarkersFrames is only supported on iOS with Fabric.');
44
+ }
45
+ },
46
+ async getCoordinateForPoint(point) {
47
+ if (fabricRef.current) {
48
+ return NativeAirMapsModule_1.default.getCoordinateForPoint((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, point);
49
+ }
50
+ else {
51
+ throw new Error('getCoordinateForPoint is only supported on iOS with Fabric.');
52
+ }
53
+ },
54
+ async getPointForCoordinate(coordinate) {
55
+ if (fabricRef.current) {
56
+ return NativeAirMapsModule_1.default.getPointForCoordinate((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, coordinate);
57
+ }
58
+ else {
59
+ throw new Error('getPointForCoordinate is only supported on iOS with Fabric.');
60
+ }
61
+ },
62
+ async getAddressFromCoordinates(coordinate) {
63
+ if (fabricRef.current) {
64
+ return NativeAirMapsModule_1.default.getAddressFromCoordinates((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, coordinate);
65
+ }
66
+ else {
67
+ throw new Error('getAddressFromCoordinates is only supported on iOS with Fabric.');
68
+ }
69
+ },
70
+ async takeSnapshot(config) {
71
+ if (fabricRef.current) {
72
+ return NativeAirMapsModule_1.default.takeSnapshot((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, config);
73
+ }
74
+ else {
75
+ throw new Error('takeSnapshot is only supported on iOS with Fabric.');
76
+ }
77
+ },
78
+ async getCamera() {
79
+ if (fabricRef.current) {
80
+ return NativeAirMapsModule_1.default.getCamera((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1);
81
+ }
82
+ else {
83
+ throw new Error('getCamera is only supported on iOS with Fabric.');
84
+ }
85
+ },
86
+ async getMapBoundaries() {
87
+ if (fabricRef.current) {
88
+ return NativeAirMapsModule_1.default.getMapBoundaries((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1);
89
+ }
90
+ else {
91
+ throw new Error('getMapBoundaries is only supported on iOS with Fabric.');
92
+ }
93
+ },
94
+ animateToRegion(region, duration) {
95
+ if (fabricRef.current) {
96
+ try {
97
+ NativeComponentMapView_1.Commands.animateToRegion(fabricRef.current, JSON.stringify(region), duration);
98
+ }
99
+ catch (error) {
100
+ throw new Error('Failed to animateToRegion');
101
+ }
102
+ }
103
+ else {
104
+ throw new Error('animateToRegion is only supported on iOS with Fabric.');
105
+ }
106
+ },
107
+ fitToElements(edgePadding, animated) {
108
+ if (fabricRef.current) {
109
+ try {
110
+ NativeComponentMapView_1.Commands.fitToElements(fabricRef.current, JSON.stringify(edgePadding), animated);
111
+ }
112
+ catch (error) {
113
+ throw new Error('Failed to fitToElements');
114
+ }
115
+ }
116
+ else {
117
+ throw new Error('fitToElements is only supported on iOS with Fabric.');
118
+ }
119
+ },
120
+ fitToSuppliedMarkers(markers, edgePadding, animated) {
121
+ if (fabricRef.current) {
122
+ try {
123
+ NativeComponentMapView_1.Commands.fitToSuppliedMarkers(fabricRef.current, JSON.stringify(markers), JSON.stringify(edgePadding), animated);
124
+ }
125
+ catch (error) {
126
+ throw new Error('Failed to fitToSuppliedMarkers');
127
+ }
128
+ }
129
+ else {
130
+ throw new Error('fitToSuppliedMarkers is only supported on iOS with Fabric.');
131
+ }
132
+ },
133
+ animateCamera(camera, duration) {
134
+ if (fabricRef.current) {
135
+ try {
136
+ NativeComponentMapView_1.Commands.animateCamera(fabricRef.current, JSON.stringify(camera), duration);
137
+ }
138
+ catch (error) {
139
+ throw new Error('Failed to animateCamera');
140
+ }
141
+ }
142
+ else {
143
+ throw new Error('animateCamera is only supported on iOS with Fabric.');
144
+ }
145
+ },
146
+ fitToCoordinates(coordinates, edgePadding, animated) {
147
+ if (fabricRef.current) {
148
+ try {
149
+ NativeComponentMapView_1.Commands.fitToCoordinates(fabricRef.current, JSON.stringify(coordinates), JSON.stringify(edgePadding), animated);
150
+ }
151
+ catch (error) {
152
+ throw new Error('Failed to fitToCoordinates');
153
+ }
154
+ }
155
+ else {
156
+ throw new Error('fitToCoordinates is only supported on iOS with Fabric.');
157
+ }
158
+ },
159
+ setCamera(camera) {
160
+ if (fabricRef.current) {
161
+ try {
162
+ NativeComponentMapView_1.Commands.setCamera(fabricRef.current, JSON.stringify(camera));
163
+ }
164
+ catch (error) {
165
+ console.error('Failed to set camera:', error);
166
+ }
167
+ }
168
+ else {
169
+ console.warn('setCamera is only supported on iOS with Fabric.');
170
+ }
171
+ },
172
+ }));
173
+ return <NativeComponentMapView_1.default {...props} ref={fabricRef}/>;
174
+ });
175
+ exports.default = exports.FabricMap;
package/lib/MapView.d.ts CHANGED
@@ -615,6 +615,7 @@ type State = {
615
615
  declare class MapView extends React.Component<MapViewProps, State> {
616
616
  static Animated: Animated.AnimatedComponent<typeof MapView>;
617
617
  private map;
618
+ private fabricMap;
618
619
  constructor(props: MapViewProps);
619
620
  setNativeProps(props: Partial<NativeProps>): void;
620
621
  private _onMapReady;
@@ -702,9 +703,12 @@ declare class MapView extends React.Component<MapViewProps, State> {
702
703
  * @return Object Object bounding box ({ northEast: <LatLng>, southWest: <LatLng> })
703
704
  */
704
705
  boundingBoxForRegion(region: Region): BoundingBox;
705
- private _mapManagerCommand;
706
706
  private _getHandle;
707
- private _runCommand;
707
+ private handleMapPress;
708
+ private handleMarkerPress;
709
+ private handleMarkerSelect;
710
+ private handleMarkerDeselect;
711
+ private handleRegionChange;
708
712
  render(): React.JSX.Element;
709
713
  }
710
714
  export declare const AnimatedMapView: RNAnimated.AnimatedComponent<typeof MapView>;
package/lib/MapView.js CHANGED
@@ -22,6 +22,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
25
28
  Object.defineProperty(exports, "__esModule", { value: true });
26
29
  exports.AnimatedMapView = exports.MAP_TYPES = void 0;
27
30
  const React = __importStar(require("react"));
@@ -29,6 +32,7 @@ const react_native_1 = require("react-native");
29
32
  const decorateMapComponent_1 = require("./decorateMapComponent");
30
33
  const ProviderConstants = __importStar(require("./ProviderConstants"));
31
34
  const MapViewNativeComponent_1 = require("./MapViewNativeComponent");
35
+ const FabricMapView_1 = __importDefault(require("./FabricMapView"));
32
36
  exports.MAP_TYPES = {
33
37
  STANDARD: 'standard',
34
38
  SATELLITE: 'satellite',
@@ -43,9 +47,11 @@ const GOOGLE_MAPS_ONLY_TYPES = [exports.MAP_TYPES.TERRAIN, exports.MAP_TYPES.NON
43
47
  class MapView extends React.Component {
44
48
  static Animated;
45
49
  map;
50
+ fabricMap;
46
51
  constructor(props) {
47
52
  super(props);
48
53
  this.map = React.createRef();
54
+ this.fabricMap = React.createRef();
49
55
  this.state = {
50
56
  isReady: react_native_1.Platform.OS === 'ios',
51
57
  };
@@ -81,40 +87,60 @@ class MapView extends React.Component {
81
87
  return react_native_1.NativeModules.AirMapModule.getCamera(this._getHandle());
82
88
  }
83
89
  else if (react_native_1.Platform.OS === 'ios') {
84
- return this._runCommand('getCamera', []);
90
+ if (this.fabricMap.current) {
91
+ return this.fabricMap.current.getCamera();
92
+ }
85
93
  }
86
94
  return Promise.reject('getCamera not supported on this platform');
87
95
  }
88
96
  setCamera(camera) {
89
- if (this.map.current) {
97
+ if (this.fabricMap.current) {
98
+ this.fabricMap.current.setCamera(camera);
99
+ }
100
+ else if (this.map.current) {
90
101
  MapViewNativeComponent_1.Commands.setCamera(this.map.current, camera);
91
102
  }
92
103
  }
93
104
  animateCamera(camera, opts) {
94
- if (this.map.current) {
105
+ if (this.fabricMap.current) {
106
+ this.fabricMap.current.animateCamera(camera, opts?.duration ? opts.duration : 500);
107
+ }
108
+ else if (this.map.current) {
95
109
  MapViewNativeComponent_1.Commands.animateCamera(this.map.current, camera, opts?.duration ? opts.duration : 500);
96
110
  }
97
111
  }
98
112
  animateToRegion(region, duration = 500) {
99
- if (this.map.current) {
113
+ if (this.fabricMap.current) {
114
+ this.fabricMap.current.animateToRegion(region, duration);
115
+ }
116
+ else if (this.map.current) {
100
117
  MapViewNativeComponent_1.Commands.animateToRegion(this.map.current, region, duration);
101
118
  }
102
119
  }
103
120
  fitToElements(options = {}) {
104
- if (this.map.current) {
105
- const { edgePadding = { top: 0, right: 0, bottom: 0, left: 0 }, animated = true, } = options;
121
+ const { edgePadding = { top: 0, right: 0, bottom: 0, left: 0 }, animated = true, } = options;
122
+ if (this.fabricMap.current) {
123
+ this.fabricMap.current.fitToElements(edgePadding, animated);
124
+ }
125
+ else if (this.map.current) {
106
126
  MapViewNativeComponent_1.Commands.fitToElements(this.map.current, edgePadding, animated);
107
127
  }
108
128
  }
109
129
  fitToSuppliedMarkers(markers, options = {}) {
110
- if (this.map.current) {
111
- const { edgePadding = { top: 0, right: 0, bottom: 0, left: 0 }, animated = true, } = options;
130
+ const { edgePadding = { top: 0, right: 0, bottom: 0, left: 0 }, animated = true, } = options;
131
+ if (this.fabricMap.current) {
132
+ this.fabricMap.current.fitToSuppliedMarkers(markers, edgePadding, animated);
133
+ }
134
+ else if (this.map.current) {
112
135
  MapViewNativeComponent_1.Commands.fitToSuppliedMarkers(this.map.current, markers, edgePadding, animated);
113
136
  }
114
137
  }
115
138
  fitToCoordinates(coordinates = [], options = {}) {
116
- if (this.map.current) {
117
- const { edgePadding = { top: 0, right: 0, bottom: 0, left: 0 }, animated = true, } = options;
139
+ const { edgePadding = { top: 0, right: 0, bottom: 0, left: 0 }, animated = true, } = options;
140
+ if (this.fabricMap.current) {
141
+ this.fabricMap.current.fitToCoordinates(coordinates, edgePadding, animated);
142
+ }
143
+ else if (this.map.current) {
118
144
  MapViewNativeComponent_1.Commands.fitToCoordinates(this.map.current, coordinates, edgePadding, animated);
119
145
  }
120
146
  }
@@ -128,7 +154,9 @@ class MapView extends React.Component {
128
154
  return await react_native_1.NativeModules.AirMapModule.getMapBoundaries(this._getHandle());
129
155
  }
130
156
  else if (react_native_1.Platform.OS === 'ios') {
131
- return await this._runCommand('getMapBoundaries', []);
157
+ if (this.fabricMap.current) {
158
+ return this.fabricMap.current.getMapBoundaries();
159
+ }
132
160
  }
133
161
  return Promise.reject('getMapBoundaries not supported on this platform');
134
162
  }
@@ -177,24 +205,10 @@ class MapView extends React.Component {
177
205
  return react_native_1.NativeModules.AirMapModule.takeSnapshot(this._getHandle(), config);
178
206
  }
179
207
  else if (react_native_1.Platform.OS === 'ios') {
180
- return new Promise((resolve, reject) => {
181
- this._runCommand('takeSnapshot', [
182
- config.width,
183
- config.height,
184
- config.region,
185
- config.format,
186
- config.quality,
187
- config.result,
188
- (err, snapshot) => {
189
- if (err) {
190
- reject(err);
191
- }
192
- else {
193
- resolve(snapshot);
194
- }
195
- },
196
- ]);
197
- });
208
+ if (this.fabricMap.current) {
209
+ // @ts-ignore
210
+ return this.fabricMap.current.takeSnapshot(config);
211
+ }
198
212
  }
199
213
  return Promise.reject('takeSnapshot not supported on this platform');
200
214
  }
@@ -212,7 +226,9 @@ class MapView extends React.Component {
212
226
  return react_native_1.NativeModules.AirMapModule.getAddressFromCoordinates(this._getHandle(), coordinate);
213
227
  }
214
228
  else if (react_native_1.Platform.OS === 'ios') {
215
- return this._runCommand('getAddressFromCoordinates', [coordinate]);
229
+ if (this.fabricMap.current) {
230
+ return this.fabricMap.current.getAddressFromCoordinates(coordinate);
231
+ }
216
232
  }
217
233
  return Promise.reject('getAddress not supported on this platform');
218
234
  }
@@ -230,7 +246,9 @@ class MapView extends React.Component {
230
246
  return react_native_1.NativeModules.AirMapModule.pointForCoordinate(this._getHandle(), coordinate);
231
247
  }
232
248
  else if (react_native_1.Platform.OS === 'ios') {
233
- return this._runCommand('pointForCoordinate', [coordinate]);
249
+ if (this.fabricMap.current) {
250
+ return this.fabricMap.current.getPointForCoordinate(coordinate);
251
+ }
234
252
  }
235
253
  return Promise.reject('pointForCoordinate not supported on this platform');
236
254
  }
@@ -248,7 +266,9 @@ class MapView extends React.Component {
248
266
  return react_native_1.NativeModules.AirMapModule.coordinateForPoint(this._getHandle(), point);
249
267
  }
250
268
  else if (react_native_1.Platform.OS === 'ios') {
251
- return this._runCommand('coordinateForPoint', [point]);
269
+ if (this.fabricMap.current) {
270
+ return this.fabricMap.current.getCoordinateForPoint(point);
271
+ }
252
272
  }
253
273
  return Promise.reject('coordinateForPoint not supported on this platform');
254
274
  }
@@ -261,7 +281,10 @@ class MapView extends React.Component {
261
281
  */
262
282
  getMarkersFrames(onlyVisible = false) {
263
283
  if (react_native_1.Platform.OS === 'ios') {
264
- return this._runCommand('getMarkersFrames', [onlyVisible]);
284
+ if (this.fabricMap.current) {
285
+ // @ts-ignore
286
+ return this.fabricMap.current.getMarkersFrames(onlyVisible);
287
+ }
265
288
  }
266
289
  return Promise.reject('getMarkersFrames not supported on this platform');
267
290
  }
@@ -284,69 +307,119 @@ class MapView extends React.Component {
284
307
  },
285
308
  };
286
309
  }
287
- _mapManagerCommand(name) {
288
- return react_native_1.NativeModules[`${(0, decorateMapComponent_1.getNativeMapName)(this.props.provider)}Manager`][name];
289
- }
290
310
  _getHandle() {
291
311
  return (0, react_native_1.findNodeHandle)(this.map.current);
292
312
  }
293
- _runCommand(name, args) {
294
- if (react_native_1.Platform.OS === 'ios') {
295
- return this._mapManagerCommand(name)(this._getHandle(), ...args);
313
+ handleMapPress = (event) => {
314
+ if (this.props.onPress) {
315
+ this.props.onPress(event);
296
316
  }
297
- else {
298
- return Promise.reject(`Invalid platform was passed: ${react_native_1.Platform.OS}`);
317
+ };
318
+ handleMarkerPress = (event) => {
319
+ if (this.props.onMarkerPress) {
320
+ this.props.onMarkerPress(event);
299
321
  }
300
- }
322
+ };
323
+ handleMarkerSelect = (event) => {
324
+ if (this.props.onMarkerSelect) {
325
+ this.props.onMarkerSelect(event);
326
+ }
327
+ };
328
+ handleMarkerDeselect = (event) => {
329
+ if (this.props.onMarkerDeselect) {
330
+ this.props.onMarkerDeselect(event);
331
+ }
332
+ };
333
+ handleRegionChange = (event) => {
334
+ const isGesture = event.nativeEvent.isGesture;
335
+ const details = { isGesture };
336
+ if (event.nativeEvent.continuous) {
337
+ if (this.props.onRegionChange) {
338
+ this.props.onRegionChange(event.nativeEvent.region, details);
339
+ }
340
+ }
341
+ else if (this.props.onRegionChangeComplete) {
342
+ this.props.onRegionChangeComplete(event.nativeEvent.region, details);
343
+ }
344
+ };
301
345
  render() {
302
- let props;
303
- if (this.state.isReady) {
304
- props = {
305
- region: null,
306
- initialRegion: null,
307
- onChange: this._onChange,
346
+ if (react_native_1.Platform.OS === 'ios' &&
347
+ this.props.provider === ProviderConstants.PROVIDER_DEFAULT) {
348
+ const AIRMap = FabricMapView_1.default;
349
+ // Define props specifically for MapFabricNativeProps
350
+ /* eslint-disable @typescript-eslint/no-unused-vars */
351
+ const { onCalloutPress, onIndoorBuildingFocused, onKmlReady, onLongPress, onMarkerDeselect, onMarkerPress, onMarkerSelect, onRegionChangeStart, onRegionChange, onRegionChangeComplete, onPress, region, ...restProps } = this.props;
352
+ /* eslint-enable @typescript-eslint/no-unused-vars */
353
+ const userInterfaceStyle = this.props.userInterfaceStyle || 'system';
354
+ const props = {
308
355
  onMapReady: this._onMapReady,
309
356
  liteMode: this.props.liteMode,
310
357
  googleMapId: this.props.googleMapId,
311
358
  googleRenderer: this.props.googleRenderer,
312
- ref: this.map,
313
- customMapStyleString: this.props.customMapStyle
314
- ? JSON.stringify(this.props.customMapStyle)
315
- : undefined,
316
- ...this.props,
359
+ onPress: this.handleMapPress,
360
+ onMarkerPress: this.handleMarkerPress,
361
+ onMarkerSelect: this.handleMarkerSelect,
362
+ onMarkerDeselect: this.handleMarkerDeselect,
363
+ userInterfaceStyle: userInterfaceStyle,
364
+ onRegionChange: this.handleRegionChange,
365
+ ...restProps,
317
366
  };
318
- if (react_native_1.Platform.OS === 'ios' &&
319
- props.provider === ProviderConstants.PROVIDER_DEFAULT &&
320
- props.mapType &&
321
- GOOGLE_MAPS_ONLY_TYPES.includes(props.mapType)) {
322
- props.mapType = exports.MAP_TYPES.STANDARD;
367
+ if (this.props.region) {
368
+ props.region = {
369
+ latitude: this.props.region.latitude,
370
+ longitude: this.props.region.longitude,
371
+ latitudeDelta: this.props.region.latitudeDelta,
372
+ longitudeDelta: this.props.region.longitudeDelta,
373
+ };
323
374
  }
324
- if (props.onPanDrag) {
325
- props.handlePanDrag = !!props.onPanDrag;
375
+ if (this.state.isReady) {
376
+ if (props.mapType && GOOGLE_MAPS_ONLY_TYPES.includes(props.mapType)) {
377
+ props.mapType = exports.MAP_TYPES.STANDARD;
378
+ console.log('ready');
379
+ }
326
380
  }
381
+ else {
382
+ props.style = this.props.style;
383
+ props.initialCamera = this.props.initialCamera;
384
+ props.onLayout = this.props.onLayout;
385
+ }
386
+ // Render AIRMap with MapFabricNativeProps
387
+ return (<decorateMapComponent_1.ProviderContext.Provider value={this.props.provider}>
388
+ <AIRMap {...props} ref={this.fabricMap}/>
389
+ </decorateMapComponent_1.ProviderContext.Provider>);
327
390
  }
328
391
  else {
329
- props = {
330
- style: this.props.style,
392
+ const AIRMap = getNativeMapComponent(this.props.provider);
393
+ // Define props specifically for NativeProps
394
+ const props = {
331
395
  region: null,
396
+ initialRegion: null,
397
+ onChange: this._onChange,
398
+ onMapReady: this._onMapReady,
332
399
  liteMode: this.props.liteMode,
333
400
  googleMapId: this.props.googleMapId,
334
401
  googleRenderer: this.props.googleRenderer,
335
- initialRegion: this.props.initialRegion || null,
336
- initialCamera: this.props.initialCamera,
337
402
  ref: this.map,
338
- onChange: this._onChange,
339
- onMapReady: this._onMapReady,
340
- onLayout: this.props.onLayout,
341
403
  customMapStyleString: this.props.customMapStyle
342
404
  ? JSON.stringify(this.props.customMapStyle)
343
405
  : undefined,
406
+ ...this.props,
344
407
  };
408
+ if (this.state.isReady) {
409
+ if (props.onPanDrag) {
410
+ props.handlePanDrag = !!props.onPanDrag;
411
+ }
412
+ }
413
+ else {
414
+ props.style = this.props.style;
415
+ props.initialCamera = this.props.initialCamera;
416
+ props.onLayout = this.props.onLayout;
417
+ }
418
+ // Render AIRMap with NativeProps
419
+ return (<decorateMapComponent_1.ProviderContext.Provider value={this.props.provider}>
420
+ <AIRMap {...props}/>
421
+ </decorateMapComponent_1.ProviderContext.Provider>);
345
422
  }
346
- const AIRMap = getNativeMapComponent(this.props.provider);
347
- return (<decorateMapComponent_1.ProviderContext.Provider value={this.props.provider}>
348
- <AIRMap {...props}/>
349
- </decorateMapComponent_1.ProviderContext.Provider>);
350
423
  }
351
424
  }
352
425
  const airMaps = {
@@ -0,0 +1,31 @@
1
+ import type { TurboModule } from 'react-native';
2
+ import type { Double, UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';
3
+ import type { Camera } from './NativeComponentMapView';
4
+ import { Address } from 'react-native-maps';
5
+ type LatLng = {
6
+ latitude: Double;
7
+ longitude: Double;
8
+ };
9
+ type Point = Readonly<{
10
+ x: Double;
11
+ y: Double;
12
+ }>;
13
+ export type Region = Readonly<LatLng & {
14
+ latitudeDelta: Double;
15
+ longitudeDelta: Double;
16
+ }>;
17
+ export type MapBoundaries = {
18
+ northEast: LatLng;
19
+ southWest: LatLng;
20
+ };
21
+ export interface Spec extends TurboModule {
22
+ getCamera(tag: Double): Promise<Camera>;
23
+ getMarkersFrames(tag: Double, onlyVisible: boolean): Promise<unknown>;
24
+ getMapBoundaries(tag: Double): Promise<MapBoundaries>;
25
+ takeSnapshot(tag: Double, config: UnsafeObject): Promise<string>;
26
+ getAddressFromCoordinates(tag: Double, coordinate: LatLng): Promise<Address>;
27
+ getPointForCoordinate(tag: Double, coordinate: LatLng): Promise<Point>;
28
+ getCoordinateForPoint(tag: Double, point: Point): Promise<LatLng>;
29
+ }
30
+ declare const _default: Spec;
31
+ export default _default;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const react_native_1 = require("react-native");
4
+ exports.default = react_native_1.TurboModuleRegistry.getEnforcing('RNMapsAirModule');