[Pkg-javascript-commits] [leaflet-markercluster] 138/479: Update the build
Jonas Smedegaard
dr at jones.dk
Thu Oct 16 16:00:21 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 eeb8f91042f366f32c4ba8dc1dcc13dc13badaa8
Author: danzel <danzel at localhost.geek.nz>
Date: Wed Aug 1 15:17:51 2012 +1200
Update the build
---
dist/leaflet.markercluster-src.js | 41 ++++++++++++++++++++++++++-------------
dist/leaflet.markercluster.js | 2 +-
2 files changed, 29 insertions(+), 14 deletions(-)
diff --git a/dist/leaflet.markercluster-src.js b/dist/leaflet.markercluster-src.js
index 23f187a..f1e7d8d 100644
--- a/dist/leaflet.markercluster-src.js
+++ b/dist/leaflet.markercluster-src.js
@@ -497,7 +497,7 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
this._forceLayout();
this._animationStart();
- layer._setPos(this._map.latLngToLayerPoint(layer.getLatLng()));
+ layer._setPos(this._map.latLngToLayerPoint(newCluster.getLatLng()));
layer.setOpacity(0);
setTimeout(function () {
@@ -1183,17 +1183,20 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
_animationSpiderfy: function (childMarkers, positions) {
var group = this._group,
map = group._map,
- i, m, leg;
+ i, m, leg, newPos;
for (i = childMarkers.length - 1; i >= 0; i--) {
+ newPos = map.layerPointToLatLng(positions[i]);
m = childMarkers[i];
+ m._preSpiderfyLatlng = m._latlng;
+ m.setLatLng(newPos);
m.setZIndexOffset(1000000); //Make these appear on top of EVERYTHING
+
L.FeatureGroup.prototype.addLayer.call(group, m);
- m._setPos(positions[i]);
- leg = new L.Polyline([this._latlng, map.layerPointToLatLng(positions[i])], { weight: 1.5, color: '#222' });
+ leg = new L.Polyline([this._latlng, newPos], { weight: 1.5, color: '#222' });
map.addLayer(leg);
m._spiderLeg = leg;
}
@@ -1210,11 +1213,12 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
for (i = childMarkers.length - 1; i >= 0; i--) {
m = childMarkers[i];
- delete m._backupPosSpider;
- m.setZIndexOffset(0);
-
L.FeatureGroup.prototype.removeLayer.call(group, m);
+ m.setLatLng(m._preSpiderfyLatlng);
+ delete m._preSpiderfyLatlng;
+ m.setZIndexOffset(0);
+
map.removeLayer(m._spiderLeg);
delete m._spiderLeg;
}
@@ -1226,8 +1230,9 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
group = this._group,
map = group._map,
thisLayerPos = map.latLngToLayerPoint(this._latlng),
- i, m, leg;
+ i, m, leg, newPos;
+ //Add markers to map hidden at our center point
for (i = childMarkers.length - 1; i >= 0; i--) {
m = childMarkers[i];
@@ -1239,7 +1244,7 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
m._setPos(thisLayerPos);
}
- this._group._forceLayout();
+ group._forceLayout();
group._animationStart();
var initialLegOpacity = L.Browser.svg ? 0 : 0.3,
@@ -1247,14 +1252,17 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
for (i = childMarkers.length - 1; i >= 0; i--) {
+ newPos = map.layerPointToLatLng(positions[i]);
m = childMarkers[i];
- m._setPos(positions[i]);
-
+ //Move marker to new position
+ m._preSpiderfyLatlng = m._latlng;
+ m.setLatLng(newPos);
m.setOpacity(1);
- //Add Legs. TODO: Fade this in!
- leg = new L.Polyline([me._latlng, map.layerPointToLatLng(positions[i])], { weight: 1.5, color: '#222', opacity: initialLegOpacity });
+
+ //Add Legs.
+ leg = new L.Polyline([me._latlng, newPos], { weight: 1.5, color: '#222', opacity: initialLegOpacity });
map.addLayer(leg);
m._spiderLeg = leg;
@@ -1327,6 +1335,10 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
for (i = childMarkers.length - 1; i >= 0; i--) {
m = childMarkers[i];
+ //Fix up the location to the real one
+ m.setLatLng(m._preSpiderfyLatlng);
+ delete m._preSpiderfyLatlng;
+ //Hack override the location to be our center
m._setPos(thisLayerPos);
m.setOpacity(0);
@@ -1411,8 +1423,11 @@ L.MarkerClusterGroup.include({
_unspiderfyLayer: function (layer) {
if (layer._spiderLeg) {
L.FeatureGroup.prototype.removeLayer.call(this, layer);
+
layer.setOpacity(1);
+ //Position will be fixed up immediately in _animationUnspiderfy
layer.setZIndexOffset(0);
+
this._map.removeLayer(layer._spiderLeg);
delete layer._spiderLeg;
}
diff --git a/dist/leaflet.markercluster.js b/dist/leaflet.markercluster.js
index 5583aea..1d777dc 100644
--- a/dist/leaflet.markercluster.js
+++ b/dist/leaflet.markercluster.js
@@ -3,4 +3,4 @@
Leaflet.markercluster is an open-source JavaScript library for Marker Clustering on leaflet powered maps.
https://github.com/danzel/Leaflet.markercluster
*/
-(function(e,t){L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:60,iconCreateFunction:null,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),L.FeatureGroup.prototype.initialize.call(this,[]),this._inZoomAnimation=0,this._needsClustering=[],this._currentShownBounds=null},addLayer:function(e){if(!this._map [...]
\ No newline at end of file
+(function(e,t){L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:60,iconCreateFunction:null,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),L.FeatureGroup.prototype.initialize.call(this,[]),this._inZoomAnimation=0,this._needsClustering=[],this._currentShownBounds=null},addLayer:function(e){if(!this._map [...]
\ No newline at end of file
--
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