如何从纬度和经度获取区域名称(Xamarin.Form c#)?

时间:2018-02-19 19:20:11

标签: c# android xaml button xamarin.forms

            `var locator = CrossGeolocator.Current;
            locator.DesiredAccuracy = 50;
            ActInd.IsRunning = true;
            Submit.IsEnabled = false;
            var position = await 
            locator.GetPositionAsync(TimeSpan.FromSeconds(20), null, true);

            var geoposition = new Xamarin.Forms.Maps.Position(position.Latitude,position.Longitude);
            var possibleAddresses = await geoCoder.GetAddressesForPositionAsync(geoposition);

            string finaladdress = "";
            foreach (var address in possibleAddresses)

                finaladdress = address.ElementAt(0).getlocality(); //Notrecognising getlocality();

` 无法实现getlocality函数来获取城市或地区名称

0 个答案:

没有答案