[Pkg-javascript-commits] [leaflet-markercluster] 273/479: Implement getBounds explicitly so it actually works. Thanks @2803media for reporting. Fixes #84
Jonas Smedegaard
dr at jones.dk
Thu Oct 16 16:00:39 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 ae3c859e6548656563ed0a48be43e1b53f00135e
Author: danzel <danzel at localhost.geek.nz>
Date: Fri Oct 19 09:32:40 2012 +1300
Implement getBounds explicitly so it actually works. Thanks @2803media for reporting. Fixes #84
---
src/MarkerClusterGroup.js | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index 31ff227..ffeb9c0 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -214,6 +214,19 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
return this;
},
+ //Override FeatureGroup.getBounds as it doesn't work
+ getBounds: function () {
+ var bounds = new L.LatLngBounds();
+ if (this._topClusterLevel) {
+ bounds.extend(this._topClusterLevel._bounds);
+ } else {
+ for (var i = this._needsClustering.length; i >= 0; i--) {
+ bounds.extend(this._needsClustering[i].getLatLng());
+ }
+ }
+ return bounds;
+ },
+
//Returns true if the given layer is in this MarkerClusterGroup
hasLayer: function (layer) {
if (this._needsClustering.length > 0) {
--
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