Changeset 597
- Timestamp:
- 07/08/08 14:18:39 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/tom-tweenlite/lib/com/modestmaps/core/Tile.as
r595 r597 24 24 this.cacheAsBitmap = false; 25 25 26 this.alpha = 0.0;26 hide(); 27 27 28 28 } 29 29 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 31 41 { 32 42 this.alpha = 1.0; 33 43 // if you want to do something when the tile is ready then override 34 44 // this method and override Map.createTile to use your subclass 45 } 46 47 public function hide():void 48 { 49 this.alpha = 0.0; 35 50 } 36 51 branches/tom-tweenlite/lib/com/modestmaps/core/TileGrid.as
r596 r597 337 337 } 338 338 else { 339 tile. addedLoader();339 tile.show(); 340 340 } 341 341 well.addChild(tile); … … 344 344 visibleTiles.push(tile); 345 345 346 var tileReady:Boolean = tile. alpha == 1&& (layersNeeded[tile] == null);346 var tileReady:Boolean = tile.isShowing() && (layersNeeded[tile] == null); 347 347 348 348 // … … 375 375 if (alreadySeen[pkey] is Tile) { 376 376 ptile = ensureVisible(pkey); 377 ptile.alpha = 1;378 377 foundParent = true; 379 378 } … … 393 392 if (alreadySeen[ckey] is Tile) { 394 393 var ctile:Tile = ensureVisible(ckey); 395 ctile.alpha = 1.0;396 394 foundChildren++; 397 395 } … … 419 417 pkey = parentKey(col, row, currentZoom, pzoom); 420 418 if (alreadySeen[pkey] is Tile) { 421 ptile = ensureVisible(pkey); 422 ptile.alpha = 1; 419 ptile = ensureVisible(pkey); 423 420 stillNeedsAnImage = false; 424 421 break; … … 456 453 if (visibleTiles.indexOf(tile) < 0) { 457 454 well.removeChild(tile); 458 tile. alpha = 0.0;455 tile.hide(); 459 456 } 460 457 } … … 572 569 else if (urls && urls.length == 0) { 573 570 if (tile.zoom == currentZoom) { 574 tile. addedLoader();571 tile.show(); 575 572 } 576 573 else { 577 tile. alpha = 1;574 tile.showNow(); 578 575 } 579 576 alreadySeen[tile.name] = tile; … … 614 611 visibleTiles.push(tile); // don't get rid of it yet! 615 612 } 613 tile.showNow(); 616 614 return tile; 617 615 } … … 681 679 tile.paintError(provider.tileWidth, provider.tileHeight); 682 680 if (tile.zoom == currentZoom) { 683 tile. addedLoader();681 tile.show(); 684 682 } 685 683 else { 686 tile. alpha = 1;684 tile.showNow(); 687 685 } 688 686 } branches/tom-tweenlite/lib/com/modestmaps/core/TweenTile.as
r567 r597 15 15 { 16 16 super(col, row, zoom); 17 this.alpha = 0.0;18 17 } 19 18 20 override public function addedLoader():void19 override public function show():void 21 20 { 22 21 if (alpha < 1) { 23 //alpha = 1;24 22 TweenLite.to(this, FADE_TIME, { alpha: 1 }); 25 23 }
