mapbox / mapbox-gl-directions

Directions plugin for mapbox-gl-js using Mapbox Directions API.
https://mapbox.com/mapbox-gl-js/example/mapbox-gl-directions/
ISC License
239 stars 129 forks source link

Port localGeocoder option from mapbox-gl-geocoder #166

Open anthony-toezin opened 6 years ago

anthony-toezin commented 6 years ago

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');

lbud commented 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.

anthony-toezin commented 6 years ago

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

morgant commented 5 years ago

I'm working on porting localGeocoder support.

morgant commented 5 years ago

PR #219 submitted.

morgant commented 3 years ago

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.