Skip to content

Instantly share code, notes, and snippets.

@jstart
Created March 15, 2024 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jstart/96222359cf84886fd49804aef4100c27 to your computer and use it in GitHub Desktop.
Save jstart/96222359cf84886fd49804aef4100c27 to your computer and use it in GitHub Desktop.
func testPlaceSearchByTextRequestGMPSRequestCreationWithProperties() {
let placeProperties: [GMSPlaceProperty] = [GMSPlacePropertyName, GMSPlacePropertyPlaceID];
let request = GMSPlaceSearchByTextRequest(textQuery:"pizza in New York" placeProperties:placeProperties)
request.isOpenNow = true
request.includedType = "restaurant"
request.maxResultCount = 5
request.minRating = 3.5
request.rankPreference = .distance
request.isStrictTypeFiltering = true
request.priceLevels = [GMSPlacesPriceLevel.moderate.rawValue, GMSPlacesPriceLevel.cheap.rawValue]
request.locationRestriction = GMSPlaceRectangularLocationOption(
CLLocationCoordinate2D(latitude: 20, longitude: 30),
CLLocationCoordinate2D(latitude: 40, longitude: 50)
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment