You are here

README.txt in Leaflet Markercluster 8

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

Then download the MarkerCluster library from:
https://github.com/danzel/Leaflet.markercluster

The core part of the zip file is a directory named 'dist'. Make sure this
directory ends up in libraries/leaflet_markercluster, so that the path
to the essential javascript file becomes 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)
  showCoverageOnHover (TRUE)
  singleMarkerMode (FALSE)
  skipDuplicateAddTesting (FALSE)
  spiderfyOnMaxZoom (TRUE)
  zoomToBoundsOnClick (TRUE)

See the bottom reference for an explanation of these parameters.

References:

o http://leaflet.cloudmade.com/2012/08/20/guest-post-markerclusterer-0-1-released.html
o https://github.com/danzel/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. Then download the MarkerCluster library from:
  6. https://github.com/danzel/Leaflet.markercluster
  7. The core part of the zip file is a directory named 'dist'. Make sure this
  8. directory ends up in libraries/leaflet_markercluster, so that the path
  9. to the essential javascript file becomes 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. showCoverageOnHover (TRUE)
  33. singleMarkerMode (FALSE)
  34. skipDuplicateAddTesting (FALSE)
  35. spiderfyOnMaxZoom (TRUE)
  36. zoomToBoundsOnClick (TRUE)
  37. See the bottom reference for an explanation of these parameters.
  38. References:
  39. o http://leaflet.cloudmade.com/2012/08/20/guest-post-markerclusterer-0-1-released.html
  40. o https://github.com/danzel/Leaflet.markercluster/blob/master/README.md