mirror of
https://github.com/expo/react-native-maps.git
synced 2026-11-15 09:18:08 -10:00
* move eslitnt rules to @react-native-community/eslint-config * gitignore VSCode workspace settings * update eslint related packages and remove airbnb ones * add .prettierrc config * automated fix by eslint and prettier * remove custom eslint rules * remove never reported elint exceptions * remove unlimited eslint-disable exceptions * fix formating * fix inline styles * fix react to 16.8.3 and remove babel-preset-react-native
48 lines
1.0 KiB
JavaScript
48 lines
1.0 KiB
JavaScript
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;
|