Skip to content

Popup don't open manually if 2 marks have the exact coordinates  #1095

@WagdySamih

Description

@WagdySamih
  • I've searched through the issues to make sure it's not yet reported

  • Leaflet version: 4.2.1
  • Leaflet.MarkerCluster version: 2.1.0
  • Browser (with version): Chrome - 117
  • OS/Platform: Ubuntu 20.04

How to reproduce

Try to have marks with the exact position same lat and long
Try to open the popup from any outside source for the same duplicated position popup

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

The popup doesn't open
Note:
The code below works totally fine if there is no clustering

 <MarkerClusterGroup
        iconCreateFunction={createClusterCustomIcon}
        maxClusterRadius={30}
        spiderfyOnMaxZoom
        polygonOptions={{
          fillColor: '#ffffff',
          color: '#7DD68E',
          weight: 5,
          opacity: 1.0,
          fillOpacity: 0.8,
        }}
        showCoverageOnHover={true}
      >
        {markers.map((marker, index) => (
          <Marker
            position={marker.coordinates}
            key={index}
            ref={myRefs.current[index]}
            icon={greenIcon(marker?.markerImage || '')}
            eventHandlers={{
              click: () => {
                setLocalSelectedLocation({
                  position: marker.coordinates,
                  user: marker.user,
                });
              },
            }}
          >
            <Popup
              key={index}
              className={styles.popup_container}
              offset={[10, 5]}
            >
              {localSelectedLocation && (
                <div> any thing </div>
              )}
            </Popup>
          </Marker>
        ))}
 </MarkerClusterGroup>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions