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

marker isn't reactive after updating vue2-leaflet #274

Closed
jkatagi opened this issue Nov 6, 2018 · 11 comments
Closed

marker isn't reactive after updating vue2-leaflet #274

jkatagi opened this issue Nov 6, 2018 · 11 comments

Comments

@jkatagi
Copy link

jkatagi commented Nov 6, 2018

Description

I updated vue2-leaflet from v1.0.2 to v1.1.1 but after updating, marker isn't reactive.

I manage the marker's latlng in stores to update it from other components (e.x. from Exif information of pictures), so the code is a little complicated.

Could you tell me what happened? thanks.

Live Demo

Steps to Reproduce

See jsfiddle.

Expected Results

  • update latlng when dragging the marker.

Actual Results

  • doesn't update latlng when dragging the marker.

Browsers Affected

  • [x ] Firefox

Versions

  • Leaflet: v1.0.3
  • Vue: v2.5.16
  • Vue2Leaflet: v1.1.1
@jkatagi
Copy link
Author

jkatagi commented Nov 6, 2018

Oh, I found that this is also happened without using Vuex store.

@jkatagi jkatagi changed the title 2-way draggable marker doesn't work after updating vue2-leaflet marker isn't reactie after updating vue2-leaflet Nov 6, 2018
@jkatagi jkatagi changed the title marker isn't reactie after updating vue2-leaflet marker isn't reactive after updating vue2-leaflet Nov 6, 2018
@DonNicoJs
Copy link
Member

@jkatagi thank you for the issue, I will take a look!

@DonNicoJs
Copy link
Member

@jkatagi I see, before it was working due to the object being passed by reference.
There is a specific event and we need to listen to it, we will work on it soon :)

@DonNicoJs
Copy link
Member

@jkatagi I am about to release a new version that includes a fix for this issue.
To avoid side effects you will need to add .sync modifier to lat-lng on the marker.
you can see the example 'some examples' to see it in action

@jkatagi
Copy link
Author

jkatagi commented Nov 8, 2018

@lordfuoco Thank you very much for you help! I'm waiting your release!

@alexbainbridge
Copy link

Are we sure this is fixed? If you drag a marker now, the newly introduced 100 debounce seems reasonable, but there isn't an update to the last set position, so when you drop a marker, the lat-lng is not the final position it visually LOOKS like it is at.
I have had to go back to 1.0.2 while I investigate further....

@DonNicoJs
Copy link
Member

@alexbainbridge yes it should be fixed as I see the events emitted on the vue panel, are you using .sync modifier ? Before there were side effects that are not nice

@alexbainbridge
Copy link

@lordfuoco Hi !
Yeah - using sync - it is changing, but not to the last dragged position. i.e. I drag a marker and the lat lng is set to a point during the drag rather than final position.

Its the debounce that is the problem
alexbainbridge@260a929
I removed it and the last updated position is OK.

Thinking outloud - would throttle work (rather than debounce?). Or could you leave throttling / debouncing to the parent code?

@DonNicoJs
Copy link
Member

@alexbainbridge Oh so is an error of the debounce function that I wrote, because it should be sent out with the latest value and not others!
The debounce is needed because leaflet has a different precision and may trigger infinite loops, I will try to fix the error in the debounce fn!

Thanks for the headsup

@alexbainbridge
Copy link

Sounds like you have this - but do you want me to open an issue? Or you reopen this one?

Thanks!

@DonNicoJs
Copy link
Member

@alexbainbridge we are not issue shy! Go on open it please, because I am swamped and I could forget if there is not an issue open :) thank you very much.

For the future, just go on and open an issue if you think there is a bug / mismatch / misalignment.

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

3 participants