Abhi Asked: 2023-10-29 21:39:20 +0800 CST2023-10-29 21:39:20 +0800 CST 2023-10-29 21:39:20 +0800 CST 毛伊岛地图 - 如何从位置获取地址、城市和国家/地区名称? 772 正如我们在谷歌地图中看到的,我们如何使用Microsoft MAUI 地图从给定的纬度和经度 获取城市名称、地址、道路名称/街道名称等?(微软.毛伊岛.控制.地图) maui 1 个回答 Voted Best Answer Jason 2023-10-29T21:42:12+08:002023-10-29T21:42:12+08:00 这称为反向地理编码 IEnumerable<Placemark> placemarks = await Geocoding.Default.GetPlacemarksAsync(latitude, longitude); Placemark placemark = placemarks?.FirstOrDefault(); if (placemark != null) { return $"AdminArea: {placemark.AdminArea}\n" + $"CountryCode: {placemark.CountryCode}\n" + $"CountryName: {placemark.CountryName}\n" + $"FeatureName: {placemark.FeatureName}\n" + $"Locality: {placemark.Locality}\n" + $"PostalCode: {placemark.PostalCode}\n" + $"SubAdminArea: {placemark.SubAdminArea}\n" + $"SubLocality: {placemark.SubLocality}\n" + $"SubThoroughfare: {placemark.SubThoroughfare}\n" + $"Thoroughfare: {placemark.Thoroughfare}\n"; }
这称为反向地理编码