Feature Detect SVG Animation and only use it if available. IE10 does not support it. Fixes #86

This commit is contained in:
danzel
2012-11-01 09:32:51 +13:00
parent 315c2c8c50
commit bef1dbb33e
+6 -2
View File
@@ -132,6 +132,10 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
}
} : {
//Animated versions here
SVG_ANIMATION: (function () {
return document.createElementNS('http://www.w3.org/2000/svg', 'animate').toString().indexOf('SVGAnimate') > -1;
}()),
_animationSpiderfy: function (childMarkers, positions) {
var me = this,
group = this._group,
@@ -174,7 +178,7 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
m._spiderLeg = leg;
//Following animations don't work for canvas
if (!L.Path.SVG) {
if (!L.Path.SVG || !this.SVG_ANIMATION) {
continue;
}
@@ -233,7 +237,7 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
map = group._map,
thisLayerPos = zoomDetails ? map._latLngToNewLayerPoint(this._latlng, zoomDetails.zoom, zoomDetails.center) : map.latLngToLayerPoint(this._latlng),
childMarkers = this.getAllChildMarkers(),
svg = L.Path.SVG,
svg = L.Path.SVG && this.SVG_ANIMATION,
m, i, a;
group._animationStart();