[Pkg-javascript-commits] [leaflet-markercluster] 250/479: Add an option to MarkerClusterGroup to pass options to the created L.Polygon

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:36 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository leaflet-markercluster.

commit 1de878677f514c39ee79a7d147658ce01cb76bda
Author: Yohan Boniface <yb at enix.org>
Date:   Tue Sep 25 01:11:07 2012 +0200

    Add an option to MarkerClusterGroup to pass options to the created L.Polygon
    
    It could be useful for example to customize the color and fillColor.
---
 src/MarkerClusterGroup.js | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index 3316900..3df7a12 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -20,7 +20,10 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 
 		//Whether to animate adding markers after adding the MarkerClusterGroup to the map
 		// If you are adding individual markers set to true, if adding bulk markers leave false for massive performance gains.
-		animateAddingMarkers: false
+		animateAddingMarkers: false,
+
+		//Options to pass to the L.Polygon constructor
+		polygonOptions: {}
 	},
 
 	initialize: function (options) {
@@ -365,7 +368,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 					map.removeLayer(shownPolygon);
 				}
 				if (a.layer.getChildCount() > 2) {
-					shownPolygon = new L.Polygon(a.layer.getConvexHull());
+					shownPolygon = new L.Polygon(a.layer.getConvexHull(), this.options.polygonOptions);
 					map.addLayer(shownPolygon);
 				}
 			}, this);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/leaflet-markercluster.git



More information about the Pkg-javascript-commits mailing list