[Pkg-javascript-commits] [leaflet-markercluster] 21/31: Support optional pane

Jonas Smedegaard dr at jones.dk
Sun Oct 22 17:29:30 UTC 2017


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

js pushed a commit to annotated tag upstream/1.1.0_dfsg
in repository leaflet-markercluster.

commit 4fffa0aa5c47942704decce305ef423ff10e70b4
Author: ckrahe <chris at krahe.org>
Date:   Mon Aug 14 15:27:21 2017 -0400

    Support optional pane
---
 README.md            | 1 +
 src/MarkerCluster.js | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 9030475..af9c759 100644
--- a/README.md
+++ b/README.md
@@ -130,6 +130,7 @@ If you need to update the clusters icon (e.g. they are based on markers real-tim
 * **spiderLegPolylineOptions**: Allows you to specify [PolylineOptions](http://leafletjs.com/reference.html#polyline-options) to style spider legs. By default, they are `{ weight: 1.5, color: '#222', opacity: 0.5 }`.
 * **spiderfyDistanceMultiplier**: Increase from 1 to increase the distance away from the center that spiderfied markers are placed. Use if you are using big marker icons (Default: 1).
 * **iconCreateFunction**: Function used to create the cluster icon [See default as example](https://github.com/Leaflet/Leaflet.markercluster/blob/15ed12654acdc54a4521789c498e4603fe4bf781/src/MarkerClusterGroup.js#L542).
+* **pane**: Map pane where the cluster icons will be added.
 
 #### Chunked addLayers options
 Options for the [addLayers](#bulk-adding-and-removing-markers) method. See [#357](https://github.com/Leaflet/Leaflet.markercluster/issues/357) for explanation on how the chunking works.
diff --git a/src/MarkerCluster.js b/src/MarkerCluster.js
index e3f4de2..9272eea 100644
--- a/src/MarkerCluster.js
+++ b/src/MarkerCluster.js
@@ -1,7 +1,12 @@
 L.MarkerCluster = L.Marker.extend({
 	initialize: function (group, zoom, a, b) {
 
-		L.Marker.prototype.initialize.call(this, a ? (a._cLatLng || a.getLatLng()) : new L.LatLng(0, 0), { icon: this });
+		var options = { icon: this };
+		if (group.options.pane) {
+		    options.pane = group.options.pane;
+        }
+
+		L.Marker.prototype.initialize.call(this, a ? (a._cLatLng || a.getLatLng()) : new L.LatLng(0, 0), options);
 
 
 		this._group = group;

-- 
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