forked from react-native-maps/react-native-maps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMapLocalTile.js
More file actions
63 lines (53 loc) · 1.43 KB
/
MapLocalTile.js
File metadata and controls
63 lines (53 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import PropTypes from 'prop-types';
import React from 'react';
import {
ViewPropTypes,
View,
} from 'react-native';
import decorateMapComponent, {
USES_DEFAULT_IMPLEMENTATION,
SUPPORTED,
} from './decorateMapComponent';
// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
const viewPropTypes = ViewPropTypes || View.propTypes;
const propTypes = {
...viewPropTypes,
/**
* The path template of the local tile source.
* The patterns {x} {y} {z} will be replaced at runtime,
* for example, /storage/emulated/0/tiles/{z}/{x}/{y}.png.
*/
pathTemplate: PropTypes.string.isRequired,
/**
* The order in which this tile overlay is drawn with respect to other overlays. An overlay
* with a larger z-index is drawn over overlays with smaller z-indices. The order of overlays
* with the same z-index is arbitrary. The default zIndex is -1.
*
* @platform android
*/
zIndex: PropTypes.number,
/**
* Size of tile images.
*/
tileSize: PropTypes.number,
};
class MapLocalTile extends React.Component {
render() {
const AIRMapLocalTile = this.getAirComponent();
return (
<AIRMapLocalTile
{...this.props}
/>
);
}
}
MapLocalTile.propTypes = propTypes;
export default decorateMapComponent(MapLocalTile, {
componentType: 'LocalTile',
providers: {
google: {
ios: SUPPORTED,
android: USES_DEFAULT_IMPLEMENTATION,
},
},
});