Changeset 597

Show
Ignore:
Timestamp:
07/08/08 14:18:39 (2 months ago)
Author:
tom
Message:

changed added loader to be show/hide and handed control of visibility method off to Tile in tweenlite branch

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/tom-tweenlite/lib/com/modestmaps/core/Tile.as

    r595 r597  
    2424                        this.cacheAsBitmap = false; 
    2525                         
    26                         this.alpha = 0.0
     26                        hide()
    2727                         
    2828                }  
    2929                 
    30                 public function addedLoader():void  
     30                public function isShowing():Boolean 
     31                { 
     32                        return this.alpha == 1.0; 
     33                } 
     34                 
     35                public function showNow():void 
     36                { 
     37                        this.alpha = 1.0; 
     38                } 
     39                 
     40                public function show():void  
    3141                { 
    3242                        this.alpha = 1.0; 
    3343                        // if you want to do something when the tile is ready then override  
    3444                        // this method and override Map.createTile to use your subclass  
     45                } 
     46                 
     47                public function hide():void 
     48                { 
     49                        this.alpha = 0.0; 
    3550                } 
    3651                 
  • branches/tom-tweenlite/lib/com/modestmaps/core/TileGrid.as

    r596 r597  
    337337                                                } 
    338338                                                else { 
    339                                                         tile.addedLoader(); 
     339                                                        tile.show(); 
    340340                                                } 
    341341                                                well.addChild(tile); 
     
    344344                                        visibleTiles.push(tile); 
    345345 
    346                                         var tileReady:Boolean = tile.alpha == 1 && (layersNeeded[tile] == null); 
     346                                        var tileReady:Boolean = tile.isShowing() && (layersNeeded[tile] == null); 
    347347                                         
    348348                                        // 
     
    375375                                                                if (alreadySeen[pkey] is Tile) { 
    376376                                                                        ptile = ensureVisible(pkey); 
    377                                                                         ptile.alpha = 1; 
    378377                                                                        foundParent = true; 
    379378                                                                } 
     
    393392                                                                                if (alreadySeen[ckey] is Tile) { 
    394393                                                                                        var ctile:Tile = ensureVisible(ckey); 
    395                                                                                         ctile.alpha = 1.0; 
    396394                                                                                        foundChildren++; 
    397395                                                                                } 
     
    419417                                                                pkey = parentKey(col, row, currentZoom, pzoom); 
    420418                                                                if (alreadySeen[pkey] is Tile) { 
    421                                                                         ptile = ensureVisible(pkey); 
    422                                                                         ptile.alpha = 1;                                                                 
     419                                                                        ptile = ensureVisible(pkey);                                                             
    423420                                                                        stillNeedsAnImage = false; 
    424421                                                                        break; 
     
    456453                                if (visibleTiles.indexOf(tile) < 0) { 
    457454                                        well.removeChild(tile); 
    458                                         tile.alpha = 0.0
     455                                        tile.hide()
    459456                                } 
    460457                        } 
     
    572569                        else if (urls && urls.length == 0) { 
    573570                                if (tile.zoom == currentZoom) { 
    574                                         tile.addedLoader(); 
     571                                        tile.show(); 
    575572                                } 
    576573                                else { 
    577                                         tile.alpha = 1
     574                                        tile.showNow()
    578575                                }                                        
    579576                                alreadySeen[tile.name] = tile; 
     
    614611                                visibleTiles.push(tile); // don't get rid of it yet! 
    615612                        } 
     613                        tile.showNow(); 
    616614                        return tile; 
    617615                } 
     
    681679                                                tile.paintError(provider.tileWidth, provider.tileHeight); 
    682680                                                if (tile.zoom == currentZoom) { 
    683                                                         tile.addedLoader(); 
     681                                                        tile.show(); 
    684682                                                } 
    685683                                                else { 
    686                                                         tile.alpha = 1
     684                                                        tile.showNow()
    687685                                                } 
    688686                                        } 
  • branches/tom-tweenlite/lib/com/modestmaps/core/TweenTile.as

    r567 r597  
    1515                { 
    1616                        super(col, row, zoom); 
    17                         this.alpha = 0.0; 
    1817                }  
    1918                 
    20                 override public function addedLoader():void  
     19                override public function show():void  
    2120                { 
    2221                        if (alpha < 1) { 
    23                                 //alpha = 1; 
    2422                                TweenLite.to(this, FADE_TIME, { alpha: 1 }); 
    2523                        }