Open anthony-toezin opened 6 years ago
That's right, the localGeocoder
option was added to the mapbox-gl-geocoder plugin in https://github.com/mapbox/mapbox-gl-geocoder/pull/136. mapbox-gl-directions does not depend on mapbox-gl-geocoder, so that change would need to be ported to this project. We would happily consider a PR that does as much. Updating the title to reflect scope.
Alrite thanks for that clarification. I recommend an update to the documentation for the directions API to clarify that. Under the parameters it references the geocoder options as options that can be passed to the directions API.
options.geocoder Object? Pass options available to mapbox-gl-geocoder as documented here.
https://github.com/mapbox/mapbox-gl-directions/blob/master/API.md
I'm working on porting localGeocoder support.
PR #219 submitted.
I have updated PR #219 to bring it up-to-date with master. We're using this in production and it's working well, so would love to see it merged.
It looks like the directions control is not recognizing the localGeocoder option from the mapbox-gl-geocoder. The map renders fine, but it doesn't respond to any local data passed to it.
map.addControl(new MapboxDirections({ accessToken: mapboxgl.accessToken, geocoder: {localGeocoder: coordinatesGeocoder} }), 'top-left');