react-native-maps 1.3.0 → 1.3.2-beta.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/README.md CHANGED
@@ -114,7 +114,7 @@ import { Marker } from 'react-native-maps';
114
114
  ```
115
115
 
116
116
  ### Rendering a Marker with a custom image
117
- 1. You need to generate an `png` image with various resolution (lets call them `custom_pin`) - for more information go to [Android](https://developer.android.com/studio/write/image-asset-studio#access), [iOS](https://developer.apple.com/documentation/xcode/adding-images-to-your-xcode-project)
117
+ 1. You need to generate an `png` image with various resolution (lets call them `custom_pin`) - for more information go to [Android](https://developer.android.com/studio/write/resource-manager#import), [iOS](https://developer.apple.com/documentation/xcode/adding-images-to-your-xcode-project)
118
118
  2. put all images in Android drawables and iOS assets dir
119
119
  3. Now you can use the following code:
120
120
  ```jsx
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.2-beta.1",
9
9
  "license": "MIT",
10
10
  "scripts": {
11
11
  "lint": "eslint . --max-warnings 0",
@@ -14,6 +14,7 @@ Pod::Spec.new do |s|
14
14
  s.source = { :git => "https://github.com/react-native-maps/react-native-maps.git", :tag=> "v#{s.version}" }
15
15
  s.source_files = "ios/AirGoogleMaps/**/*.{h,m}"
16
16
  s.compiler_flags = '-DHAVE_GOOGLE_MAPS=1', '-DHAVE_GOOGLE_MAPS_UTILS=1', '-fno-modules'
17
+ s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "$(inherited) '$(PODS_ROOT)/Google-Maps-iOS-Utils/src/Heatmap' '$(PODS_ROOT)/Headers/Public/'" }
17
18
 
18
19
  s.dependency 'React-Core'
19
20
  s.dependency 'GoogleMaps', '7.0.0'