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
moveend on LMap fires too much in certain case #191
Comments
Playing around Leaflet and Vue, I have noticed that Leaflet doesn't go exactly where you ask, lat lng are rounded http://stage.vdcrea.com/leaflet/roundcenter.mp4 This is know bug (or feature) Leaflet/Leaflet#922 (comment) Leaflet/Leaflet#426 The center is setted using L.Map.getCenter() witch is not the same as the center from the prop. The prop center is watched by utils props binder and the following method is triggered https://github.com/KoRiGaN/Vue2Leaflet/blob/master/src/components/LMap.vue#L184 My guess is that the diff between the asked coordinates and the leaflet ones creates the infinite loop. My two cents |
I have the exactly the same problem, where I need to switch from one city to another, and the slight changed centre makes the map be completely off :( |
@pixelizedPeanut Could you try to use the next branch as specified in this comment: |
Version 1.1.1 is out on npm and should fix this issue @pixelizedPeanut could you test and see if ti resolve your issue ? |
Closing due to inactivity |
Take this little snippet:
If you're moving the map,
moveend
fires once (each time) as expected.Now, use
data
from<template>
, eg:If you're moving the map now,
moveend
fires many times.Find out that if you set center from
data
, it no longer happens. Eg:Live demo: http://jsfiddle.net/zmp5n2L0/7/ (be careful, moving the map can freeze browser)
The text was updated successfully, but these errors were encountered: