react-native-maps 0.29.4 → 0.31.0-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.
Files changed (67) hide show
  1. package/README.md +12 -5
  2. package/index.d.ts +21 -5
  3. package/index.js +1 -3
  4. package/lib/android/build.gradle +3 -1
  5. package/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapTileProvider.java +515 -0
  6. package/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapTileWorker.java +122 -0
  7. package/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapUrlTile.java +124 -55
  8. package/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapUrlTileManager.java +34 -0
  9. package/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java +19 -4
  10. package/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapWMSTile.java +31 -87
  11. package/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapWMSTileManager.java +22 -2
  12. package/lib/components/AnimatedRegion.js +67 -101
  13. package/lib/components/Geojson.js +67 -40
  14. package/lib/components/MapCallout.js +3 -5
  15. package/lib/components/MapCalloutSubview.js +3 -5
  16. package/lib/components/MapCircle.js +6 -6
  17. package/lib/components/MapHeatmap.js +5 -7
  18. package/lib/components/MapLocalTile.js +2 -6
  19. package/lib/components/MapMarker.js +9 -9
  20. package/lib/components/MapOverlay.js +3 -2
  21. package/lib/components/MapPolygon.js +6 -6
  22. package/lib/components/MapPolyline.js +6 -7
  23. package/lib/components/MapUrlTile.js +56 -8
  24. package/lib/components/MapView.js +16 -16
  25. package/lib/components/MapWMSTile.js +51 -8
  26. package/lib/components/decorateMapComponent.js +1 -1
  27. package/lib/ios/AirGoogleMaps/AIRGoogleMapMarker.h +1 -0
  28. package/lib/ios/AirGoogleMaps/AIRGoogleMapMarker.m +8 -0
  29. package/lib/ios/AirGoogleMaps/AIRGoogleMapMarkerManager.m +1 -0
  30. package/lib/ios/AirMaps/AIRMapManager.m +21 -3
  31. package/lib/ios/AirMaps/AIRMapMarkerManager.m +1 -0
  32. package/lib/ios/AirMaps/AIRMapPolyline.h +1 -0
  33. package/lib/ios/AirMaps/AIRMapPolyline.m +14 -1
  34. package/lib/ios/AirMaps/AIRMapPolylineManager.m +1 -0
  35. package/lib/ios/AirMaps/AIRMapUrlTile.h +22 -4
  36. package/lib/ios/AirMaps/AIRMapUrlTile.m +124 -34
  37. package/lib/ios/AirMaps/AIRMapUrlTileCachedOverlay.h +17 -0
  38. package/lib/ios/AirMaps/AIRMapUrlTileCachedOverlay.m +235 -0
  39. package/lib/ios/AirMaps/AIRMapUrlTileManager.m +6 -1
  40. package/lib/ios/AirMaps/AIRMapWMSTile.h +10 -16
  41. package/lib/ios/AirMaps/AIRMapWMSTile.m +68 -101
  42. package/lib/ios/AirMaps/AIRMapWMSTileManager.m +6 -1
  43. package/lib/ios/AirMaps.xcodeproj/project.pbxproj +7 -1
  44. package/package.json +44 -6
  45. package/react-native-google-maps.podspec +3 -3
  46. package/react-native-maps.podspec +1 -1
  47. package/.eslintrc +0 -3
  48. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -111
  49. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -32
  50. package/.github/ISSUE_TEMPLATE.md +0 -5
  51. package/.github/PULL_REQUEST_TEMPLATE.md +0 -53
  52. package/.github/stale.yml +0 -17
  53. package/.github/workflows/base.yml +0 -21
  54. package/.prettierrc +0 -4
  55. package/CHANGELOG.md +0 -761
  56. package/docs/callout.md +0 -38
  57. package/docs/circle.md +0 -28
  58. package/docs/examples-setup.md +0 -17
  59. package/docs/geojson.md +0 -50
  60. package/docs/heatmap.md +0 -32
  61. package/docs/installation.md +0 -347
  62. package/docs/mapview.md +0 -252
  63. package/docs/marker.md +0 -84
  64. package/docs/overlay.md +0 -27
  65. package/docs/polygon.md +0 -34
  66. package/docs/polyline.md +0 -65
  67. package/enable-google-maps +0 -15
@@ -8,37 +8,49 @@ if (__DEV__) {
8
8
  );
9
9
  }
10
10
  }
11
- // const __Animated = Object.getPrototypeOf(AnimatedWithChildren);
12
- // if (__Animated.name !== 'Animated') console.error('AnimatedRegion could not obtain Animated base class');
13
11
 
14
- var _uniqueId = 1;
12
+ const configTypes = [
13
+ 'latitude',
14
+ 'longitude',
15
+ 'latitudeDelta',
16
+ 'longitudeDelta',
17
+ ];
18
+
19
+ const defaultValues = {
20
+ // probably want to come up with better defaults
21
+ latitude: 0,
22
+ longitude: 0,
23
+ latitudeDelta: 0,
24
+ longitudeDelta: 0,
25
+ };
26
+
27
+ let _uniqueId = 1;
28
+
29
+ const getAnimatedValue = (valueIn, fallback) => {
30
+ if (valueIn instanceof Animated.Value) {
31
+ return valueIn;
32
+ } else if (typeof valueIn === 'number') {
33
+ return new Animated.Value(valueIn);
34
+ }
35
+ return new Animated.Value(fallback);
36
+ };
15
37
 
16
38
  export default class AnimatedMapRegion extends AnimatedWithChildren {
17
- constructor(valueIn) {
39
+ constructor(valueIn = {}) {
18
40
  super();
19
- var value = valueIn || {
20
- // probably want to come up with better defaults
21
- latitude: 0,
22
- longitude: 0,
23
- latitudeDelta: 0,
24
- longitudeDelta: 0,
25
- };
26
- this.latitude =
27
- value.latitude instanceof Animated.Value
28
- ? value.latitude
29
- : new Animated.Value(value.latitude);
30
- this.longitude =
31
- value.longitude instanceof Animated.Value
32
- ? value.longitude
33
- : new Animated.Value(value.longitude);
34
- this.latitudeDelta =
35
- value.latitudeDelta instanceof Animated.Value
36
- ? value.latitudeDelta
37
- : new Animated.Value(value.latitudeDelta);
38
- this.longitudeDelta =
39
- value.longitudeDelta instanceof Animated.Value
40
- ? value.longitudeDelta
41
- : new Animated.Value(value.longitudeDelta);
41
+ this.latitude = getAnimatedValue(valueIn.latitude, defaultValues.latitude);
42
+ this.longitude = getAnimatedValue(
43
+ valueIn.longitude,
44
+ defaultValues.longitude
45
+ );
46
+ this.latitudeDelta = getAnimatedValue(
47
+ valueIn.latitudeDelta,
48
+ defaultValues.latitudeDelta
49
+ );
50
+ this.longitudeDelta = getAnimatedValue(
51
+ valueIn.longitudeDelta,
52
+ defaultValues.longitudeDelta
53
+ );
42
54
  this._regionListeners = {};
43
55
  }
44
56
 
@@ -95,10 +107,8 @@ export default class AnimatedMapRegion extends AnimatedWithChildren {
95
107
  }
96
108
 
97
109
  addListener(callback) {
98
- var id = String(_uniqueId++);
99
- var jointCallback = (/*{value}*/) => {
100
- callback(this.__getValue());
101
- };
110
+ const id = String(_uniqueId++);
111
+ const jointCallback = () => /*{value}*/ callback(this.__getValue());
102
112
  this._regionListeners[id] = {
103
113
  latitude: this.latitude.addListener(jointCallback),
104
114
  longitude: this.longitude.addListener(jointCallback),
@@ -119,80 +129,36 @@ export default class AnimatedMapRegion extends AnimatedWithChildren {
119
129
  }
120
130
 
121
131
  spring(config) {
122
- var animations = [];
123
- config.hasOwnProperty('latitude') &&
124
- animations.push(
125
- Animated.spring(this.latitude, {
126
- ...config,
127
- toValue: config.latitude,
128
- })
129
- );
130
-
131
- config.hasOwnProperty('longitude') &&
132
- animations.push(
133
- Animated.spring(this.longitude, {
134
- ...config,
135
- toValue: config.longitude,
136
- })
137
- );
138
-
139
- config.hasOwnProperty('latitudeDelta') &&
140
- animations.push(
141
- Animated.spring(this.latitudeDelta, {
142
- ...config,
143
- toValue: config.latitudeDelta,
144
- })
145
- );
146
-
147
- config.hasOwnProperty('longitudeDelta') &&
148
- animations.push(
149
- Animated.spring(this.longitudeDelta, {
150
- ...config,
151
- toValue: config.longitudeDelta,
152
- })
153
- );
154
-
132
+ const animations = [];
133
+ for (const type of configTypes) {
134
+ if (config.hasOwnProperty(type)) {
135
+ animations.push(
136
+ Animated.spring(this[type], {
137
+ ...config,
138
+ toValue: config[type],
139
+ // may help to eliminate some dev warnings and perf issues
140
+ useNativeDriver: !!config?.useNativeDriver,
141
+ })
142
+ );
143
+ }
144
+ }
155
145
  return Animated.parallel(animations);
156
146
  }
157
147
 
158
148
  timing(config) {
159
- var animations = [];
160
- config.hasOwnProperty('latitude') &&
161
- animations.push(
162
- Animated.timing(this.latitude, {
163
- ...config,
164
- toValue: config.latitude,
165
- useNativeDriver: false,
166
- })
167
- );
168
-
169
- config.hasOwnProperty('longitude') &&
170
- animations.push(
171
- Animated.timing(this.longitude, {
172
- ...config,
173
- toValue: config.longitude,
174
- useNativeDriver: false,
175
- })
176
- );
177
-
178
- config.hasOwnProperty('latitudeDelta') &&
179
- animations.push(
180
- Animated.timing(this.latitudeDelta, {
181
- ...config,
182
- toValue: config.latitudeDelta,
183
- useNativeDriver: false,
184
- })
185
- );
186
-
187
- config.hasOwnProperty('longitudeDelta') &&
188
- animations.push(
189
- Animated.timing(this.longitudeDelta, {
190
- ...config,
191
- toValue: config.longitudeDelta,
192
- useNativeDriver: false,
193
- })
194
- );
195
-
149
+ const animations = [];
150
+ for (const type of configTypes) {
151
+ if (config.hasOwnProperty(type)) {
152
+ animations.push(
153
+ Animated.timing(this[type], {
154
+ ...config,
155
+ toValue: config[type],
156
+ // may help to eliminate some dev warnings and perf issues
157
+ useNativeDriver: !!config?.useNativeDriver,
158
+ })
159
+ );
160
+ }
161
+ }
196
162
  return Animated.parallel(animations);
197
163
  }
198
164
  }
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import Marker from './MapMarker';
4
4
  import Polyline from './MapPolyline';
5
5
  import Polygon from './MapPolygon';
6
- import { ColorPropType } from 'react-native';
6
+ import { ColorPropType } from 'deprecated-react-native-prop-types';
7
7
 
8
8
  const propTypes = {
9
9
  /**
@@ -39,6 +39,12 @@ const propTypes = {
39
39
  */
40
40
  lineDashPhase: PropTypes.number,
41
41
 
42
+ /**
43
+ * Make the `Polygon` or `Polyline` tappable
44
+ *
45
+ */
46
+ tappable: PropTypes.bool,
47
+
42
48
  /**
43
49
  * An array of numbers specifying the dash pattern to use for the path.
44
50
  *
@@ -100,9 +106,29 @@ const propTypes = {
100
106
  *
101
107
  */
102
108
  markerComponent: PropTypes.node,
109
+
110
+ /**
111
+ * The title of the marker. This is only used if the <Marker /> component has no children that
112
+ * are a `<Callout />`, in which case the default callout behavior will be used, which
113
+ * will show both the `title` and the `description`, if provided.
114
+ */
115
+ title: PropTypes.string,
103
116
  };
104
117
 
105
- const Geojson = props => {
118
+ const Geojson = (props) => {
119
+ const {
120
+ title,
121
+ image,
122
+ zIndex,
123
+ onPress,
124
+ lineCap,
125
+ lineJoin,
126
+ tappable,
127
+ miterLimit,
128
+ lineDashPhase,
129
+ lineDashPattern,
130
+ markerComponent,
131
+ } = props;
106
132
  const overlays = makeOverlays(props.geojson.features);
107
133
  return (
108
134
  <React.Fragment>
@@ -116,12 +142,13 @@ const Geojson = props => {
116
142
  <Marker
117
143
  key={index}
118
144
  coordinate={overlay.coordinates}
119
- image={props.image}
145
+ image={image}
146
+ title={title}
120
147
  pinColor={markerColor}
121
- zIndex={props.zIndex}
122
- onPress={() => props.onPress && props.onPress(overlay)}
148
+ zIndex={zIndex}
149
+ onPress={() => onPress && onPress(overlay)}
123
150
  >
124
- {props.markerComponent}
151
+ {markerComponent}
125
152
  </Marker>
126
153
  );
127
154
  }
@@ -134,9 +161,9 @@ const Geojson = props => {
134
161
  strokeColor={strokeColor}
135
162
  fillColor={fillColor}
136
163
  strokeWidth={strokeWidth}
137
- tappable={props.tappable}
138
- onPress={() => props.onPress && props.onPress(overlay)}
139
- zIndex={props.zIndex}
164
+ tappable={tappable}
165
+ onPress={() => onPress && onPress(overlay)}
166
+ zIndex={zIndex}
140
167
  />
141
168
  );
142
169
  }
@@ -147,14 +174,14 @@ const Geojson = props => {
147
174
  coordinates={overlay.coordinates}
148
175
  strokeColor={strokeColor}
149
176
  strokeWidth={strokeWidth}
150
- lineDashPhase={props.lineDashPhase}
151
- lineDashPattern={props.lineDashPattern}
152
- lineCap={props.lineCap}
153
- lineJoin={props.lineJoin}
154
- miterLimit={props.miterLimit}
155
- zIndex={props.zIndex}
156
- tappable={props.tappable}
157
- onPress={() => props.onPress && props.onPress(overlay)}
177
+ lineDashPhase={lineDashPhase}
178
+ lineDashPattern={lineDashPattern}
179
+ lineCap={lineCap}
180
+ lineJoin={lineJoin}
181
+ miterLimit={miterLimit}
182
+ zIndex={zIndex}
183
+ tappable={tappable}
184
+ onPress={() => onPress && onPress(overlay)}
158
185
  />
159
186
  );
160
187
  }
@@ -167,51 +194,51 @@ Geojson.propTypes = propTypes;
167
194
 
168
195
  export default Geojson;
169
196
 
170
- export const makeOverlays = features => {
197
+ export const makeOverlays = (features) => {
171
198
  const points = features
172
199
  .filter(
173
- f =>
200
+ (f) =>
174
201
  f.geometry &&
175
202
  (f.geometry.type === 'Point' || f.geometry.type === 'MultiPoint')
176
203
  )
177
- .map(feature =>
178
- makeCoordinates(feature).map(coordinates =>
204
+ .map((feature) =>
205
+ makeCoordinates(feature).map((coordinates) =>
179
206
  makeOverlay(coordinates, feature)
180
207
  )
181
208
  )
182
209
  .reduce(flatten, [])
183
- .map(overlay => ({ ...overlay, type: 'point' }));
210
+ .map((overlay) => ({ ...overlay, type: 'point' }));
184
211
 
185
212
  const lines = features
186
213
  .filter(
187
- f =>
214
+ (f) =>
188
215
  f.geometry &&
189
216
  (f.geometry.type === 'LineString' ||
190
217
  f.geometry.type === 'MultiLineString')
191
218
  )
192
- .map(feature =>
193
- makeCoordinates(feature).map(coordinates =>
219
+ .map((feature) =>
220
+ makeCoordinates(feature).map((coordinates) =>
194
221
  makeOverlay(coordinates, feature)
195
222
  )
196
223
  )
197
224
  .reduce(flatten, [])
198
- .map(overlay => ({ ...overlay, type: 'polyline' }));
225
+ .map((overlay) => ({ ...overlay, type: 'polyline' }));
199
226
 
200
227
  const multipolygons = features
201
- .filter(f => f.geometry && f.geometry.type === 'MultiPolygon')
202
- .map(feature =>
203
- makeCoordinates(feature).map(coordinates =>
228
+ .filter((f) => f.geometry && f.geometry.type === 'MultiPolygon')
229
+ .map((feature) =>
230
+ makeCoordinates(feature).map((coordinates) =>
204
231
  makeOverlay(coordinates, feature)
205
232
  )
206
233
  )
207
234
  .reduce(flatten, []);
208
235
 
209
236
  const polygons = features
210
- .filter(f => f.geometry && f.geometry.type === 'Polygon')
211
- .map(feature => makeOverlay(makeCoordinates(feature), feature))
237
+ .filter((f) => f.geometry && f.geometry.type === 'Polygon')
238
+ .map((feature) => makeOverlay(makeCoordinates(feature), feature))
212
239
  .reduce(flatten, [])
213
240
  .concat(multipolygons)
214
- .map(overlay => ({ ...overlay, type: 'polygon' }));
241
+ .map((overlay) => ({ ...overlay, type: 'polygon' }));
215
242
 
216
243
  return points.concat(lines).concat(polygons);
217
244
  };
@@ -236,11 +263,11 @@ const makeOverlay = (coordinates, feature) => {
236
263
  return overlay;
237
264
  };
238
265
 
239
- const makePoint = c => ({ latitude: c[1], longitude: c[0] });
266
+ const makePoint = (c) => ({ latitude: c[1], longitude: c[0] });
240
267
 
241
- const makeLine = l => l.map(makePoint);
268
+ const makeLine = (l) => l.map(makePoint);
242
269
 
243
- const makeCoordinates = feature => {
270
+ const makeCoordinates = (feature) => {
244
271
  const g = feature.geometry;
245
272
  if (g.type === 'Point') {
246
273
  return [makePoint(g.coordinates)];
@@ -253,7 +280,7 @@ const makeCoordinates = feature => {
253
280
  } else if (g.type === 'Polygon') {
254
281
  return g.coordinates.map(makeLine);
255
282
  } else if (g.type === 'MultiPolygon') {
256
- return g.coordinates.map(p => p.map(makeLine));
283
+ return g.coordinates.map((p) => p.map(makeLine));
257
284
  } else {
258
285
  return [];
259
286
  }
@@ -271,7 +298,7 @@ const doesOverlayContainProperty = (overlay, property) => {
271
298
  };
272
299
 
273
300
  const getRgbaFromHex = (hex, alpha = 1) => {
274
- const [r, g, b] = hex.match(/\w\w/g).map(x => parseInt(x, 16));
301
+ const [r, g, b] = hex.match(/\w\w/g).map((x) => parseInt(x, 16));
275
302
  return `rgba(${r},${g},${b},${alpha})`;
276
303
  };
277
304
 
@@ -293,15 +320,15 @@ const getColor = (props, overlay, colorType, overrideColorProp) => {
293
320
  }
294
321
  return color;
295
322
  }
296
- return null;
323
+ return;
297
324
  };
298
325
 
299
326
  const getStrokeWidth = (props, overlay) => {
300
327
  if (props.hasOwnProperty('strokeWidth')) {
301
- return props['strokeWidth'];
328
+ return props.strokeWidth;
302
329
  }
303
330
  if (doesOverlayContainProperty(overlay, 'stroke-width')) {
304
331
  return overlay.feature.properties['stroke-width'];
305
332
  }
306
- return 0;
333
+ return;
307
334
  };
@@ -1,16 +1,14 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
- import { StyleSheet, ViewPropTypes, View } from 'react-native';
3
+ import { StyleSheet } from 'react-native';
4
+ import { ViewPropTypes } from 'deprecated-react-native-prop-types';
4
5
  import decorateMapComponent, {
5
6
  SUPPORTED,
6
7
  USES_DEFAULT_IMPLEMENTATION,
7
8
  } from './decorateMapComponent';
8
9
 
9
- // if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
10
- const viewPropTypes = ViewPropTypes || View.propTypes;
11
-
12
10
  const propTypes = {
13
- ...viewPropTypes,
11
+ ...ViewPropTypes,
14
12
  tooltip: PropTypes.bool,
15
13
  onPress: PropTypes.func,
16
14
  alphaHitTest: PropTypes.bool,
@@ -1,16 +1,14 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
- import { StyleSheet, ViewPropTypes, View } from 'react-native';
3
+ import { StyleSheet } from 'react-native';
4
+ import { ViewPropTypes } from 'deprecated-react-native-prop-types';
4
5
  import decorateMapComponent, {
5
6
  SUPPORTED,
6
7
  NOT_SUPPORTED,
7
8
  } from './decorateMapComponent';
8
9
 
9
- // if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
10
- const viewPropTypes = ViewPropTypes || View.propTypes;
11
-
12
10
  const propTypes = {
13
- ...viewPropTypes,
11
+ ...ViewPropTypes,
14
12
  onPress: PropTypes.func,
15
13
  };
16
14
 
@@ -1,16 +1,16 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
- import { ColorPropType, ViewPropTypes, View } from 'react-native';
3
+ import {
4
+ ColorPropType,
5
+ ViewPropTypes,
6
+ } from 'deprecated-react-native-prop-types';
4
7
  import decorateMapComponent, {
5
8
  USES_DEFAULT_IMPLEMENTATION,
6
9
  SUPPORTED,
7
10
  } from './decorateMapComponent';
8
11
 
9
- // if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
10
- const viewPropTypes = ViewPropTypes || View.propTypes;
11
-
12
12
  const propTypes = {
13
- ...viewPropTypes,
13
+ ...ViewPropTypes,
14
14
 
15
15
  /**
16
16
  * The coordinate of the center of the circle
@@ -128,7 +128,7 @@ class MapCircle extends React.Component {
128
128
  return (
129
129
  <AIRMapCircle
130
130
  {...this.props}
131
- ref={ref => {
131
+ ref={(ref) => {
132
132
  this.circle = ref;
133
133
  }}
134
134
  />
@@ -1,16 +1,14 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
- import { ViewPropTypes, View, processColor } from 'react-native';
3
+ import { processColor } from 'react-native';
4
+ import { ViewPropTypes } from 'deprecated-react-native-prop-types';
4
5
  import decorateMapComponent, {
5
6
  SUPPORTED,
6
7
  USES_DEFAULT_IMPLEMENTATION,
7
8
  } from './decorateMapComponent';
8
9
 
9
- // if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
10
- const viewPropTypes = ViewPropTypes || View.propTypes;
11
-
12
10
  const propTypes = {
13
- ...viewPropTypes,
11
+ ...ViewPropTypes,
14
12
 
15
13
  /**
16
14
  * Array of heatmap entries to apply towards density.
@@ -73,13 +71,13 @@ class MapHeatmap extends React.Component {
73
71
  let gradient;
74
72
  if (this.props.gradient) {
75
73
  gradient = Object.assign({}, this.props.gradient);
76
- gradient.colors = gradient.colors.map(c => processColor(c));
74
+ gradient.colors = gradient.colors.map((c) => processColor(c));
77
75
  }
78
76
  return (
79
77
  <AIRMapHeatmap
80
78
  {...this.props}
81
79
  gradient={gradient}
82
- ref={ref => {
80
+ ref={(ref) => {
83
81
  this.heatmap = ref;
84
82
  }}
85
83
  />
@@ -1,18 +1,14 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
-
4
- import { ViewPropTypes, View } from 'react-native';
3
+ import { ViewPropTypes } from 'deprecated-react-native-prop-types';
5
4
 
6
5
  import decorateMapComponent, {
7
6
  USES_DEFAULT_IMPLEMENTATION,
8
7
  SUPPORTED,
9
8
  } from './decorateMapComponent';
10
9
 
11
- // if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
12
- const viewPropTypes = ViewPropTypes || View.propTypes;
13
-
14
10
  const propTypes = {
15
- ...viewPropTypes,
11
+ ...ViewPropTypes,
16
12
 
17
13
  /**
18
14
  * The path template of the local tile source.
@@ -1,16 +1,17 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
3
  import {
4
- ColorPropType,
5
4
  StyleSheet,
6
5
  Platform,
7
6
  NativeModules,
8
7
  Animated,
9
8
  Image,
10
9
  findNodeHandle,
11
- ViewPropTypes,
12
- View,
13
10
  } from 'react-native';
11
+ import {
12
+ ColorPropType,
13
+ ViewPropTypes,
14
+ } from 'deprecated-react-native-prop-types';
14
15
 
15
16
  import decorateMapComponent, {
16
17
  SUPPORTED,
@@ -24,11 +25,8 @@ const viewConfig = {
24
25
  },
25
26
  };
26
27
 
27
- // if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
28
- const viewPropTypes = ViewPropTypes || View.propTypes;
29
-
30
28
  const propTypes = {
31
- ...viewPropTypes,
29
+ ...ViewPropTypes,
32
30
 
33
31
  // TODO(lmr): get rid of these?
34
32
  identifier: PropTypes.string,
@@ -189,6 +187,8 @@ const propTypes = {
189
187
 
190
188
  draggable: PropTypes.bool,
191
189
 
190
+ tappable: PropTypes.bool,
191
+
192
192
  /**
193
193
  * Sets whether this marker should track view changes true.
194
194
  */
@@ -333,14 +333,14 @@ class MapMarker extends React.Component {
333
333
 
334
334
  return (
335
335
  <AIRMapMarker
336
- ref={ref => {
336
+ ref={(ref) => {
337
337
  this.marker = ref;
338
338
  }}
339
339
  {...this.props}
340
340
  image={image}
341
341
  icon={icon}
342
342
  style={[styles.marker, this.props.style]}
343
- onPress={event => {
343
+ onPress={(event) => {
344
344
  if (this.props.stopPropagation) {
345
345
  event.stopPropagation();
346
346
  }
@@ -1,6 +1,7 @@
1
1
  import React, { Component } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { View, StyleSheet, Image, Animated } from 'react-native';
3
+ import { StyleSheet, Image, Animated } from 'react-native';
4
+ import { ViewPropTypes } from 'deprecated-react-native-prop-types';
4
5
 
5
6
  import decorateMapComponent, {
6
7
  SUPPORTED,
@@ -15,7 +16,7 @@ const viewConfig = {
15
16
  };
16
17
 
17
18
  const propTypes = {
18
- ...View.propTypes,
19
+ ...ViewPropTypes,
19
20
  // A custom image to be used as overlay.
20
21
  image: PropTypes.any.isRequired,
21
22
  // Top left and bottom right coordinates for the overlay
@@ -1,17 +1,17 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
- import { ColorPropType, ViewPropTypes, View } from 'react-native';
3
+ import {
4
+ ColorPropType,
5
+ ViewPropTypes,
6
+ } from 'deprecated-react-native-prop-types';
4
7
  import decorateMapComponent, {
5
8
  USES_DEFAULT_IMPLEMENTATION,
6
9
  SUPPORTED,
7
10
  } from './decorateMapComponent';
8
11
  import * as ProviderConstants from './ProviderConstants';
9
12
 
10
- // if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
11
- const viewPropTypes = ViewPropTypes || View.propTypes;
12
-
13
13
  const propTypes = {
14
- ...viewPropTypes,
14
+ ...ViewPropTypes,
15
15
 
16
16
  /**
17
17
  * An array of coordinates to describe the polygon
@@ -175,7 +175,7 @@ class MapPolygon extends React.Component {
175
175
  return (
176
176
  <AIRMapPolygon
177
177
  {...this.props}
178
- ref={ref => {
178
+ ref={(ref) => {
179
179
  this.polygon = ref;
180
180
  }}
181
181
  onLayout={