Open weifageo opened 5 years ago
@weifageo
Bump.
Temporary Workaround w/ React
node_modules/@mapbox/mapbox-gl-directions/dist/*.js
xx = ISO 3166-1 alpha-2 comma separated string of countries for the geocoder to include.
Replace line 6674 to read:
this.request.open('GET', this.api + encodeURIComponent(q.trim()) + '.json?' + options.join('&') + '&country=xx', true);
Put xx as your ISO countries
According to the mapbox-gl-geocoder API.mb document there is an option called countries for filtering the suggested search results.
options.countries string? a comma separated list of country codes to limit results to specified country or countries.
I saw on another ticket that mapbox-gl-directions does not depend on the mapbox-gl-geocoder. I was wondering if this feature enhancement could be ported over to mapbox-gl-directions to help limit to search suggestions to a single country or list of countries in a similar fashion?
Thanks!