drawer: don't leak drawLevel into global namespace

This code is still under-tested and documented but no longer relies on
`drawLevel` being leaked into the global namespace where `updateLevel`
to find it.

See #145
This commit is contained in:
Chris Adams 2013-06-25 14:26:09 -04:00
parent c2107fcb22
commit c648c1df8a

View File

@ -527,7 +527,9 @@ function updateViewport( drawer ) {
lowestLevel = Math.min( lowestLevel, highestLevel );
//TODO
var drawLevel; // FIXME: drawLevel should have a more explanatory name
for ( level = highestLevel; level >= lowestLevel; level-- ) {
drawLevel = false;
//Avoid calculations for draw if we have already drawn this
renderPixelRatioC = drawer.viewport.deltaPixelsFromPoints(
@ -572,6 +574,7 @@ function updateViewport( drawer ) {
best = updateLevel(
drawer,
haveDrawn,
drawLevel,
level,
levelOpacity,
levelVisibility,
@ -601,7 +604,7 @@ function updateViewport( drawer ) {
}
function updateLevel( drawer, haveDrawn, level, levelOpacity, levelVisibility, viewportTL, viewportBR, currentTime, best ){
function updateLevel( drawer, haveDrawn, drawLevel, level, levelOpacity, levelVisibility, viewportTL, viewportBR, currentTime, best ){
var x, y,
tileTL,