cn_locate

Creator: coderz1093

Last updated:

0 purchases

cn_locate Image
cn_locate Images

Languages

Categories

Add to Cart

Description:

cn locate

cn_locate #
封装的原生flutter高德定位组件.
用法 #
import 'package:cn_locate/cn_locate.dart';
...
initLocation() async {
// if (await Permission.location.serviceStatus.isEnabled) {
// var options = AMapOptions(
// locationMode: LocationMode.hightAccuracy, isNeedAddress: true);
// CnLocate.init(
// options: options,
// callBack: (result) {
// print("------sdk初始化${result.message}");
// });
// } else {
if (await Permission.locationWhenInUse.request().isGranted) {
if (await Permission.locationAlways.request().isGranted) {
var options = AMapOptions(
locationMode: LocationMode.hightAccuracy,
isNeedAddress: true,
interval: 10000,
isGpsFirst: true,
isMockEnable: true,
isOnceLocation: false,
apiKey: "0f5ae242daaa662569c2806f426b7020");
CnLocate.init(
options: options,
callBack: (result) {
print("------sdk初始化${result.message}");
});
CnLocate.onLocationChange.listen((event) {
print(event);//返回定位成功后的坐标
});
} else {
openAppSettings();
}
}
//}
}
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.