I am using Mapbox Geocoder for searching places in our app. But, I also need to get all the nearby places like restaurants, hotels etc. Is it possible with Mapbox Geocoder?
This is the code we are using for forward geocode,
let region = RectangularRegion(southWest: CLLocationCoordinate2DMake(swlat, swlng), northEast: CLLocationCoordinate2DMake(nelat, nelng))
let options = ForwardGeocodeOptions(query: input)
options.allowedRegion = region --> To restrict search
I can do this with Google autocomplete,
But, I can't use both Mapbox and Google.
The Geocoding API supports "category" search, although it's still marked as experimental. The documentation includes a list of the currently supported categories: https://docs.mapbox.com/api/search/#point-of-interest-category-coverage.
You can either build your own implementation to query the geocoding endpoint directly, or use the Open Source MapboxGeocoder.swift which acts as a native wrapper for the API.
⚠️ Disclaimer: I currently work at Mapbox ⚠️