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.
41 lines
851 B
41 lines
851 B
import 'package:amap_service/amap_service.dart';
|
|
import '../../core/utils/logger.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
//导航管理
|
|
class NavigationManager extends GetxService {
|
|
static NavigationManager get to => Get.find<NavigationManager>();
|
|
|
|
// 导航服务实例
|
|
final AmapService _amapervice = AmapService();
|
|
|
|
/// 初始化
|
|
@override
|
|
void onInit() {
|
|
super.onInit();
|
|
Logger.info('导航服务初始化');
|
|
}
|
|
|
|
/// 释放资源
|
|
@override
|
|
void onClose() {
|
|
super.onClose();
|
|
}
|
|
|
|
Stream<AmapServiceEvent> events() {
|
|
return _amapervice.events;
|
|
}
|
|
|
|
//导航
|
|
Future<void> start(String org, String dis) async {
|
|
// await _amapervice.navigation(org, dis);
|
|
}
|
|
//导航
|
|
Future<void> open(
|
|
String start,
|
|
String end,
|
|
String ntype,
|
|
) async {
|
|
await _amapervice.open(start, end, ntype);
|
|
}
|
|
}
|
|
|