You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
855 B
36 lines
855 B
import 'amap_flutter_platform_interface.dart';
|
|
|
|
class AmapFlutter {
|
|
// 初始化SDK
|
|
Future<void> initSdk({String? iosKey, String? androidKey}) async {
|
|
await AmapFlutterPlatform.instance.setApiKey(
|
|
iosKey: iosKey,
|
|
androidKey: androidKey,
|
|
);
|
|
}
|
|
|
|
// 定位初始化
|
|
Future<void> initLocation() async {
|
|
return AmapFlutterPlatform.instance.initLocation();
|
|
}
|
|
|
|
// 开始定位
|
|
Future<void> startLocation() async {
|
|
return AmapFlutterPlatform.instance.startLocation();
|
|
}
|
|
|
|
// 监听定位返回位置
|
|
Stream<dynamic> locationStream() {
|
|
return AmapFlutterPlatform.instance.locationStream();
|
|
}
|
|
|
|
// 停止定位
|
|
Future<void> stopLocation() async {
|
|
await AmapFlutterPlatform.instance.stopLocation();
|
|
}
|
|
|
|
// 销毁
|
|
Future<void> dispose() async {
|
|
await AmapFlutterPlatform.instance.dispose();
|
|
}
|
|
}
|
|
|