Skip to content

adammertel/Leaflet.MarkerCluster.List

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leaflet.MarkerCluster.List

subplugin for the Leaflet.MarkerCluster to display clustered child elements in the list

sample image

Options

  • labelFn (fn (element, element index, cluster) ) - function to handle how to display each element in the list

    (el, ei, cluster) => {
      return '<p onclick="clickAction(' + el.options.id + ')">[' + ei + '] ' + el.options.listText + '</p>';
    }
    
  • headerFn (fn (elements, cluster) ) - function to handle header

    (els, cluster) => '<p>showing cluster with ' + els.length + ' elements</p>'
    
  • sortFn (fn (marker1, marker2) ) - implementation of markers sorting in list (see e.g. mozilla docs )

    (m1, m2) => m1.options.id > m2.options.id ? 1 : -1
    
  • showHeader (bool, default false) - whether to display header

  • sidePanel (bool, default false) - whether to show side panel with close button

  • sidePanelWidth (number, default 50) - width of side panel in px

  • centerOnChange (bool, default false) - whether to pan map to active cluster after spiderfied event

  • list (bool, default true) - whether to apply this list rule or not

Notes:

  • suitable for mobile devices where the display is too small to spiderfy clustered child elements on the map

Author:

  • Adam Mertel | UNIVIE

Demo:

Releases

No releases published

Packages

No packages published