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.
Cluster Marker disappearing when zoom screen with 70%, 80%, I already checked the demo on the website, and it also disappear.