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
54 lines
1.1 KiB
JavaScript
54 lines
1.1 KiB
JavaScript
import PropTypes from 'prop-types';
|
|
import React from 'react';
|
|
import { StyleSheet, ViewPropTypes, View } from 'react-native';
|
|
import decorateMapComponent, {
|
|
SUPPORTED,
|
|
USES_DEFAULT_IMPLEMENTATION,
|
|
} from './decorateMapComponent';
|
|
|
|
// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
|
|
const viewPropTypes = ViewPropTypes || View.propTypes;
|
|
|
|
const propTypes = {
|
|
...viewPropTypes,
|
|
tooltip: PropTypes.bool,
|
|
onPress: PropTypes.func,
|
|
alphaHitTest: PropTypes.bool,
|
|
};
|
|
|
|
const defaultProps = {
|
|
tooltip: false,
|
|
alphaHitTest: false,
|
|
};
|
|
|
|
class MapCallout extends React.Component {
|
|
render() {
|
|
const AIRMapCallout = this.getAirComponent();
|
|
return (
|
|
<AIRMapCallout
|
|
{...this.props}
|
|
style={[styles.callout, this.props.style]}
|
|
/>
|
|
);
|
|
}
|
|
}
|
|
|
|
MapCallout.propTypes = propTypes;
|
|
MapCallout.defaultProps = defaultProps;
|
|
|
|
const styles = StyleSheet.create({
|
|
callout: {
|
|
position: 'absolute',
|
|
},
|
|
});
|
|
|
|
export default decorateMapComponent(MapCallout, {
|
|
componentType: 'Callout',
|
|
providers: {
|
|
google: {
|
|
ios: SUPPORTED,
|
|
android: USES_DEFAULT_IMPLEMENTATION,
|
|
},
|
|
},
|
|
});
|