Skip to content

feat: enable passing MarkerClusterGroup options #136

@ManUtopiK

Description

@ManUtopiK

Here we should be able to pass the markerClusterGroup options.
Something like :

...

interface Props {
  leafletObject: Map
  markers: MarkerProps[]
  options: MarkerClusterGroupOptions
}

export const useLMarkerCluster = async (props: Props) => {
  // Get Leaflet from the window object
  const L = window.L

  // Lazy-load leaflet.markercluster
  // Importing it at the top level will cause errors because it could be loaded before the Leaflet library
  const { MarkerClusterGroup } = await import('leaflet.markercluster')

  // Initialize marker cluster
  const markerCluster = new MarkerClusterGroup(props.options)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions