Amap location for React Native

ref

​https://github.com/xiaobuu/react-native-amap-location​

code

import React from 'react';
import {
View,
Text
} from 'react-native';
import AMapLocation from 'react-native-amap-location';
export default class App extends React.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>
<Text>amap</Text>
</View>
);
}
}

step


update 2016-08-25
last update 2016-08-26