mapbox / mapbox-sdk-js

A JavaScript client to Mapbox services, supporting Node, browsers, and React Native
Other
709 stars 185 forks source link

forwardGeocode API improvement on countries #472

Closed umrzoq-toshkentov closed 1 year ago

umrzoq-toshkentov commented 1 year ago

I have a case in country property I have set like that.

{
  ....
  country: ['US', 'CA']
}

while I am doing autocomplete searching 456 broadway, It is returning Canadian states only. Is there any clue to make reorder and prioritise country. For example I want prioritise US state at first

andrewharvey commented 1 year ago

Given the Geocoding API doesn't support this I don't see much the SDK can do.

You could try to set the proximity parameter or make two requests one for US one for CA and do the sorting client side.