forked from react-native-maps/react-native-maps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLiteMapView.js
More file actions
47 lines (40 loc) · 1 KB
/
Copy pathLiteMapView.js
File metadata and controls
47 lines (40 loc) · 1 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
import React from 'react';
import { StyleSheet, Dimensions, ScrollView } from 'react-native';
import MapView from 'react-native-maps';
const { width, height } = Dimensions.get('window');
const ASPECT_RATIO = width / height;
const LATITUDE = 37.78825;
const LONGITUDE = -122.4324;
const LATITUDE_DELTA = 0.0922;
const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO;
const SAMPLE_REGION = {
latitude: LATITUDE,
longitude: LONGITUDE,
latitudeDelta: LATITUDE_DELTA,
longitudeDelta: LONGITUDE_DELTA,
};
class LiteMapView extends React.Component {
render() {
const maps = [];
for (let i = 0; i < 10; i++) {
maps.push(
<MapView
liteMode
key={`map_${i}`}
style={styles.map}
initialRegion={SAMPLE_REGION}
/>
);
}
return (
<ScrollView style={StyleSheet.absoluteFillObject}>{maps}</ScrollView>
);
}
}
const styles = StyleSheet.create({
map: {
height: 200,
marginVertical: 50,
},
});
export default LiteMapView;