react-native-amap-location
react-native-amap-location copied to clipboard
我想问一下控制台可以打印位置信息,但是没有显示地图,react-native-amap-location是不能显示地图只能获取位置信息吗?还是我哪里写的不对?
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;
对,只能获取位置信息哦