reverse-geocoding

Get location name from Latitude & Longitude in iOS

醉酒当歌 提交于 2019-11-26 08:11:18
问题 I want to find current location name from latitude and longitude, Here is my code snippet I tried but my log shows null value in all the places except in placemark , placemark.ISOcountryCode and placemark.country I want value of placemark.locality and placemark.subLocality but it is showing null values. - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; // this creates the CCLocationManager that will find your current location locationManager = [[CLLocationManager alloc]

How to get city name from latitude and longitude coordinates in Google Maps?

╄→гoц情女王★ 提交于 2019-11-26 04:33:17
问题 How might I obtain the city name in Google Maps if I have latitude and longitude coordinates of a town or area? I tried using the latitude, longitude and I got country but I don\'t know how to get city name. 回答1: From a Geocoder object, you can call the getFromLocation(double, double, int) method. It will return a list of Address objects that have a method getLocality(). Geocoder gcd = new Geocoder(context, Locale.getDefault()); List<Address> addresses = gcd.getFromLocation(lat, lng, 1); if

Android: Reverse geocoding - getFromLocation

时光总嘲笑我的痴心妄想 提交于 2019-11-26 00:47:49
问题 I am trying to get an address based on the long/lat. it appears that something like this should work? Geocoder myLocation = Geocoder(Locale.getDefault()); List myList = myLocation.getFromLocation(latPoint,lngPoint,1); The issue is that I keep getting : The method Geocoder(Locale) is undefined for the type savemaplocation Any assistance would be helpful. Thank you. Thanks, I tried the context, locale one first, and that failed and was looking at some of the other constructors (I had seen one