Reputation: 1
I have a problem with googlePlace, I don't know how to solve this, thanks for those who will answer
use of unresolved 'GMSPlaceRectangularLocationOption'
let filter = GMSAutocompleteFilter() filter.locationRestriction = GMSPlaceRectangularLocationOption(neBoundsCorner, swBoundsCorner)
Upvotes: 0
Views: 853
Reputation: 757
This is not available in latest SDK. But available via GMSAutocompleteFetcher. Set Bounds you want to restrict then set auto autocompleteBoundsMode
fetcher = GMSAutocompleteFetcher(bounds: mapBounds, filter: filter)
fetcher?.autocompleteBoundsMode = .restrict // or .bias
Update (on 23rd Nov 2020) It seems this has further changed with new SDK. Now "locationBias" is property of GMSAutocompleteFilter. Bounds also moved to GMSAutocompleteFilter from GMSAutocompleteFetcher.
var filter = GMSAutocompleteFilter()
let b = GMSCoordinateBounds(location: location.coordinate, radiusMeters: 100)
filter.origin = location
filter.locationBias = GMSPlaceRectangularLocationOption(b.northEast, b.southWest);
fetcher = GMSAutocompleteFetcher(filter: filter)
Upvotes: 2