Closed treecon closed 7 years ago
forgot to say that if you sync both maps with each other, the problem seems to disappear.
This is expected behaviour. one way sync = one way, two way sync is two way. Use what you want :)
Hi jieter. Maybe I wasn't clear enough.
mapB is synced to mapA.
I only touch mapA, not mapB.
If I zoom mapA -> mapB is synced. If i drag mapA -> mapB is synced.
If i zoom mapA and then drag mapA -> mapB often loses synchronization. It is synced again when zooming in mapA but after dragging again mapA, mapB often loses synchronization again. I want to make clear again that I only touch mapA and not mabB. Please check fiddle again.
Thank you! :)
[I just said that if you use "two way sync", the bug seems to be fixed. However, you shouldn't have to use "two way sync" if you only touch one map]
Hi. If I am not wrong, I realized somehow this issue while I was developing my pull request (https://github.com/turban/Leaflet.Sync/pull/38) I thought it was an error on my code. Finally I fixed it changing the 'zoomend' a bit (applies the setView also to the originalMap, not only to the toSync maps). If you can, try with my branch. I don't know how to use it in jsfiddle. Cheers.
@jjimenezshaw do you mean you think you fixed this issue?
@jieter Yes. I think it is fixed in my branch. I copied the file from my branch into the jsfiddle (replacing the L.Map.Sync one), and I guess it works fine.
@treecon Could you check that? See pull/38
Now that pull 38 is merged, it is easy to include L.Map.Sync.js in a fiddle. I just replaced it in this one: https://jsfiddle.net/s4d9o4x8/
@treecon seems to be fixed now, I'm closing this. Please comment if it's not fixed in your experience.
Here is a simpe jsfiddle demo:
https://jsfiddle.net/91up4tje/
The second map is synced to the first map. However, if you zoom in/out and then drag the map, the second map will be "off". If not with the first try, it will happen for sure, if you try it some more times.