react-native-maps 0.31.0 → 1.0.0-beta.10
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 +2 -6
- 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 -19
- package/ios/AirGoogleMaps/AIRGoogleMapManager.m +0 -95
- package/ios/AirGoogleMaps/AIRGoogleMapMarker.m +6 -0
- package/ios/AirMaps/AIRMap.h +0 -1
- package/ios/AirMaps/AIRMap.m +0 -12
- package/ios/AirMaps/AIRMapManager.m +4 -135
- 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 +78 -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 +290 -0
- package/lib/MapMarker.js +113 -0
- package/lib/MapOverlay.d.ts +87 -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 +677 -0
- package/lib/MapView.js +418 -0
- package/lib/MapView.types.d.ts +153 -0
- package/lib/MapView.types.js +2 -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/lib/index.d.ts +37 -0
- package/lib/index.js +81 -0
- package/lib/sharedTypes.d.ts +81 -0
- package/lib/sharedTypes.js +2 -0
- package/lib/sharedTypesInternal.d.ts +1 -0
- package/lib/sharedTypesInternal.js +2 -0
- package/package.json +21 -29
- package/react-native-google-maps.podspec +6 -7
- package/react-native-maps.podspec +5 -6
- 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/src/index.js +0 -31
package/src/MapOverlay.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { StyleSheet, Image, Animated } from 'react-native';
|
|
4
|
-
import { ViewPropTypes } from 'deprecated-react-native-prop-types';
|
|
5
|
-
|
|
6
|
-
import decorateMapComponent, {
|
|
7
|
-
SUPPORTED,
|
|
8
|
-
USES_DEFAULT_IMPLEMENTATION,
|
|
9
|
-
} from './decorateMapComponent';
|
|
10
|
-
|
|
11
|
-
const viewConfig = {
|
|
12
|
-
uiViewClassName: 'AIR<provider>MapOverlay',
|
|
13
|
-
validAttributes: {
|
|
14
|
-
image: true,
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const propTypes = {
|
|
19
|
-
...ViewPropTypes,
|
|
20
|
-
// A custom image to be used as overlay.
|
|
21
|
-
image: PropTypes.any.isRequired,
|
|
22
|
-
// Top left and bottom right coordinates for the overlay
|
|
23
|
-
bounds: PropTypes.arrayOf(PropTypes.array.isRequired).isRequired,
|
|
24
|
-
// The bearing in degrees clockwise from north.
|
|
25
|
-
bearing: PropTypes.number,
|
|
26
|
-
/* Boolean to allow an overlay to be tappable and use the
|
|
27
|
-
* onPress function
|
|
28
|
-
*/
|
|
29
|
-
tappable: PropTypes.bool,
|
|
30
|
-
// Callback that is called when the user presses on the overlay
|
|
31
|
-
onPress: PropTypes.func,
|
|
32
|
-
// The opacity of the overlay.
|
|
33
|
-
opacity: PropTypes.number,
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
class MapOverlay extends Component {
|
|
37
|
-
render() {
|
|
38
|
-
let image;
|
|
39
|
-
if (this.props.image) {
|
|
40
|
-
if (
|
|
41
|
-
typeof this.props.image.startsWith === 'function' &&
|
|
42
|
-
this.props.image.startsWith('http')
|
|
43
|
-
) {
|
|
44
|
-
image = this.props.image;
|
|
45
|
-
} else {
|
|
46
|
-
image = Image.resolveAssetSource(this.props.image) || {};
|
|
47
|
-
image = image.uri;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const AIRMapOverlay = this.getAirComponent();
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<AIRMapOverlay
|
|
55
|
-
{...this.props}
|
|
56
|
-
image={image}
|
|
57
|
-
style={[styles.overlay, this.props.style]}
|
|
58
|
-
/>
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
MapOverlay.propTypes = propTypes;
|
|
64
|
-
MapOverlay.viewConfig = viewConfig;
|
|
65
|
-
MapOverlay.defaultProps = {
|
|
66
|
-
opacity: 1.0,
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const styles = StyleSheet.create({
|
|
70
|
-
overlay: {
|
|
71
|
-
position: 'absolute',
|
|
72
|
-
backgroundColor: 'transparent',
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
MapOverlay.Animated = Animated.createAnimatedComponent(MapOverlay);
|
|
77
|
-
|
|
78
|
-
export default decorateMapComponent(MapOverlay, {
|
|
79
|
-
componentType: 'Overlay',
|
|
80
|
-
providers: {
|
|
81
|
-
google: {
|
|
82
|
-
ios: SUPPORTED,
|
|
83
|
-
android: USES_DEFAULT_IMPLEMENTATION,
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
});
|
package/src/MapPolygon.js
DELETED
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
ColorPropType,
|
|
5
|
-
ViewPropTypes,
|
|
6
|
-
} from 'deprecated-react-native-prop-types';
|
|
7
|
-
import decorateMapComponent, {
|
|
8
|
-
USES_DEFAULT_IMPLEMENTATION,
|
|
9
|
-
SUPPORTED,
|
|
10
|
-
} from './decorateMapComponent';
|
|
11
|
-
import * as ProviderConstants from './ProviderConstants';
|
|
12
|
-
|
|
13
|
-
const propTypes = {
|
|
14
|
-
...ViewPropTypes,
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* An array of coordinates to describe the polygon
|
|
18
|
-
*/
|
|
19
|
-
coordinates: PropTypes.arrayOf(
|
|
20
|
-
PropTypes.shape({
|
|
21
|
-
/**
|
|
22
|
-
* Latitude/Longitude coordinates
|
|
23
|
-
*/
|
|
24
|
-
latitude: PropTypes.number.isRequired,
|
|
25
|
-
longitude: PropTypes.number.isRequired,
|
|
26
|
-
})
|
|
27
|
-
),
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* An array of array of coordinates to describe the polygon holes
|
|
31
|
-
*/
|
|
32
|
-
holes: PropTypes.arrayOf(
|
|
33
|
-
PropTypes.arrayOf(
|
|
34
|
-
PropTypes.shape({
|
|
35
|
-
/**
|
|
36
|
-
* Latitude/Longitude coordinates
|
|
37
|
-
*/
|
|
38
|
-
latitude: PropTypes.number.isRequired,
|
|
39
|
-
longitude: PropTypes.number.isRequired,
|
|
40
|
-
})
|
|
41
|
-
)
|
|
42
|
-
),
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Callback that is called when the user presses on the polygon
|
|
46
|
-
*/
|
|
47
|
-
onPress: PropTypes.func,
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Boolean to allow a polygon to be tappable and use the
|
|
51
|
-
* onPress function
|
|
52
|
-
*/
|
|
53
|
-
tappable: PropTypes.bool,
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* The stroke width to use for the path.
|
|
57
|
-
*/
|
|
58
|
-
strokeWidth: PropTypes.number,
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* The stroke color to use for the path.
|
|
62
|
-
*/
|
|
63
|
-
strokeColor: ColorPropType,
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* The fill color to use for the path.
|
|
67
|
-
*/
|
|
68
|
-
fillColor: ColorPropType,
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* The order in which this tile overlay is drawn with respect to other overlays. An overlay
|
|
72
|
-
* with a larger z-index is drawn over overlays with smaller z-indices. The order of overlays
|
|
73
|
-
* with the same z-index is arbitrary. The default zIndex is 0.
|
|
74
|
-
*
|
|
75
|
-
* @platform android
|
|
76
|
-
*/
|
|
77
|
-
zIndex: PropTypes.number,
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* The line cap style to apply to the open ends of the path.
|
|
81
|
-
* The default style is `round`.
|
|
82
|
-
*
|
|
83
|
-
* @platform ios
|
|
84
|
-
*/
|
|
85
|
-
lineCap: PropTypes.oneOf(['butt', 'round', 'square']),
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* The line join style to apply to corners of the path.
|
|
89
|
-
* The default style is `round`.
|
|
90
|
-
*
|
|
91
|
-
* @platform ios
|
|
92
|
-
*/
|
|
93
|
-
lineJoin: PropTypes.oneOf(['miter', 'round', 'bevel']),
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* The limiting value that helps avoid spikes at junctions between connected line segments.
|
|
97
|
-
* The miter limit helps you avoid spikes in paths that use the `miter` `lineJoin` style. If
|
|
98
|
-
* the ratio of the miter length—that is, the diagonal length of the miter join—to the line
|
|
99
|
-
* thickness exceeds the miter limit, the joint is converted to a bevel join. The default
|
|
100
|
-
* miter limit is 10, which results in the conversion of miters whose angle at the joint
|
|
101
|
-
* is less than 11 degrees.
|
|
102
|
-
*
|
|
103
|
-
* @platform ios
|
|
104
|
-
*/
|
|
105
|
-
miterLimit: PropTypes.number,
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Boolean to indicate whether to draw each segment of the line as a geodesic as opposed to
|
|
109
|
-
* straight lines on the Mercator projection. A geodesic is the shortest path between two
|
|
110
|
-
* points on the Earth's surface. The geodesic curve is constructed assuming the Earth is
|
|
111
|
-
* a sphere.
|
|
112
|
-
*
|
|
113
|
-
*/
|
|
114
|
-
geodesic: PropTypes.bool,
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* The offset (in points) at which to start drawing the dash pattern.
|
|
118
|
-
*
|
|
119
|
-
* Use this property to start drawing a dashed line partway through a segment or gap. For
|
|
120
|
-
* example, a phase value of 6 for the patter 5-2-3-2 would cause drawing to begin in the
|
|
121
|
-
* middle of the first gap.
|
|
122
|
-
*
|
|
123
|
-
* The default value of this property is 0.
|
|
124
|
-
*
|
|
125
|
-
* @platform ios
|
|
126
|
-
*/
|
|
127
|
-
lineDashPhase: PropTypes.number,
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* An array of numbers specifying the dash pattern to use for the path.
|
|
131
|
-
*
|
|
132
|
-
* The array contains one or more numbers that indicate the lengths (measured in points) of the
|
|
133
|
-
* line segments and gaps in the pattern. The values in the array alternate, starting with the
|
|
134
|
-
* first line segment length, followed by the first gap length, followed by the second line
|
|
135
|
-
* segment length, and so on.
|
|
136
|
-
*
|
|
137
|
-
* This property is set to `null` by default, which indicates no line dash pattern.
|
|
138
|
-
*
|
|
139
|
-
* @platform ios
|
|
140
|
-
*/
|
|
141
|
-
lineDashPattern: PropTypes.arrayOf(PropTypes.number),
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
const defaultProps = {
|
|
145
|
-
strokeColor: '#000',
|
|
146
|
-
strokeWidth: 1,
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
class MapPolygon extends React.Component {
|
|
150
|
-
setNativeProps(props) {
|
|
151
|
-
this.polygon.setNativeProps(props);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
updateNativeProps() {
|
|
155
|
-
return () => {
|
|
156
|
-
const { fillColor, strokeColor, strokeWidth } = this.props;
|
|
157
|
-
let polygonNativeProps = {};
|
|
158
|
-
if (fillColor) {
|
|
159
|
-
polygonNativeProps.fillColor = fillColor;
|
|
160
|
-
}
|
|
161
|
-
if (strokeColor) {
|
|
162
|
-
polygonNativeProps.strokeColor = strokeColor;
|
|
163
|
-
}
|
|
164
|
-
if (strokeWidth) {
|
|
165
|
-
polygonNativeProps.strokeWidth = strokeWidth;
|
|
166
|
-
}
|
|
167
|
-
if (polygonNativeProps) {
|
|
168
|
-
this.setNativeProps(polygonNativeProps);
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
render() {
|
|
174
|
-
const AIRMapPolygon = this.getAirComponent();
|
|
175
|
-
return (
|
|
176
|
-
<AIRMapPolygon
|
|
177
|
-
{...this.props}
|
|
178
|
-
ref={(ref) => {
|
|
179
|
-
this.polygon = ref;
|
|
180
|
-
}}
|
|
181
|
-
onLayout={
|
|
182
|
-
this.context.provider === ProviderConstants.PROVIDER_GOOGLE
|
|
183
|
-
? this.updateNativeProps()
|
|
184
|
-
: undefined
|
|
185
|
-
}
|
|
186
|
-
/>
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
MapPolygon.propTypes = propTypes;
|
|
192
|
-
MapPolygon.defaultProps = defaultProps;
|
|
193
|
-
|
|
194
|
-
export default decorateMapComponent(MapPolygon, {
|
|
195
|
-
componentType: 'Polygon',
|
|
196
|
-
providers: {
|
|
197
|
-
google: {
|
|
198
|
-
ios: SUPPORTED,
|
|
199
|
-
android: USES_DEFAULT_IMPLEMENTATION,
|
|
200
|
-
},
|
|
201
|
-
},
|
|
202
|
-
});
|
package/src/MapPolyline.js
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
ColorPropType,
|
|
5
|
-
ViewPropTypes,
|
|
6
|
-
} from 'deprecated-react-native-prop-types';
|
|
7
|
-
import decorateMapComponent, {
|
|
8
|
-
USES_DEFAULT_IMPLEMENTATION,
|
|
9
|
-
SUPPORTED,
|
|
10
|
-
} from './decorateMapComponent';
|
|
11
|
-
|
|
12
|
-
const propTypes = {
|
|
13
|
-
...ViewPropTypes,
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* An array of coordinates to describe the polygon
|
|
17
|
-
*/
|
|
18
|
-
coordinates: PropTypes.arrayOf(
|
|
19
|
-
PropTypes.shape({
|
|
20
|
-
/**
|
|
21
|
-
* Latitude/Longitude coordinates
|
|
22
|
-
*/
|
|
23
|
-
latitude: PropTypes.number.isRequired,
|
|
24
|
-
longitude: PropTypes.number.isRequired,
|
|
25
|
-
})
|
|
26
|
-
),
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Callback that is called when the user presses on the polyline
|
|
30
|
-
*/
|
|
31
|
-
onPress: PropTypes.func,
|
|
32
|
-
|
|
33
|
-
/* Boolean to allow a polyline to be tappable and use the
|
|
34
|
-
* onPress function
|
|
35
|
-
*/
|
|
36
|
-
tappable: PropTypes.bool,
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* The fill color to use for the path.
|
|
40
|
-
*/
|
|
41
|
-
fillColor: ColorPropType,
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* The stroke width to use for the path.
|
|
45
|
-
*/
|
|
46
|
-
strokeWidth: PropTypes.number,
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* The stroke color to use for the path.
|
|
50
|
-
*/
|
|
51
|
-
strokeColor: ColorPropType,
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* The stroke colors to use for the path.
|
|
55
|
-
*/
|
|
56
|
-
strokeColors: PropTypes.arrayOf(ColorPropType),
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* The order in which this tile overlay is drawn with respect to other overlays. An overlay
|
|
60
|
-
* with a larger z-index is drawn over overlays with smaller z-indices. The order of overlays
|
|
61
|
-
* with the same z-index is arbitrary. The default zIndex is 0.
|
|
62
|
-
*
|
|
63
|
-
* @platform android
|
|
64
|
-
*/
|
|
65
|
-
zIndex: PropTypes.number,
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* The line cap style to apply to the open ends of the path.
|
|
69
|
-
* The default style is `round`.
|
|
70
|
-
*
|
|
71
|
-
* @platform ios
|
|
72
|
-
*/
|
|
73
|
-
lineCap: PropTypes.oneOf(['butt', 'round', 'square']),
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* The line join style to apply to corners of the path.
|
|
77
|
-
* The default style is `round`.
|
|
78
|
-
*
|
|
79
|
-
* @platform ios
|
|
80
|
-
*/
|
|
81
|
-
lineJoin: PropTypes.oneOf(['miter', 'round', 'bevel']),
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* The limiting value that helps avoid spikes at junctions between connected line segments.
|
|
85
|
-
* The miter limit helps you avoid spikes in paths that use the `miter` `lineJoin` style. If
|
|
86
|
-
* the ratio of the miter length—that is, the diagonal length of the miter join—to the line
|
|
87
|
-
* thickness exceeds the miter limit, the joint is converted to a bevel join. The default
|
|
88
|
-
* miter limit is 10, which results in the conversion of miters whose angle at the joint
|
|
89
|
-
* is less than 11 degrees.
|
|
90
|
-
*
|
|
91
|
-
* @platform ios
|
|
92
|
-
*/
|
|
93
|
-
miterLimit: PropTypes.number,
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Boolean to indicate whether to draw each segment of the line as a geodesic as opposed to
|
|
97
|
-
* straight lines on the Mercator projection. A geodesic is the shortest path between two
|
|
98
|
-
* points on the Earth's surface. The geodesic curve is constructed assuming the Earth is
|
|
99
|
-
* a sphere.
|
|
100
|
-
*
|
|
101
|
-
*/
|
|
102
|
-
geodesic: PropTypes.bool,
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* The offset (in points) at which to start drawing the dash pattern.
|
|
106
|
-
*
|
|
107
|
-
* Use this property to start drawing a dashed line partway through a segment or gap. For
|
|
108
|
-
* example, a phase value of 6 for the patter 5-2-3-2 would cause drawing to begin in the
|
|
109
|
-
* middle of the first gap.
|
|
110
|
-
*
|
|
111
|
-
* The default value of this property is 0.
|
|
112
|
-
*
|
|
113
|
-
* @platform ios
|
|
114
|
-
*/
|
|
115
|
-
lineDashPhase: PropTypes.number,
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* An array of numbers specifying the dash pattern to use for the path.
|
|
119
|
-
*
|
|
120
|
-
* The array contains one or more numbers that indicate the lengths (measured in points) of the
|
|
121
|
-
* line segments and gaps in the pattern. The values in the array alternate, starting with the
|
|
122
|
-
* first line segment length, followed by the first gap length, followed by the second line
|
|
123
|
-
* segment length, and so on.
|
|
124
|
-
*
|
|
125
|
-
* This property is set to `null` by default, which indicates no line dash pattern.
|
|
126
|
-
*
|
|
127
|
-
* @platform ios
|
|
128
|
-
*/
|
|
129
|
-
lineDashPattern: PropTypes.arrayOf(PropTypes.number),
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
const defaultProps = {
|
|
133
|
-
strokeColor: '#000',
|
|
134
|
-
strokeWidth: 1,
|
|
135
|
-
lineJoin: 'round',
|
|
136
|
-
lineCap: 'round',
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
class MapPolyline extends React.Component {
|
|
140
|
-
setNativeProps(props) {
|
|
141
|
-
this.polyline.setNativeProps(props);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
render() {
|
|
145
|
-
const AIRMapPolyline = this.getAirComponent();
|
|
146
|
-
return (
|
|
147
|
-
<AIRMapPolyline
|
|
148
|
-
{...this.props}
|
|
149
|
-
ref={(ref) => {
|
|
150
|
-
this.polyline = ref;
|
|
151
|
-
}}
|
|
152
|
-
/>
|
|
153
|
-
);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
MapPolyline.propTypes = propTypes;
|
|
158
|
-
MapPolyline.defaultProps = defaultProps;
|
|
159
|
-
|
|
160
|
-
export default decorateMapComponent(MapPolyline, {
|
|
161
|
-
componentType: 'Polyline',
|
|
162
|
-
providers: {
|
|
163
|
-
google: {
|
|
164
|
-
ios: SUPPORTED,
|
|
165
|
-
android: USES_DEFAULT_IMPLEMENTATION,
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
});
|
package/src/MapUrlTile.js
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { ViewPropTypes } from 'deprecated-react-native-prop-types';
|
|
4
|
-
|
|
5
|
-
import decorateMapComponent, {
|
|
6
|
-
USES_DEFAULT_IMPLEMENTATION,
|
|
7
|
-
SUPPORTED,
|
|
8
|
-
} from './decorateMapComponent';
|
|
9
|
-
|
|
10
|
-
const propTypes = {
|
|
11
|
-
...ViewPropTypes,
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* The url template of the tile server. The patterns {x} {y} {z} will be replaced at runtime
|
|
15
|
-
* For example, http://c.tile.openstreetmap.org/{z}/{x}/{y}.png
|
|
16
|
-
*/
|
|
17
|
-
urlTemplate: PropTypes.string.isRequired,
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* The order in which this tile overlay is drawn with respect to other overlays. An overlay
|
|
21
|
-
* with a larger z-index is drawn over overlays with smaller z-indices. The order of overlays
|
|
22
|
-
* with the same z-index is arbitrary. The default zIndex is -1.
|
|
23
|
-
*
|
|
24
|
-
* @platform android
|
|
25
|
-
*/
|
|
26
|
-
zIndex: PropTypes.number,
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* The maximum zoom level for this tile overlay.
|
|
30
|
-
*
|
|
31
|
-
*/
|
|
32
|
-
maximumZ: PropTypes.number,
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* (Optional) The maximum native zoom level for this tile overlay. Tiles are auto-scaled for higher
|
|
36
|
-
* zoom levels.
|
|
37
|
-
*
|
|
38
|
-
*/
|
|
39
|
-
maximumNativeZ: PropTypes.number,
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* The minimum zoom level for this tile overlay.
|
|
43
|
-
*
|
|
44
|
-
*/
|
|
45
|
-
minimumZ: PropTypes.number,
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Corresponds to MKTileOverlay canReplaceMapContent.
|
|
49
|
-
*
|
|
50
|
-
* @platform ios
|
|
51
|
-
*/
|
|
52
|
-
shouldReplaceMapContent: PropTypes.bool,
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* (Optional) Tile size only, default size is 256 (for tiles of 256 * 256 pixels)
|
|
56
|
-
*
|
|
57
|
-
*/
|
|
58
|
-
tileSize: PropTypes.number,
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* (Optional) Doubles tile size from 256 to 512 utilising higher zoom levels i.e.
|
|
62
|
-
* loading 4 higher zoom level tiles and combining them for one high-resolution
|
|
63
|
-
* tile. iOS does this automatically, even if it is not desirable always.
|
|
64
|
-
*
|
|
65
|
-
* @platform android
|
|
66
|
-
*/
|
|
67
|
-
doubleTileSize: PropTypes.bool,
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
*
|
|
71
|
-
* Allow tiles using the TMS coordinate system (origin bottom left)
|
|
72
|
-
* to be used, and displayed at their correct coordinates
|
|
73
|
-
*
|
|
74
|
-
*/
|
|
75
|
-
flipY: PropTypes.bool,
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
*
|
|
79
|
-
* (Optional) Enable caching of tiles in the specified directory. Directory
|
|
80
|
-
* can be specified either as a normal path or in URL format (file://). Tiles
|
|
81
|
-
* are stored in tileCachePath directory as follows "/{z}/{x}/{y}" i.e. in
|
|
82
|
-
* sub-directories 2-levels deep, filename tile y-coordinate without any
|
|
83
|
-
* filetype-extension.
|
|
84
|
-
* NB! All cache management needs to be implemented by client e.g. deleting tiles
|
|
85
|
-
* to manage use of storage space etc.
|
|
86
|
-
*
|
|
87
|
-
*/
|
|
88
|
-
tileCachePath: PropTypes.string,
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* (Optional) Defines how maximum age in seconds for cached tile before they
|
|
92
|
-
* are refreshed. NB! Refresh logic is "serve-stale-while-refresh" i.e. to
|
|
93
|
-
* ensure map availability a stale (over max age) tile is served while a tile
|
|
94
|
-
* refresh process is started in the background.
|
|
95
|
-
*/
|
|
96
|
-
tileCacheMaxAge: PropTypes.number,
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* (Optional) Sets offline-mode. In offline-mode tiles are not fetched from
|
|
100
|
-
* the tile servers, rather only tiles stored in the cache directory are used.
|
|
101
|
-
* Furthermore automated tile scaling is activated: if tile at a desired zoom
|
|
102
|
-
* level is not found from the cache directory, then lower zoom level tile is
|
|
103
|
-
* used (until minimumZ) and scaled.
|
|
104
|
-
*/
|
|
105
|
-
offlineMode: PropTypes.bool,
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* (Optional) Map layer opacity. Value between 0 - 1, with 0 meaning fully
|
|
109
|
-
* transparent.
|
|
110
|
-
*/
|
|
111
|
-
opacity: PropTypes.number,
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
class MapUrlTile extends React.Component {
|
|
115
|
-
render() {
|
|
116
|
-
const AIRMapUrlTile = this.getAirComponent();
|
|
117
|
-
return <AIRMapUrlTile {...this.props} />;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
MapUrlTile.propTypes = propTypes;
|
|
122
|
-
|
|
123
|
-
export default decorateMapComponent(MapUrlTile, {
|
|
124
|
-
componentType: 'UrlTile',
|
|
125
|
-
providers: {
|
|
126
|
-
google: {
|
|
127
|
-
ios: SUPPORTED,
|
|
128
|
-
android: USES_DEFAULT_IMPLEMENTATION,
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
});
|