MCPcopy Create free account
hub / github.com/react-native-maps/react-native-maps / CustomTiles

Class CustomTiles

example/src/examples/CustomTilesLocal.tsx:17–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO;
16
17class CustomTiles extends React.Component<any, any> {
18 constructor(props: any) {
19 super(props);
20
21 this.state = {
22 region: {
23 latitude: LATITUDE,
24 longitude: LONGITUDE,
25 latitudeDelta: LATITUDE_DELTA,
26 longitudeDelta: LONGITUDE_DELTA,
27 },
28 };
29 }
30
31 get mapType() {
32 // MapKit does not support 'none' as a base map
33 return this.props.provider === PROVIDER_DEFAULT
34 ? MAP_TYPES.STANDARD
35 : MAP_TYPES.NONE;
36 }
37
38 render() {
39 const {region} = this.state;
40 return (
41 <View style={styles.container}>
42 <MapView
43 provider={this.props.provider}
44 mapType={this.mapType}
45 style={styles.map}
46 initialRegion={region}>
47 <LocalTile
48 pathTemplate="/path/to/locally/saved/tiles/{z}/{x}/{y}.png"
49 tileSize={256}
50 zIndex={-1}
51 />
52 </MapView>
53 <View style={styles.buttonContainer}>
54 <View style={styles.bubble}>
55 <Text>Custom Tiles Local</Text>
56 </View>
57 </View>
58 </View>
59 );
60 }
61}
62
63const styles = StyleSheet.create({
64 container: {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…