How to get coordinates from the Google Places API in ios Swift

I use Alamofire, and SwiftyJSONto automatically fill in Google Places. I integrated it well and well, like this:

enter image description here

Now I need to, if I select a place from the table view, it will be selected in the text box. But how can I get the corresponding latitude and longitude of this place, so that I can add an annotation of this place in MapKit

Is it possible to get details from Google Place APIand display them on apple MapKit? I got this doubt when I saw the Viking question

+5
source share
2 answers

GMSPlace. . .

, google Apple, .

, , , API Google Places iOS, Google maps.

+2

, , , , ,

// Handle the user selection 

public func viewController(viewController: GMSAutocompleteViewController, didAutocompleteWithPlace place: GMSPlace) {
    var lat = place.coordinate.latitude
    var lon = place.coordinate.longitude
    print("lat lon",lat,lon)

}
+8

Source: https://habr.com/ru/post/1623149/


All Articles