react-native-maps 1.3.0 → 1.3.1

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/lib/MapView.d.ts CHANGED
@@ -664,6 +664,7 @@ declare class MapView extends React.Component<MapViewProps, State> {
664
664
  */
665
665
  boundingBoxForRegion(region: Region): BoundingBox;
666
666
  private _mapManagerCommand;
667
+ private _getHandle;
667
668
  private _runCommand;
668
669
  render(): JSX.Element;
669
670
  }
package/lib/MapView.js CHANGED
@@ -81,7 +81,7 @@ class MapView extends React.Component {
81
81
  }
82
82
  getCamera() {
83
83
  if (react_native_1.Platform.OS === 'android') {
84
- return react_native_1.NativeModules.AirMapModule.getCamera(this.map.current);
84
+ return react_native_1.NativeModules.AirMapModule.getCamera(this._getHandle());
85
85
  }
86
86
  else if (react_native_1.Platform.OS === 'ios') {
87
87
  return this._runCommand('getCamera', []);
@@ -128,7 +128,7 @@ class MapView extends React.Component {
128
128
  */
129
129
  async getMapBoundaries() {
130
130
  if (react_native_1.Platform.OS === 'android') {
131
- return await react_native_1.NativeModules.AirMapModule.getMapBoundaries(this.map.current);
131
+ return await react_native_1.NativeModules.AirMapModule.getMapBoundaries(this._getHandle());
132
132
  }
133
133
  else if (react_native_1.Platform.OS === 'ios') {
134
134
  return await this._runCommand('getMapBoundaries', []);
@@ -177,7 +177,7 @@ class MapView extends React.Component {
177
177
  }
178
178
  // Call native function
179
179
  if (react_native_1.Platform.OS === 'android') {
180
- return react_native_1.NativeModules.AirMapModule.takeSnapshot(this.map.current, config);
180
+ return react_native_1.NativeModules.AirMapModule.takeSnapshot(this._getHandle(), config);
181
181
  }
182
182
  else if (react_native_1.Platform.OS === 'ios') {
183
183
  return new Promise((resolve, reject) => {
@@ -212,7 +212,7 @@ class MapView extends React.Component {
212
212
  */
213
213
  addressForCoordinate(coordinate) {
214
214
  if (react_native_1.Platform.OS === 'android') {
215
- return react_native_1.NativeModules.AirMapModule.getAddressFromCoordinates(this.map.current, coordinate);
215
+ return react_native_1.NativeModules.AirMapModule.getAddressFromCoordinates(this._getHandle(), coordinate);
216
216
  }
217
217
  else if (react_native_1.Platform.OS === 'ios') {
218
218
  return this._runCommand('getAddressFromCoordinates', [coordinate]);
@@ -230,7 +230,7 @@ class MapView extends React.Component {
230
230
  */
231
231
  pointForCoordinate(coordinate) {
232
232
  if (react_native_1.Platform.OS === 'android') {
233
- return react_native_1.NativeModules.AirMapModule.pointForCoordinate(this.map.current, coordinate);
233
+ return react_native_1.NativeModules.AirMapModule.pointForCoordinate(this._getHandle(), coordinate);
234
234
  }
235
235
  else if (react_native_1.Platform.OS === 'ios') {
236
236
  return this._runCommand('pointForCoordinate', [coordinate]);
@@ -248,7 +248,7 @@ class MapView extends React.Component {
248
248
  */
249
249
  coordinateForPoint(point) {
250
250
  if (react_native_1.Platform.OS === 'android') {
251
- return react_native_1.NativeModules.AirMapModule.coordinateForPoint(this.map.current, point);
251
+ return react_native_1.NativeModules.AirMapModule.coordinateForPoint(this._getHandle(), point);
252
252
  }
253
253
  else if (react_native_1.Platform.OS === 'ios') {
254
254
  return this._runCommand('coordinateForPoint', [point]);
@@ -290,9 +290,12 @@ class MapView extends React.Component {
290
290
  _mapManagerCommand(name) {
291
291
  return react_native_1.NativeModules[`${(0, decorateMapComponent_1.getNativeMapName)(this.props.provider)}Manager`][name];
292
292
  }
293
+ _getHandle() {
294
+ return (0, react_native_1.findNodeHandle)(this.map.current);
295
+ }
293
296
  _runCommand(name, args) {
294
297
  if (react_native_1.Platform.OS === 'ios') {
295
- return this._mapManagerCommand(name)(this.map.current, ...args);
298
+ return this._mapManagerCommand(name)(this._getHandle(), ...args);
296
299
  }
297
300
  else {
298
301
  return Promise.reject(`Invalid platform was passed: ${react_native_1.Platform.OS}`);
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "main": "lib/index.js",
6
6
  "author": "Leland Richardson <leland.m.richardson@gmail.com>",
7
7
  "homepage": "https://github.com/react-native-maps/react-native-maps#readme",
8
- "version": "1.3.0",
8
+ "version": "1.3.1",
9
9
  "license": "MIT",
10
10
  "scripts": {
11
11
  "lint": "eslint . --max-warnings 0",