[Pkg-javascript-commits] [leaflet-markercluster] 77/479: Gotta be sexy :)
Jonas Smedegaard
dr at jones.dk
Thu Oct 16 16:00:12 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 14070bf4ba610ae35e86b139b9d0a74740f55b6e
Author: danzel <danzel at localhost.geek.nz>
Date: Mon Jul 23 15:48:31 2012 +1200
Gotta be sexy :)
---
src/MarkerCluster.Spiderfier.js | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/src/MarkerCluster.Spiderfier.js b/src/MarkerCluster.Spiderfier.js
index 983db00..0d67acc 100644
--- a/src/MarkerCluster.Spiderfier.js
+++ b/src/MarkerCluster.Spiderfier.js
@@ -15,7 +15,8 @@ L.MarkerCluster.include({
// 0 -> always spiral; Infinity -> always circle
spiderfy: function () {
- var childMarkers = this.getAllChildMarkers(),
+ var me = this,
+ childMarkers = this.getAllChildMarkers(),
group = this._group,
map = group._map,
center = map.latLngToLayerPoint(this._latlng),
@@ -34,16 +35,30 @@ L.MarkerCluster.include({
m = childMarkers[i];
m._backupPosSpider = m._latlng;
- m.setLatLng(map.layerPointToLatLng(markerOffsets[i]));
-
+ m.setLatLng(this._latlng);
m.setZIndexOffset(1000000); //Make these appear on top of EVERYTHING
- L.FeatureGroup.prototype.addLayer.call(group, m);
+ m.setOpacity(0);
- var leg = new L.Polyline([this._latlng, m._latlng], { weight: 1.5, color: '#222' });
- map.addLayer(leg);
+ L.FeatureGroup.prototype.addLayer.call(group, m);
}
- this.setOpacity(0.3);
+ setTimeout(function () {
+ group._animationStart();
+ for (i = childMarkers.length - 1; i >= 0; i--) {
+ m = childMarkers[i];
+
+ m.setLatLng(map.layerPointToLatLng(markerOffsets[i]));
+ m.setOpacity(1);
+
+ var leg = new L.Polyline([me._latlng, m._latlng], { weight: 1.5, color: '#222' });
+ map.addLayer(leg);
+ }
+ me.setOpacity(0.3);
+
+ setTimeout(function () {
+ group._animationEnd();
+ }, 250);
+ }, 0);
},
unspiderfy: function () {
--
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