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

Dragged marker gets clustered when dragging&zooming above a cluster #808

Open
jessenic opened this issue Jul 17, 2017 · 7 comments
Open

Comments

@jessenic
Copy link

jessenic commented Jul 17, 2017

How to reproduce

  • Leaflet version I'm using: 1.1.0
  • Leaflet.MarkerCluster version I'm using: 1.0.6
  • Browser (with version) I'm using: Chrome 59 + Edge 40
  • OS/Platform (with version) I'm using: Windows 10 Creators Update
  • Open a map with clustered draggable markers
  • Start dragging a marker above a cluster, zoom in. The cluster will eat the marker and map gets stuck.

What behaviour I'm expecting and which behaviour I'm seeing

I'm expecting markers to be able to dragged and map to be zoomed. Dragged markers should not get clustered. But what seems to be happening is that the cluster will eat the marker if the marker is being dragged above it while zooming.

Minimal example reproducing the issue

For example this is taken from #685: https://jsfiddle.net/3v7hd2vx/245/
In this one the map doesn't get stuck, but the cluster is eating the marker which I believe causes the map getting stuck for me. (My map also got stuck if I removed a marker while it was being dragged)

After updating the fiddle to Leaflet 1.1.0, the map gets stuck like mine: https://jsfiddle.net/3v7hd2vx/343/

  • [ x ] this example is as simple as possible
  • [ x ] this example does not rely on any third party code
@jessenic
Copy link
Author

Also reported to Leaflet: Leaflet/Leaflet#5638

Map getting stuck seems to be issue of theirs, but still a dragged marker should not get grouped while zooming in.

@jessenic jessenic changed the title Dragging gets stuck when zooming while dragging a marker over a cluster Dragged marker gets clustered when dragging&zooming above a cluster Jul 17, 2017
@danzel
Copy link
Member

danzel commented Jul 18, 2017

hahaha, nice find.
Hopefully when the lockup is fixed in leaflet it should fix it here?

@jessenic
Copy link
Author

jessenic commented Jul 18, 2017

Haha yeah, the lockup is a Leaflet issue that seems to have been introduced in 1.1.0. But the issue here is that a marker that is being dragged will get clustered if you are dragging it above a cluster and zoom in/out.

For example: Zoom fully in, start dragging a marker, then using the mouse wheel zoom out (and in again) while keeping the marker above a cluster: https://jsfiddle.net/3v7hd2vx/245/

In my application there are hundreds to thousands of markers on the map, user should be able to zoom in, pick a marker, then zoom out and move it somewhere else on the map. Would be also nice to be able to prevent that dragged marker getting clustered even after the drag until the user has confirmed the new location.

@DerGuteWolf
Copy link
Contributor

Perhaps my PR #909 will also solve this problem, @jessenic can you test at https://jsfiddle.net/thy3c540/1/ ?

@danzel
Copy link
Member

danzel commented Sep 13, 2018

This is improved now, but if the marker would get clustered at the zoom level you zoom out to it still gets merged (I think)

@DerGuteWolf
Copy link
Contributor

Zooming out while dragging worked in my tests, but there is a problem when zooming in again. I will try to find out what goes wrong then and will try to provide a fix for this also, but it will take some time.

@danzel
Copy link
Member

danzel commented Sep 14, 2018 via email

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