Files
react-native-gifted-chat/example-expo/CustomView.js
Xavier Carpentier c143b5f0fe Modified for flatlist (from #629) (#705)
Modified for FlatList
2018-05-30 16:37:00 +02:00

43 lines
1.1 KiB
JavaScript

/* eslint-disable */
import React from 'react';
import { View, StyleSheet } from 'react-native';
import MapView, { PROVIDER_GOOGLE } from 'react-native-maps';
const styles = StyleSheet.create({
mapView: {
width: 150,
height: 100,
borderRadius: 13,
margin: 3,
},
});
export default function CustomView(props) {
if (props.currentMessage.location) {
return (
<View style={props.containerStyle}>
<MapView
provider={PROVIDER_GOOGLE}
style={[styles.mapView]}
region={{
latitude: props.currentMessage.location.latitude,
longitude: props.currentMessage.location.longitude,
latitudeDelta: 0.1,
longitudeDelta: 0.1,
}}
scrollEnabled={false}
zoomEnabled={false}
>
<MapView.Marker
coordinate={{
latitude: props.currentMessage.location.latitude,
longitude: props.currentMessage.location.longitude,
}}
/>
</MapView>
</View>
);
}
return null;
}