leaflet.markercluster.list

0.4.4 • Public • Published

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:

Package Sidebar

Install

npm i leaflet.markercluster.list

Weekly Downloads

13

Version

0.4.4

License

ISC

Unpacked Size

16.8 kB

Total Files

5

Last publish

Collaborators

  • adammertel