react-native-amap-location
Version:
Android amap location sdk for react native
26 lines (18 loc) • 522 B
JavaScript
import {NativeModules, DeviceEventEmitter} from 'react-native';
const AMapLocation = NativeModules.AMapLocation;
const onLocationChanged = 'onLocationChangedAMAPLOCATION';
export default class ALocation {
static startLocation(options) {
AMapLocation.startLocation(options);
}
static stopLocation() {
AMapLocation.stopLocation();
}
static addEventListener(handler) {
const listener = DeviceEventEmitter.addListener(
onLocationChanged,
handler,
);
return listener;
}
}