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

multiple local geocoder search results broken #281

Closed
andrewharvey opened this issue Jun 14, 2019 · 3 comments
Closed

multiple local geocoder search results broken #281

andrewharvey opened this issue Jun 14, 2019 · 3 comments
Labels

Comments

@andrewharvey
Copy link
Collaborator

As reported at https://stackoverflow.com/questions/56579673/why-does-supplemental-mapbox-geocoder-allow-for-only-one-search in the example at https://docs.mapbox.com/mapbox-gl-js/example/forward-geocode-custom-data/ if you:

  1. Search and select Lincoln Park
  2. Search and select Burnham Park.

Upon 2, it doesn't actually move to Burnham park, which it should.

@andrewharvey
Copy link
Collaborator Author

It looks like the issue could be around

if (selected && selected.id !== this.lastSelected) {

since localGeocoder sources may not have an id per feature set, we could either disable that where no id exists, or generate our own internal ids.

@scottsfarley93
Copy link

This looks to be the same as #278. It seems that the result event is not being emitted on subsequent selections from the local geocoder.

@andrewharvey good point about the potential lack of IDs from the localGeocoder. As you point out, I could see how the lack of IDs could cause no result event to be generated.

@scottsfarley93
Copy link

This was fixed in #298 and will be included in the upcoming v4.5.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants