我想使用地圖但不想google maps獲取我的位置坐標并將資料用于某種目的,是否有任何與谷歌地圖相同的包?出于某種原因,我不能使用谷歌地圖 bcs 這不是我自己的專案
uj5u.com熱心網友回復:
完成apple_maps_flutter是為了簡化將 google_maps_flutter 插件與 apple_maps_flutter 結合起來為 Android/iOS 創建名為 flutter_platform_maps 的跨平臺實作的程序。
apple_maps_flutter: ^1.1.0
或者您可以使用將回傳用戶坐標的地理定位器
import 'package:geolocator/geolocator.dart';
Future<Position> _determinePosition() async {
bool serviceEnabled;
LocationPermission permission;
serviceEnabled = await Geolocator.isLocationServiceEnabled();
if (!serviceEnabled) {
return Future.error('Location services are disabled.');
}
permission = await Geolocator.checkPermission();
if (permission == LocationPermission.denied) {
permission = await Geolocator.requestPermission();
if (permission == LocationPermission.denied) {
return Future.error('Location permissions are denied');
}
}
if (permission == LocationPermission.deniedForever) {
return Future.error(
'Location permissions are permanently denied, we cannot request
permissions.');
}
return await Geolocator.getCurrentPosition();
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/429740.html
