Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for a promise based externalGeocoder #385

Merged
merged 8 commits into from
Aug 17, 2020

Conversation

mapbox-danny
Copy link
Contributor

@mapbox-danny mapbox-danny commented Jul 30, 2020

Proposal to add an option for an externalGeocoder, designed to accept a promise resolving to an array of features. This Update would allow a server-side api/resource to be called asynchronously.

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • run npm run docs and commit changes to API.md
  • update CHANGELOG.md with changes under master heading before merging

@andrewharvey
Copy link
Collaborator

hi @mapbox-danny did you see #165 (comment) where we discussed leaving localGeocoder as is and creating an additional externalGeocoder which supports a promise. The idea being localGeocoder then works with local sources you already have loaded, and externalGeocoder where you have an external API to use.

lib/index.js Outdated Show resolved Hide resolved
lib/index.js Outdated Show resolved Hide resolved
@mapbox-danny
Copy link
Contributor Author

@andrewharvey, your feedback to use externalGeocoder to add support for promises makes a lot of sense. I have updated the proposed approach to keep localGeocoder effectively unchanged and to add in the option for the externalGeocoder.

@mapbox-danny mapbox-danny changed the title Enable localGeocoder to accept a Promise Add option for a promise based externalGeocoder Jul 31, 2020
@andrewharvey
Copy link
Collaborator

Oh wow you even managed to fix the broken unit tests unrelated to this feature. Thanks!

I haven't done a deep look at all the changes, but overall it looks good.

@mapbox-danny
Copy link
Contributor Author

Oh wow you even managed to fix the broken unit tests unrelated to this feature. Thanks!

I haven't done a deep look at all the changes, but overall it looks good.

Thanks @andrewharvey. Let me know what you think about getting it ready to merge when you have a chance.

Copy link
Collaborator

@andrewharvey andrewharvey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me thanks. I haven't done detailed testing, but happy with the testing you've done.

@tristen tristen mentioned this pull request Aug 15, 2020
8 tasks
@mapbox-danny mapbox-danny merged commit 9d084c9 into master Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants