Skip to content

Rendering issue for spiderfy of cluster with 2, collocated markers #222

@francesmchugh

Description

@francesmchugh

My project requires the following behavior

  1. Presentation of collocated markers in a cluster (like spiderfy)
  2. Click to select a marker in the collocated marker set - leave the marker set visible and selection presented.
  3. Clear spiderfy of collocated clusters with NO selected marker when map background is clicked.
  4. Keep spiderfy active for collocated cluster with a selected marker.

I've added this code to my MarkerClusterGroup to support the behaviors above:

	eventHandlers={{
		unspiderfied: (e) => {
			if (e.markers.find(m => m.options.icon.options.className.includes("selected"))) {
				e.cluster.spiderfy();
			}
		},
		clusterclick: (e) => {
			if (e.target._spiderfied) {
				e.target.unspiderfy();
			} else {
				e.target.spiderfy();
			}
		},
	}}>

My problem is that when I click a marker to select it, the e.cluster.spiderfy() call in the unspiderfied event handler does not render both of the cluster markers. It only renders 1 of the two (could be either) and the cluster marker remains presented as shown here:

Image

I expect the cluster to look like this:

Image

Note: This only happens when there are 2 markers in the cluster. 3 or more markers works as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions