Open subhyde opened 3 years ago
You can set the proximity that the Geocoder uses for search to a specific point like this:
var directions = new MapboxDirections({
accessToken: mapboxgl.accessToken,
profile: 'mapbox/cycling',
alternatives: true,
controls: {
profileSwitcher: false
},
geocoder: {
proximity: [-73.987865,40.748297] //Change this line to a longitude/latitude coordinate that the Geocoder will try to find results near.
}
When entering an address. The autocomplete recommendation should be targeted around the map's current position.
If I am in new york and I'm searching for a street in new york. the same street name in brazil should not be the first recommendation for an autocompleted field.
Is there a work around for this?