text: import React from 'react';
  import {
    Linking,
    MapView,
    Platform,
    StyleSheet,
    TouchableOpacity,
  } from 'react-native';
  
  export default class CustomView extends React.Component {
    render() {
      if (this.props.currentMessage.location) {
        return (
          <TouchableOpacity style={[styles.container, this.props.containerStyle]} onPress={() => {
            const url = Platform.select({
              ios: `http://maps.apple.com/?ll=${this.props.currentMessage.location.latitude},${this.props.currentMessage.location.longitude}`,
              android: `http://maps.google.com/?q=${this.props.currentMessage.location.latitude},${this.props.currentMessage.location.longitude}`
            });
            Linking.canOpenURL(url).then(supported => {
              if (supported) {
                return Linking.openURL(url);
              }
            }).catch(err => {
              console.error('An error occurred', err);
            });
          }}>
            <MapView
              style={[styles.mapView, this.props.mapViewStyle]}
              region={{
                latitude: this.props.currentMessage.location.latitude,
                longitude: this.props.currentMessage.location.longitude,
              }}
              annotations={[{
                latitude: this.props.currentMessage.location.latitude,
                longitude: this.props.currentMessage.location.longitude,
              }]}
              scrollEnabled={false}
              zoomEnabled={false}
            />
          </TouchableOpacity>
        );
      }
      return null;
    }
  }
  
  const styles = StyleSheet.create({
    container: {
    },
    mapView: {
      width: 150,
      height: 100,
      borderRadius: 13,
      margin: 3,
    },
  });
  
  CustomView.defaultProps = {
    containerStyle: {},
    mapViewStyle: {},
    currentMessage: {},
  };
  
  CustomView.propTypes = {
    containerStyle: React.PropTypes.object,
    mapViewStyle: React.PropTypes.object,
    currentMessage: React.PropTypes.object,
  };
  