The Google Maps API SDK API does not have its own path. As mentioned in other answers, this has been a requested feature for many years .
Keep in mind that the Google Maps API is mainly focused on creating maps: this is the main goal.
You should use APIs or some other services. For example, another service called SmartyStreets has an iOS SDK that has built-in support for advanced geocoding. Here's a sample code for Swift from their iOS SDK documentation page :
// Swift: Sending a Single Lookup to the US ZIP Code API package examples; import Foundation import SmartystreetsSDK class ZipCodeSingleLookupExample { func run() -> String { let mobile = SSSharedCredentials(id: "SMARTY WEBSITE KEY HERE", hostname: "HOST HERE") let client = SSZipCodeClientBuilder(signer: mobile).build() // Uncomment the following line to use Static Credentials // let client = SSZipCodeClientBuilder(authId: "YOUR AUTH-ID HERE", authToken: "YOUR AUTH-TOKEN HERE").build() let lookup = SSZipCodeLookup() lookup.city = "Mountain View" lookup.state = "California" do { try client?.send(lookup) } catch let error as NSError { print(String(format: "Domain: %@", error.domain)) print(String(format: "Error Code: %i", error.code)) print(String(format: "Description: %@", error.localizedDescription)) return "Error sending request" } let result: SSResult = lookup.result let zipCodes = result.zipCodes let cities = result.cities var output: String = String() if (cities == nil && zipCodes == nil) { output += "Error getting cities and zip codes." return output } for city in cities! { output += "\nCity: " + (city as! SSCity).city output += "\nState: " + (city as! SSCity).state output += "\nMailable City: " + ((city as! SSCity).mailableCity ? "YES" : "NO") + "\n" } for zip in zipCodes! { output += "\nZIP Code: " + (zip as! SSZipCode).zipCode output += "\nLatitude: " + String(format:"%f", (zip as! SSZipCode).latitude) output += "\nLongitude: " + String(format:"%f", (zip as! SSZipCode).longitude) + "\n" } return output } }
Full disclosure: I worked at SmartyStreets.
source share