Skip to content

Commit

Permalink
workaround flyTo bug
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperknot committed Feb 12, 2016
1 parent 3c87804 commit 7dd71b8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions debug/map/tile-debug.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
// zoomSnap: 0,
// zoomAnimation: false,
fadeAnimation: false
}).setView(dc, 10);
}).setView(dc, 16);

var gridCounts = {},
positronCounts = {},
Expand All @@ -172,7 +172,14 @@
gridLoadData[indexStr] = 0;
}
tile.innerHTML = ++gridLoadData[indexStr];
tile.style.backgroundColor = 'rgba(255,0,0,' + gridLoadData[indexStr] / 10 + ')';

// double tile loading alert
// if (gridLoadData[indexStr] > 1) {
// alert(indexStr);
// }

// more tile loadings -> more red grid tile
tile.style.backgroundColor = 'rgba(255,0,0,' + (gridLoadData[indexStr] - 1) / 5 + ')';
return tile;
};

Expand All @@ -198,7 +205,7 @@

var nullIslandKitten = L.imageOverlay('http://placekitten.com/300/400?image=6', [[-0.2,-0.15], [0.2, 0.15]]).addTo(map);

document.getElementById('dc').onclick = function () { map.flyTo(dc, 10); };
document.getElementById('dc').onclick = function () { map.flyTo(dc, 7, {duration: 40}); };
document.getElementById('sf').onclick = function () { map.setView(sf, 10, {duration: 40, animate: true}); };
document.getElementById('trd').onclick = function () { map.flyTo(trd, 10, {duration: 40}); };
document.getElementById('lnd').onclick = function () { map.flyTo(lnd, 9.25, {duration: 40}); };
Expand Down

0 comments on commit 7dd71b8

Please sign in to comment.