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

Does geocoder.on("result", ...) fire twice for each request #7688

Closed
loganpowell opened this issue Dec 12, 2018 · 1 comment
Closed

Does geocoder.on("result", ...) fire twice for each request #7688

loganpowell opened this issue Dec 12, 2018 · 1 comment

Comments

@loganpowell
Copy link

loganpowell commented Dec 12, 2018

mapbox-gl-js version:0.52.0-beta.1

Question

I'm trying to fire a function off that loads a new layer after geocoder.on("result", getSomeData())

If you take a look at this example (open console):

https://loganpowell.github.io/census-js-examples/examples/with-mapbox-gl_geocoding/index.html

(type in any place in the USA, then - after a result you'll see a choropleth - then click anywhere and the event seems to be triggered again)

and the line in question:

https://github.com/loganpowell/census-js-examples/blob/master/examples/with-mapbox-gl_geocoding/src/index.js#L116

Links to related documentation

I figured this was possible by looking at this example:

https://www.mapbox.com/mapbox-gl-js/example/point-from-geocoder-result/

@andrewharvey
Copy link
Collaborator

@loganpowell This is an issue in the mapbox-gl-geocoder plugin, which is being tracked at mapbox/mapbox-gl-geocoder#99 which is in turn an upstream issue tracked in tristen/suggestions#13. You're welcome to help resolve the issue. I wasn't able to work out how to do this without breaking IE11 support.

I'll close this issue here to keep the discussion over on those other tickets.

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

No branches or pull requests

2 participants