Fix up SVG Detection, allows us to work with canvas. Fixes #67

This commit is contained in:
danzel
2012-09-28 09:14:06 +12:00
parent d13b6758e1
commit b97def88f9
+5 -5
View File
@@ -154,7 +154,7 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
group._forceLayout();
group._animationStart();
var initialLegOpacity = L.Browser.svg ? 0 : 0.3,
var initialLegOpacity = L.Path.SVG ? 0 : 0.3,
xmlns = L.Path.SVG_NS;
@@ -174,7 +174,7 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
m._spiderLeg = leg;
//Following animations don't work for canvas
if (!L.Browser.svg) {
if (!L.Path.SVG) {
continue;
}
@@ -211,7 +211,7 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
//Set the opacity of the spiderLegs back to their correct value
// The animations above override this until they complete.
// If the initial opacity of the spiderlegs isn't 0 then they appear before the animation starts.
if (L.Browser.svg) {
if (L.Path.SVG) {
this._group._forceLayout();
for (i = childMarkers.length - 1; i >= 0; i--) {
@@ -233,7 +233,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.Browser.svg,
svg = L.Path.SVG,
m, i, a;
group._animationStart();
@@ -317,7 +317,7 @@ L.MarkerClusterGroup.include({
this._map.on('zoomend', this._unspiderfyWrapper, this);
}
if (L.Browser.svg && !L.Browser.touch) {
if (L.Path.SVG && !L.Browser.touch) {
this._map._initPathRoot();
//Needs to happen in the pageload, not after, or animations don't work in webkit
// http://stackoverflow.com/questions/8455200/svg-animate-with-dynamically-added-elements