[Pkg-javascript-commits] [leaflet-markercluster] 281/479: Feature Detect SVG Animation and only use it if available. IE10 does not support it. Fixes #86
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 bef1dbb33e2ea4e79816046e91f0ddc5318d4698
Author: danzel <danzel at localhost.geek.nz>
Date: Thu Nov 1 09:32:51 2012 +1300
Feature Detect SVG Animation and only use it if available. IE10 does not support it. Fixes #86
---
src/MarkerCluster.Spiderfier.js | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/MarkerCluster.Spiderfier.js b/src/MarkerCluster.Spiderfier.js
index 2b52a2f..90d0c5e 100644
--- a/src/MarkerCluster.Spiderfier.js
+++ b/src/MarkerCluster.Spiderfier.js
@@ -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();
--
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