-1

When getting results from Mapbox API for the reverse geocoding results, I get only one specific result returned. Is there a way to increase the results returned, say for a larger radius around the reverse geocoded point? If a user clicks on a map, I'd like to give them options to choose from several places/addresses that are close to where they clicked, in case the spot they touched on the map isn't exactly correct.

Wayne Johnson
  • 214
  • 3
  • 18

1 Answers1

0

Is there a way to increase the results returned, say for a larger radius around the reverse geocoded point?

Yes. According to Mapbox's Reverse Geocoding API, you can try changing the limit, type and reverseMode parameters. You can play around with that in the API Playground.

You can't directly control the radius, and the max limit is 5, but take a hard look at type: since you're concerned with "misclicks", but your application doesn't need the location down to address, but maybe just down to "neighborhood", or "postcode" level, if you set type appropriately you may not need to worry about the exact click location too much. So, basically, setting type as a higher-level locality type and increasing limit, you're effectively increasing the radius.

I don't think however Mapbox has an official Flutter SDK, so you might have to talk with the APIs yourself, though.

Rafael Almeida
  • 10,352
  • 6
  • 45
  • 60
  • Yea, the issue I'm having is that you can only return a single item if you combine a type, say like an address or a place or POI. I was able to make it work by creating two queries with a limit of 5 each, one for addresses and one for POIs. It's a workaround, but I think it will do the trick. Thanks for your answer! – Wayne Johnson Jun 25 '20 at 05:18