Open zhulichao opened 7 years ago
import React, { Component } from 'react'; import { View, Text, TouchableHighlight, StyleSheet, InteractionManager } from 'react-native'; import AMapLocation from 'react-native-amap-location'; class Amap extends Component { componentDidMount() { this.listener = AMapLocation.addEventListener((data) => console.log('data', data)); AMapLocation.startLocation({ accuracy: 'HighAccuracy', killProcess: true, needDetail: true, }); } componentWillUnmount() { AMapLocation.stopLocation(); this.listener.remove(); } render() { return ( <View style={{flexDirection: 'row', alignItems: 'center'}}></View> ); } } export default Amap;
对,只能获取位置信息哦