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

popup [lngLat] binding removes and adds marker causing close events to fire unnecessarily #48

Closed
antonsimola opened this issue Jul 12, 2018 · 2 comments

Comments

@antonsimola
Copy link

Hi, first of all thanks for great library!

I noticed that I get some unwanted events fired for the popup (close) event. I believe that is because you are removing and adding the popup again to the map with the updated lnglat value. Could it be possible to use the underlying popup's setLngLat function instead? this should also update the map without firing the close events, I believe.

On a second note, have you considered adding mapbox gl draw library bindings? I might be able to help with that as well as I'm doing something with the draw library right now.

@Wykks
Copy link
Owner

Wykks commented Jul 13, 2018

Hi!

I was using setLngLat before but I changed this to be easier to use (1ca82c1).
I'll think about a better way. One solution is to not send close event in this situation.

About mapbox-gl draw, yep, but I need more time/motivation 😅

@antonsimola
Copy link
Author

Oh I see. I try to test on Monday if reverting to the version before that commit fixes the issue for me. I'm on 1.2. I think your idea seems great, filter out close event in ngOnChanges should do the trick, that way you can continue using remove/add technique.

@Wykks Wykks closed this as completed in 2b6f712 Aug 4, 2018
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