You are here

README.txt in Leaflet Markercluster 7

Same filename and directory in other branches
  1. 8 README.txt
INSTALLATION
============
Naturally you need to have Leaflet (the module and the javascript library)
installed before you can use Leaflet MarkerCluster.

With Leaflet in place, download the MarkerCluster javascript library from
https://github.com/Leaflet/Leaflet.markercluster/archive/v1.0.0.zip
Rename the downloaded directory to leaflet_markercluster (lowercase), so that
the path to the essential javascript file inside this folder becomes:
sites/all/libraries/leaflet_markercluster/dist/leaflet.markercluster.js

Visit the Status Report page, admin/reports/status, to check all's ok.

There are no permissions to configure.

This module does not itself have a UI to set MarkerCluster configuration
parameters. However parameters may be set through Drupal code as part of the
creation of the map and will thus be passed to the underlying javascript
library. See the section below.


FOR PROGRAMMERS
===============
You can set Leaflet MarkerCluster parameters in the same way that you set
Leaflet map parameters.
Example:

  $map_id = 'OSM Mapnik'; // default map that comes with Leaflet
  $map = leaflet_map_get_info($map_id);

  $map['settings']['zoom']                    = 10; // Leaflet parameter
  $map['settings']['maxClusterRadius']        = 50; // Leaflet MarkerCluster parameter
  $map['settings']['disableClusteringAtZoom'] = 2;  // Leaflet MarkerCluster parameter

  $features = ... // see the README.txt of the Leaflet module

  $output = '<div>' . leaflet_render_map($map, $features, '300px') . '</div>';

The following MarkerCluster parameters may be configured this way:

  animateAddingMarkers (default: FALSE)
  disableClusteringAtZoom (NULL)
  maxClusterRadius (80)
  removeOutsideVisibleBounds (TRUE)
  showCoverageOnHover (TRUE)
  singleMarkerMode (FALSE)
  skipDuplicateAddTesting (FALSE)
  spiderfyDistanceMultiplier (1.0)
  spiderfyOnMaxZoom (TRUE)
  zoomToBoundsOnClick (TRUE)

See the bottom reference for an explanation of these parameters.

References:

o http://leafletjs.com/2012/08/20/guest-post-markerclusterer-0-1-released.html
o https://github.com/Leaflet/Leaflet.markercluster/blob/master/README.md

File

README.txt
View source
  1. INSTALLATION
  2. ============
  3. Naturally you need to have Leaflet (the module and the javascript library)
  4. installed before you can use Leaflet MarkerCluster.
  5. With Leaflet in place, download the MarkerCluster javascript library from
  6. https://github.com/Leaflet/Leaflet.markercluster/archive/v1.0.0.zip
  7. Rename the downloaded directory to leaflet_markercluster (lowercase), so that
  8. the path to the essential javascript file inside this folder becomes:
  9. sites/all/libraries/leaflet_markercluster/dist/leaflet.markercluster.js
  10. Visit the Status Report page, admin/reports/status, to check all's ok.
  11. There are no permissions to configure.
  12. This module does not itself have a UI to set MarkerCluster configuration
  13. parameters. However parameters may be set through Drupal code as part of the
  14. creation of the map and will thus be passed to the underlying javascript
  15. library. See the section below.
  16. FOR PROGRAMMERS
  17. ===============
  18. You can set Leaflet MarkerCluster parameters in the same way that you set
  19. Leaflet map parameters.
  20. Example:
  21. $map_id = 'OSM Mapnik'; // default map that comes with Leaflet
  22. $map = leaflet_map_get_info($map_id);
  23. $map['settings']['zoom'] = 10; // Leaflet parameter
  24. $map['settings']['maxClusterRadius'] = 50; // Leaflet MarkerCluster parameter
  25. $map['settings']['disableClusteringAtZoom'] = 2; // Leaflet MarkerCluster parameter
  26. $features = ... // see the README.txt of the Leaflet module
  27. $output = '
    ' . leaflet_render_map($map, $features, '300px') . '
    ';
  28. The following MarkerCluster parameters may be configured this way:
  29. animateAddingMarkers (default: FALSE)
  30. disableClusteringAtZoom (NULL)
  31. maxClusterRadius (80)
  32. removeOutsideVisibleBounds (TRUE)
  33. showCoverageOnHover (TRUE)
  34. singleMarkerMode (FALSE)
  35. skipDuplicateAddTesting (FALSE)
  36. spiderfyDistanceMultiplier (1.0)
  37. spiderfyOnMaxZoom (TRUE)
  38. zoomToBoundsOnClick (TRUE)
  39. See the bottom reference for an explanation of these parameters.
  40. References:
  41. o http://leafletjs.com/2012/08/20/guest-post-markerclusterer-0-1-released.html
  42. o https://github.com/Leaflet/Leaflet.markercluster/blob/master/README.md