GMSPlace returns invalid coordinate (-180, -180), but name and place ID are correct GMSPlace returns invalid coordinate (-180, -180), but name and place ID are correct swift swift

GMSPlace returns invalid coordinate (-180, -180), but name and place ID are correct


I was facing the same issue and went through the Place SDK documentation which says clearly that we should define before hand to the GMSPlaceField of what details do we need exactly and if you had followed the doc completely, it would be resulting only in the name and placeId being populated. So while instantiating your GMSAutoCompleteViewController define in the following way.

**let fields: GMSPlaceField = GMSPlaceField(rawValue:UInt(GMSPlaceField.name.rawValue) |            UInt(GMSPlaceField.placeID.rawValue) |            UInt(GMSPlaceField.coordinate.rawValue) |            GMSPlaceField.addressComponents.rawValue |            GMSPlaceField.formattedAddress.rawValue)!autocompleteController.placeFields = fields**