getLocation method
Future<AMapLocation?>
getLocation({
- AMapLocationOptionForIOS? optionForIOS,
- AMapLocationOptionForAndroid? optionForAndroid,
直接获取定位
Implementation
Future<AMapLocation?> getLocation(
{AMapLocationOptionForIOS? optionForIOS,
AMapLocationOptionForAndroid? optionForAndroid}) async {
if (!_supportPlatform || !_isInitialize) return null;
final Map<dynamic, dynamic>? map = await _channel.invokeMethod(
'getLocation', _optionToMap(optionForIOS, optionForAndroid));
if (map == null) return null;
return AMapLocation.mapToLocation(map);
}