Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
Needs more info comment that > 10 days [ID: 963198]
Comment such as: SPAM, non-actionable [ID: 963127]
Resolved actionable follow-up comments [ID: 963027]
View issue level access limits(Press Alt + Right arrow for more information)
Issue affecting a 3rd party
View staffing
Description
let placesClient = GMSPlacesClient()
let searchBound = getCoordinateBounds(latitude: CLLocationDegrees(28.5383), longitude: CLLocationDegrees(81.3792), distance: 1.45)
let filter = GMSAutocompleteFilter()
filter.country = "USA"
placesClient.autocompleteQuery(text!, bounds: searchBound, filter: filter, callback: { (results, error) in
})
//My getCoordinateBounds method
func getCoordinateBounds(latitude:CLLocationDegrees ,
longitude:CLLocationDegrees,
distance:Double = 0.001)->GMSCoordinateBounds{
let center = CLLocationCoordinate2D(latitude: latitude,
longitude: longitude)
let northEast = CLLocationCoordinate2D(latitude: center.latitude + distance, longitude: center.longitude + distance)
let southWest = CLLocationCoordinate2D(latitude: center.latitude - distance, longitude: center.longitude - distance)
return GMSCoordinateBounds(coordinate: northEast,
coordinate: southWest)
}
Note: I want to filter addresses those are around 100 miles radius of this latitude and longitude (that why I have given degree to 1.45). Another thing I added country filer USA after I found that my bounds filter is not working properly. So far I am able to restrict address search to USA.