Changeset 627
- Timestamp:
- 07/20/08 23:40:01 (1 month ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/tom-tweenlite/lib/com/modestmaps/core/TileGrid.as
r626 r627 117 117 protected static const DEFAULT_ENFORCE_BOUNDS:Boolean = true; 118 118 protected static const DEFAULT_MAX_OPEN_REQUESTS:int = 4; // TODO: should this be split into max-new-requests-per-frame, too? 119 protected static const DEFAULT_ROUND_POSITIONS:Boolean = true; 120 protected static const DEFAULT_ROUND_SCALES:Boolean = true; 119 121 120 122 /** if we don't have a tile at currentZoom, onRender will look for tiles up to 5 levels out. … … 138 140 // set this to true to enable enforcing of map bounds from the map provider's limits 139 141 public var enforceBoundsEnabled:Boolean = DEFAULT_ENFORCE_BOUNDS; 142 143 public var roundPositionsEnabled:Boolean = DEFAULT_ROUND_POSITIONS; 144 145 public var roundScalesEnabled:Boolean = DEFAULT_ROUND_SCALES; 140 146 141 147 public var mapWidth:Number; … … 542 548 for (var z:int = 0; z <= maxZoom; z++) { 543 549 scaleFactors[z] = Math.pow(2.0, currentTileZoom-z) 544 tileScales[z] = Math.pow(2, zoomLevel-z); 550 551 // round up to the nearest pixel to avoid seams between zoom levels 552 if (roundScalesEnabled) { 553 tileScales[z] = Math.ceil(Math.pow(2, zoomLevel-z) * tileWidth) / tileWidth; 554 } 555 else { 556 tileScales[z] = Math.pow(2, zoomLevel-z); 557 } 545 558 } 546 559 … … 554 567 var positionRow:Number = (scaleFactors[tile.zoom]*tile.row) - realMinRow; 555 568 556 // round up to the nearest pixel to avoid seams between zoom levels 557 tile.scaleX = tile.scaleY = Math.ceil(tileScales[tile.zoom] * tileWidth) / tileWidth;; 558 559 if (!zooming) { 569 tile.scaleX = tile.scaleY = tileScales[tile.zoom]; 570 571 if (!zooming && roundPositionsEnabled) { 560 572 // this also helps the rare seams not fixed by rounding the tile scale, 561 573 // but makes slow zooming uglier: branches/tom-tweenlite/lib/com/modestmaps/mapproviders/microsoft/MicrosoftProvider.as
r626 r627 84 84 { 85 85 if (coord.row < 0 || coord.row >= Math.pow(2, coord.zoom)) { 86 return [];86 return null; 87 87 } 88 88 // this is so that requests will be consistent in this session, rather than totally random
