Changeset 626
- Timestamp:
- 07/20/08 23:17:52 (2 months ago)
- Files:
-
- branches/tom-tweenlite/lib/com/modestmaps/core/TileGrid.as (modified) (1 diff)
- branches/tom-tweenlite/lib/com/modestmaps/extras/MapCopyright.as (modified) (6 diffs)
- branches/tom-tweenlite/lib/com/modestmaps/mapproviders/AbstractMapProvider.as (modified) (1 diff)
- branches/tom-tweenlite/lib/com/modestmaps/mapproviders/microsoft/MicrosoftProvider.as (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/tom-tweenlite/lib/com/modestmaps/core/TileGrid.as
r625 r626 557 557 tile.scaleX = tile.scaleY = Math.ceil(tileScales[tile.zoom] * tileWidth) / tileWidth;; 558 558 559 if (!zooming) {559 if (!zooming) { 560 560 // this also helps the rare seams not fixed by rounding the tile scale, 561 561 // but makes slow zooming uglier: 562 tile.x = Math.floor(positionCol*tileWidth*positionScaleCompensation); 563 tile.y = Math.floor(positionRow*tileHeight*positionScaleCompensation); 562 // round, not floor, because the latter causes artifacts at lower zoom levels :( 563 tile.x = Math.round(positionCol*tileWidth*positionScaleCompensation); 564 tile.y = Math.round(positionRow*tileHeight*positionScaleCompensation); 564 565 } 565 566 else { branches/tom-tweenlite/lib/com/modestmaps/extras/MapCopyright.as
r625 r626 6 6 import com.modestmaps.geo.Location; 7 7 8 import flash. events.EventDispatcher;8 import flash.display.Sprite; 9 9 import flash.external.ExternalInterface; 10 import flash.text.TextField; 11 import flash.text.TextFormat; 10 12 import flash.utils.clearTimeout; 11 13 import flash.utils.setTimeout; … … 20 22 * without requiring javascript, and without needing to edit this file. 21 23 */ 22 public class MapCopyright extends EventDispatcher 24 [Event(name="copyrightChanged", type="com.modestmaps.events.MapEvent")] 25 public class MapCopyright extends Sprite 23 26 { 24 27 private static const script_js:XML = <script> … … 207 210 public var copyright:String = ""; 208 211 212 public var copyrightField:TextField; 213 209 214 public function MapCopyright(map:Map) 210 215 { … … 231 236 map.addEventListener(MapEvent.RESIZED, onMapChange); 232 237 238 copyrightField = new TextField(); 239 copyrightField.defaultTextFormat = new TextFormat('Arial', 10, 0x000000, false); 240 copyrightField.selectable = copyrightField.mouseEnabled = false; 241 addChild(copyrightField); 233 242 } 234 243 … … 241 250 } 242 251 copyrightTimeout = setTimeout(callCopyright, 250); 252 253 if (event.type == MapEvent.RESIZED) { 254 copyrightField.x = map.getWidth() - copyrightField.width - 10; 255 copyrightField.y = map.getHeight() - copyrightField.height - 10; 256 } 243 257 } 244 258 … … 276 290 * 277 291 * to display the copyright string in your flash piece, you then need to listen for 278 * the COPYRIGHT_CHANGED MapEvent 292 * the COPYRIGHT_CHANGED MapEvent, or add MapCopyright as a child of map for a basic implementation. 279 293 */ 280 294 public function setCopyright(copyright:String):void { 281 295 this.copyright = copyright; 282 296 this.copyright = this.copyright.replace(/©/g,"©"); 297 298 copyrightField.htmlText = this.copyright; 299 copyrightField.width = copyrightField.textWidth + 4; 300 copyrightField.height = copyrightField.textHeight + 4; 301 copyrightField.x = map.getWidth() - copyrightField.width - 10; 302 copyrightField.y = map.getHeight() - copyrightField.height - 10; 303 283 304 dispatchEvent(new MapEvent(MapEvent.COPYRIGHT_CHANGED, this.copyright)); 284 305 } branches/tom-tweenlite/lib/com/modestmaps/mapproviders/AbstractMapProvider.as
r604 r626 75 75 76 76 // we don't wrap rows here because the map/grid should be enforcing outerLimits :) 77 // they aren't78 // TODO: wrap rows or enforce outer limits :)79 77 80 78 return new Coordinate(coord.row, wrappedColumn, coord.zoom); branches/tom-tweenlite/lib/com/modestmaps/mapproviders/microsoft/MicrosoftProvider.as
r609 r626 83 83 public function getTileUrls(coord:Coordinate):Array 84 84 { 85 if (coord.row < 0 || coord.row >= Math.pow(2, coord.zoom)) { 86 return []; 87 } 85 88 // this is so that requests will be consistent in this session, rather than totally random 86 89 var server:int = (serverSalt + coord.row + coord.column + coord.zoom) % 4;
