Skip to content

Cluster Marker disappearing when zoom screen with 70%, 80% #1012

@tranthaison1231

Description

@tranthaison1231
 const renderClusterMarker = useCallback(
    (
      coordinates: GeoJSON.Position,
      pointCount: number,
      getLeaves: (
        limit?: number,
        offset?: number
      ) => Array<React.ReactElement<MarkerProps & { children: Dictionary<ClusterPopoverProps> }> | undefined>
    ) => {
      const leaves = getLeaves(100).map(leave => leave?.props.children.props.marker as CurrentMaker)

      const markers = leaves.map(leave => ({
        leave,
        ContentComponent: leave.plant ? PlantMarkerDetail : UserMarkerDetail
      }))

      return (
        <Marker coordinates={coordinates} key={coordinates[0] + coordinates[1] + 1} anchor="center">
          <ClusterPopover markers={markers} pointCount={pointCount} />
        </Marker>
      )
    },
    []
  )
<Cluster ClusterMarkerFactory={renderClusterMarker}>
      {currentMarkers.map((currentMarker, index) => (
        <Marker key={currentMarker.plant?.PlantID ?? index} coordinates={currentMarker.coordinates} anchor="center">
          <MarkerElement marker={currentMarker} bearing={bearing} ContentComponent={ContentComponent(currentMarker)} />
        </Marker>
      ))}
    </Cluster>

Cluster Marker disappearing when zoom screen with 70%, 80%, I already checked the demo on the website, and it also disappear.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions