Changeset 176
- Timestamp:
- 03/18/07 16:36:45 (2 years ago)
- Files:
-
- trunk/as2/lib/com/modestmaps/core/Tile.as (modified) (6 diffs)
- trunk/as2/lib/com/modestmaps/io/LoadMovieThrottledRequest.as (modified) (3 diffs)
- trunk/as2/lib/com/modestmaps/io/MapProviderPaintThrottledRequest.as (modified) (1 diff)
- trunk/as2/lib/com/modestmaps/io/ThrottledRequest.as (modified) (3 diffs)
- trunk/as2/lib/com/modestmaps/Map.as (modified) (7 diffs)
- trunk/as2/lib/com/modestmaps/mapproviders/AbstractImageBasedMapProvider.as (modified) (2 diffs)
- trunk/as2/lib/com/modestmaps/mapproviders/AbstractMapProvider.as (modified) (4 diffs)
- trunk/as2/lib/com/modestmaps/mapproviders/BlueMarbleMapProvider.as (modified) (2 diffs)
- trunk/as2/lib/com/modestmaps/mapproviders/google/GoogleAerialMapProvider.as (modified) (2 diffs)
- trunk/as2/lib/com/modestmaps/mapproviders/google/GoogleHybridMapProvider.as (modified) (4 diffs)
- trunk/as2/lib/com/modestmaps/mapproviders/google/GoogleRoadMapProvider.as (modified) (2 diffs)
- trunk/as2/lib/com/modestmaps/mapproviders/MapProviderFactory.as (modified) (1 diff)
- trunk/as2/lib/com/modestmaps/mapproviders/microsoft/MicrosoftAerialMapProvider.as (modified) (2 diffs)
- trunk/as2/lib/com/modestmaps/mapproviders/microsoft/MicrosoftHybridMapProvider.as (modified) (2 diffs)
- trunk/as2/lib/com/modestmaps/mapproviders/microsoft/MicrosoftRoadMapProvider.as (modified) (2 diffs)
- trunk/as2/lib/com/modestmaps/mapproviders/OpenStreetMapProvider.as (modified) (2 diffs)
- trunk/as2/lib/com/modestmaps/mapproviders/VanillaMapProvider.as (modified) (1 diff)
- trunk/as2/lib/com/modestmaps/mapproviders/yahoo/YahooAerialMapProvider.as (modified) (2 diffs)
- trunk/as2/lib/com/modestmaps/mapproviders/yahoo/YahooHybridMapProvider.as (modified) (4 diffs)
- trunk/as2/lib/com/modestmaps/mapproviders/yahoo/YahooRoadMapProvider.as (modified) (2 diffs)
- trunk/as2/lib/mx/events (deleted)
- trunk/as2/lib/SampleClient.as (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/as2/lib/com/modestmaps/core/Tile.as
r111 r176 9 9 import com.modestmaps.events.IDispatchable; 10 10 import com.modestmaps.mapproviders.AbstractMapProvider; 11 import org.casaframework.movieclip.DispatchableMovieClip; 12 import org.casaframework.event.DispatchableInterface; 11 13 12 14 class com.modestmaps.core.Tile 13 extends MovieClip 15 extends DispatchableMovieClip 16 implements DispatchableInterface 14 17 { 15 18 public static var EVENT_PAINT_COMPLETE : String = "onPaintComplete"; … … 26 29 // Keeps track of all clips awaiting painting. 27 30 private var __displayClips : Array; 28 29 private var __paintCompleteDelegate : Function;30 31 31 32 private var __paintCall : TilePaintCall; 32 33 33 34 private var __active:Boolean; 34 35 // tracks if we're set up to broadcast events36 private static var __dispatcherInited : Boolean = false;37 38 // stubs for EventDispatcher39 public var dispatchEvent : Function;40 public var addEventListener : Function;41 public var removeEventListener : Function;42 35 43 36 public static var symbolName:String = '__Packages.com.modestmaps.core.Tile'; … … 47 40 public function Tile() 48 41 { 49 // only set up broadcasting once, in the prototype50 if ( !__dispatcherInited )51 {52 EventDispatcher.initialize( this.__proto__ );53 __dispatcherInited = true;54 }55 56 42 __active = true; 57 __displayClips = new Array(); 58 __paintCompleteDelegate = Delegate.create( this, this.onPaintComplete ); 43 __displayClips = new Array(); 59 44 } 60 45 … … 150 135 return; 151 136 152 IDispatchable(grid.mapProvider).addEventListener(AbstractMapProvider.EVENT_PAINT_COMPLETE, __paintCompleteDelegate);137 DispatchableInterface(grid.mapProvider).addEventObserver( this, AbstractMapProvider.EVENT_PAINT_COMPLETE, "onPaintComplete" ); 153 138 154 139 // cancel existing call, if any... … … 187 172 // Event Handlers 188 173 189 private function onPaintComplete( eventObj : Object) : Void174 private function onPaintComplete( clip : MovieClip, coord : Coordinate ) : Void 190 175 { 191 var coord : Coordinate = Coordinate( eventObj.coord );192 193 176 if ( this.coord.equalTo( coord ) ) 194 177 { 195 IDispatchable( grid.mapProvider ).removeEventListener( AbstractMapProvider.EVENT_PAINT_COMPLETE, __paintCompleteDelegate);178 DispatchableInterface(grid.mapProvider).removeEventObserver( this, AbstractMapProvider.EVENT_PAINT_COMPLETE, "onPaintComplete" ); 196 179 197 180 // remove all other displayClips /below/ this clip … … 210 193 } 211 194 212 // notify anyone who's listening 213 var newEventObj : Object = 214 { 215 target : this, 216 type : EVENT_PAINT_COMPLETE 217 }; 218 dispatchEvent( newEventObj ); 195 dispatchEvent( EVENT_PAINT_COMPLETE ); 219 196 } 220 197 } trunk/as2/lib/com/modestmaps/io/LoadMovieThrottledRequest.as
r162 r176 30 30 if ( clip == undefined || url == undefined || url == "" ) 31 31 { 32 var eventObj : Object = 33 { 34 target : this, 35 type : ThrottledRequest.EVENT_REQUEST_ERROR, 36 clip : this.clip 37 }; 38 dispatchEvent( eventObj ); 32 dispatchEvent( ThrottledRequest.EVENT_REQUEST_ERROR, clip ); 39 33 40 34 cleanup(); … … 70 64 private function onLoadComplete( clip : MovieClip, httpStatus : Number ) : Void 71 65 { 72 var eventObj : Object = 73 { 74 target : this, 75 type : ThrottledRequest.EVENT_RESPONSE_COMPLETE, 76 clip : clip, 77 url : url 78 }; 79 dispatchEvent( eventObj ); 66 dispatchEvent( ThrottledRequest.EVENT_RESPONSE_COMPLETE, clip, url ); 80 67 81 68 cleanup(); … … 84 71 private function onLoadError( clip : MovieClip, errorCode : String, httpStatus : Number ) : Void 85 72 { 86 var eventObj : Object = 87 { 88 target : this, 89 type : ThrottledRequest.EVENT_RESPONSE_ERROR, 90 errorCode : errorCode, 91 httpStatus : httpStatus, 92 clip: clip 93 }; 94 dispatchEvent( eventObj ); 73 dispatchEvent( ThrottledRequest.EVENT_RESPONSE_ERROR, clip, errorCode, httpStatus ); 95 74 96 75 cleanup(); trunk/as2/lib/com/modestmaps/io/MapProviderPaintThrottledRequest.as
r99 r176 18 18 } 19 19 20 private function onLoadComplete( clip : MovieClip, httpStatus : Number) : Void20 private function onLoadComplete( clip : MovieClip, url : String ) : Void 21 21 { 22 var eventObj : Object = 23 { 24 target : this, 25 type : ThrottledRequest.EVENT_RESPONSE_COMPLETE, 26 clip : clip, 27 coord : coord 28 }; 29 dispatchEvent( eventObj ); 22 dispatchEvent( ThrottledRequest.EVENT_RESPONSE_COMPLETE, clip, coord ); 30 23 31 24 cleanup(); trunk/as2/lib/com/modestmaps/io/ThrottledRequest.as
r78 r176 1 import mx.events.EventDispatcher; 1 import org.casaframework.event.EventDispatcher; 2 3 import com.modestmaps.io.IRequest; 2 4 import com.modestmaps.io.RequestThrottler; 3 import com.modestmaps.io.IRequest;4 5 5 6 /** … … 7 8 */ 8 9 class com.modestmaps.io.ThrottledRequest 10 extends EventDispatcher 9 11 implements IRequest 10 12 { 11 // tracks if we're set up to broadcast events12 private static var __dispatcherInited : Boolean = false;13 14 13 // Events 15 14 public static var EVENT_REQUEST_ERROR : String = "onRequestError"; … … 17 16 public static var EVENT_RESPONSE_ERROR : String = "onResponseError"; 18 17 19 // stubs for EventDispatcher20 public var dispatchEvent : Function;21 public var addEventListener : Function;22 public var removeEventListener : Function;23 24 18 public function ThrottledRequest() 25 19 { 26 // only set up broadcasting once, in the prototype27 if ( !__dispatcherInited )28 {29 EventDispatcher.initialize( this.__proto__ );30 __dispatcherInited = true;31 }32 20 } 33 21 trunk/as2/lib/com/modestmaps/Map.as
r160 r176 5 5 6 6 import mx.utils.Delegate; 7 import mx.events.EventDispatcher; 7 8 import org.casaframework.movieclip.DispatchableMovieClip; 9 10 import com.modestmaps.core.Coordinate; 11 import com.modestmaps.core.Point; 12 import com.modestmaps.core.TileGrid; 13 import com.modestmaps.geo.Location; 14 import com.modestmaps.mapproviders.IMapProvider; 15 import com.stamen.twisted.DelayedCall; 8 16 import com.stamen.twisted.Reactor; 9 import com.stamen.twisted.DelayedCall; 10 11 import com.modestmaps.geo.Location; 12 import com.modestmaps.core.Point; 13 import com.modestmaps.core.Marker; 14 import com.modestmaps.core.TileGrid; 15 import com.modestmaps.core.Coordinate; 16 import com.modestmaps.mapproviders.IMapProvider; 17 18 class com.modestmaps.Map extends MovieClip 17 18 class com.modestmaps.Map 19 extends DispatchableMovieClip 19 20 { 20 21 private var __width:Number = 320; … … 44 45 // Who do we get our Map graphics from? 45 46 private var __mapProvider:IMapProvider; 46 47 // stubs for EventDispatcher48 public var dispatchEvent:Function;49 public var addEventListener:Function;50 public var removeEventListener:Function;51 public static var eventLink = EventDispatcher.initialize(Map.prototype);52 47 53 48 // Events thrown … … 452 447 { 453 448 //grid.log('+ '+marker.toString()); 454 dispatchEvent( {type: EVENT_MARKER_ENTERS, id: id, location: location});449 dispatchEvent( EVENT_MARKER_ENTERS, id, location ); 455 450 } 456 451 … … 462 457 { 463 458 //grid.log('- '+marker.toString()); 464 dispatchEvent( {type: EVENT_MARKER_LEAVES, id: id, location: location});459 dispatchEvent( EVENT_MARKER_LEAVES, id, location ); 465 460 } 466 461 … … 472 467 { 473 468 //grid.log('Leaving zoom level '+grid.zoomLevel+'...'); 474 dispatchEvent( {type: EVENT_START_ZOOMING, level: grid.zoomLevel});469 dispatchEvent( EVENT_START_ZOOMING, grid.zoomLevel ); 475 470 } 476 471 477 472 /** 478 473 * Dispatches EVENT_STOP_ZOOMING when the map stops zooming. 479 * Event objectincludes level:Number.474 * Callback arguments includes level:Number. 480 475 */ 481 476 public function onStopZoom():Void 482 477 { 483 478 //grid.log('...Entering zoom level '+grid.zoomLevel); 484 dispatchEvent( {type: EVENT_STOP_ZOOMING, level: grid.zoomLevel});479 dispatchEvent( EVENT_STOP_ZOOMING, grid.zoomLevel ); 485 480 } 486 481 487 482 /** 488 483 * Dispatches EVENT_ZOOMED_BY when the map is zooomed. 489 * Event objectincludes delta:Number, difference in levels from zoom start.484 * Callback arguments includes delta:Number, difference in levels from zoom start. 490 485 */ 491 486 public function onZoomed(delta:Number):Void 492 487 { 493 488 //grid.log('Current well offset from start: '+delta.toString()); 494 dispatchEvent( {type: EVENT_ZOOMED_BY, delta: delta});489 dispatchEvent( EVENT_ZOOMED_BY, delta ); 495 490 } 496 491 … … 501 496 { 502 497 //grid.log('Starting pan...'); 503 dispatchEvent( {type: EVENT_START_PANNING});498 dispatchEvent( EVENT_START_PANNING ); 504 499 } 505 500 … … 510 505 { 511 506 //grid.log('...Stopping pan'); 512 dispatchEvent( {type: EVENT_STOP_PANNING});507 dispatchEvent( EVENT_STOP_PANNING ); 513 508 } 514 509 515 510 /** 516 511 * Dispatches EVENT_PANNED_BY when the map is panned. 517 * Event objectincludes delta:Point, difference in pixels from pan start.512 * Callback arguments includes delta:Point, difference in pixels from pan start. 518 513 */ 519 514 public function onPanned(delta:Point):Void 520 515 { 521 516 //grid.log('Current well offset from start: '+delta.toString()); 522 dispatchEvent( {type: EVENT_PANNED_BY, delta: delta});517 dispatchEvent( EVENT_PANNED_BY, delta ); 523 518 } 524 519 525 520 /** 526 521 * Dispatches EVENT_RESIZED_TO when the map is resized. 527 * Event object includeswidth:Number and height:Number.522 * Callback arguments include width:Number and height:Number. 528 523 */ 529 524 public function onResized():Void 530 525 { 531 dispatchEvent( {type: EVENT_RESIZED_TO, width: __width, height: __height});526 dispatchEvent( EVENT_RESIZED_TO, __width, __height ); 532 527 } 533 528 } trunk/as2/lib/com/modestmaps/mapproviders/AbstractImageBasedMapProvider.as
r168 r176 21 21 22 22 var request : MapProviderPaintThrottledRequest = new MapProviderPaintThrottledRequest( clip.image, getTileUrl( coord ), coord ); 23 request.addEvent Listener( MapProviderPaintThrottledRequest.EVENT_REQUEST_ERROR, Delegate.create( this, this.onRequestError ));24 request.addEvent Listener( MapProviderPaintThrottledRequest.EVENT_RESPONSE_COMPLETE, Delegate.create( this, this.onResponseComplete ));25 request.addEvent Listener( MapProviderPaintThrottledRequest.EVENT_RESPONSE_ERROR, Delegate.create( this, this.onResponseError ));23 request.addEventObserver( this, MapProviderPaintThrottledRequest.EVENT_REQUEST_ERROR, "onRequestError"); 24 request.addEventObserver( this, MapProviderPaintThrottledRequest.EVENT_RESPONSE_COMPLETE, "onResponseComplete"); 25 request.addEventObserver( this, MapProviderPaintThrottledRequest.EVENT_RESPONSE_ERROR, "onResponseError"); 26 26 request.send(); 27 27 … … 40 40 // Event Handlers 41 41 42 private function onRequestError( eventObj : Object) : Void42 private function onRequestError( clip : MovieClip ) : Void 43 43 { 44 paintFailure( eventObj.clip);44 paintFailure( clip ); 45 45 } 46 46 47 private function onResponseComplete( eventObj : Object) : Void47 private function onResponseComplete( clip : MovieClip, coordinate : Coordinate ) : Void 48 48 { 49 raisePaintComplete( eventObj.clip, eventObj.coord);49 raisePaintComplete( clip, coordinate ); 50 50 } 51 51 52 private function onResponseError( eventObj : Object) : Void52 private function onResponseError( clip : MovieClip, errorCode : String, httpStatus : Number ) : Void 53 53 { 54 paintFailure( eventObj.clip);54 paintFailure(clip); 55 55 } 56 56 trunk/as2/lib/com/modestmaps/mapproviders/AbstractMapProvider.as
r140 r176 1 import mx.events.EventDispatcher; 1 import org.casaframework.event.DispatchableInterface; 2 import org.casaframework.event.EventDispatcher; 2 3 3 import com.modestmaps.mapproviders.IMapProvider;4 import com.modestmaps.io.RequestThrottler;5 4 import com.modestmaps.core.Coordinate; 6 import com.modestmaps.events.IDispatchable;7 5 import com.modestmaps.geo.IProjection; 8 6 import com.modestmaps.geo.LinearProjection; 7 import com.modestmaps.geo.Location; 9 8 import com.modestmaps.geo.Transformation; 10 import com.modestmaps. geo.Location;9 import com.modestmaps.io.RequestThrottler; 11 10 12 11 /** … … 14 13 */ 15 14 class com.modestmaps.mapproviders.AbstractMapProvider 16 implements IDispatchable 15 extends EventDispatcher 16 implements DispatchableInterface 17 17 { 18 18 // Event Types … … 25 25 private var __topLeftOutLimit:Coordinate; 26 26 private var __bottomRightInLimit:Coordinate; 27 28 // decorate the AbstractMapProvider prototype with event dispatching methods29 private static var _dispatcherInited = EventDispatcher.initialize(AbstractMapProvider.prototype);30 27 31 28 /* … … 91 88 private function raisePaintComplete( clip : MovieClip, coord : Coordinate ) : Void 92 89 { 93 var eventObj : Object = 94 { 95 target : this, 96 type : EVENT_PAINT_COMPLETE, 97 clip : clip, 98 coord : coord 99 }; 100 dispatchEvent( eventObj ); 101 } 102 103 // IDispatchable 104 public function addEventListener( type : String, handler ) : Void 105 { 106 super.addEventListener( type, handler ); 107 } 108 109 public function removeEventListener( type : String, handler ) : Void 110 { 111 super.removeEventListener( type, handler ); 112 } 113 114 public function dispatchEvent( eventObj : Object ) : Void 115 { 116 super.dispatchEvent( eventObj ); 90 dispatchEvent( EVENT_PAINT_COMPLETE, clip, coord ); 117 91 } 118 92 trunk/as2/lib/com/modestmaps/mapproviders/BlueMarbleMapProvider.as
r167 r176 1 import com.modestmaps.mapproviders.IMapProvider;2 import com.modestmaps.mapproviders.AbstractImageBasedMapProvider; 1 import org.casaframework.event.DispatchableInterface; 2 3 3 import com.modestmaps.core.Coordinate; 4 import com.modestmaps.events.IDispatchable;5 4 import com.modestmaps.geo.MercatorProjection; 6 5 import com.modestmaps.geo.Transformation; 6 import com.modestmaps.mapproviders.AbstractImageBasedMapProvider; 7 import com.modestmaps.mapproviders.IMapProvider; 7 8 8 9 /** … … 12 13 class com.modestmaps.mapproviders.BlueMarbleMapProvider 13 14 extends AbstractImageBasedMapProvider 14 implements IMapProvider, IDispatchable15 implements IMapProvider, DispatchableInterface 15 16 { 16 17 public function BlueMarbleMapProvider() trunk/as2/lib/com/modestmaps/mapproviders/google/GoogleAerialMapProvider.as
r121 r176 1 import org.casaframework.event.DispatchableInterface; 2 1 3 import com.modestmaps.core.Coordinate; 2 import com.modestmaps.geo.Location;3 4 import com.modestmaps.mapproviders.google.AbstractGoogleMapProvider; 4 5 import com.modestmaps.mapproviders.IMapProvider; 5 import com.modestmaps.events.IDispatchable;6 6 import com.modestmaps.util.BinaryUtil; 7 7 … … 11 11 class com.modestmaps.mapproviders.google.GoogleAerialMapProvider 12 12 extends AbstractGoogleMapProvider 13 implements IMapProvider, IDispatchable13 implements IMapProvider, DispatchableInterface 14 14 { 15 15 public function toString() : String trunk/as2/lib/com/modestmaps/mapproviders/google/GoogleHybridMapProvider.as
r134 r176 1 import org.casaframework.event.DispatchableInterface; 2 1 3 import com.modestmaps.core.Coordinate; 2 import com.modestmaps. geo.Location;4 import com.modestmaps.io.MapProviderPaintThrottledRequest; 3 5 import com.modestmaps.mapproviders.google.AbstractGoogleMapProvider; 6 import com.modestmaps.mapproviders.google.GoogleAerialMapProvider; 4 7 import com.modestmaps.mapproviders.IMapProvider; 5 import com.modestmaps.events.IDispatchable;6 import com.modestmaps.io.MapProviderPaintThrottledRequest;7 import mx.utils.Delegate;8 import com.modestmaps.mapproviders.google.GoogleAerialMapProvider;9 8 10 9 /** … … 13 12 class com.modestmaps.mapproviders.google.GoogleHybridMapProvider 14 13 extends AbstractGoogleMapProvider 15 implements IMapProvider, IDispatchable14 implements IMapProvider, DispatchableInterface 16 15 { 17 16 private var __gamp : GoogleAerialMapProvider; … … 34 33 35 34 var request : MapProviderPaintThrottledRequest = new MapProviderPaintThrottledRequest( clip.bg, getBGTileUrl( coord ), coord ); 36 request.addEvent Listener( MapProviderPaintThrottledRequest.EVENT_REQUEST_ERROR, Delegate.create( this, this.onRequestError ));37 request.addEvent Listener( MapProviderPaintThrottledRequest.EVENT_RESPONSE_COMPLETE, Delegate.create( this, this.onResponseComplete ));38 request.addEvent Listener( MapProviderPaintThrottledRequest.EVENT_RESPONSE_ERROR, Delegate.create( this, this.onResponseError ));35 request.addEventObserver( this, MapProviderPaintThrottledRequest.EVENT_REQUEST_ERROR, "onRequestError" ); 36 request.addEventObserver( this, MapProviderPaintThrottledRequest.EVENT_RESPONSE_COMPLETE, "onResponseComplete"); 37 request.addEventObserver( this, MapProviderPaintThrottledRequest.EVENT_RESPONSE_ERROR, "onResponseError" ); 39 38 request.send(); 40 39 41 40 request = new MapProviderPaintThrottledRequest( clip.overlay, getOverlayTileUrl( coord ), coord ); 42 request.addEvent Listener( MapProviderPaintThrottledRequest.EVENT_REQUEST_ERROR, Delegate.create( this, this.onRequestError ));43 request.addEvent Listener( MapProviderPaintThrottledRequest.EVENT_RESPONSE_COMPLETE, Delegate.create( this, this.onResponseComplete ));44 request.addEvent Listener( MapProviderPaintThrottledRequest.EVENT_RESPONSE_ERROR, Delegate.create( this, this.onResponseError ));41 request.addEventObserver( this, MapProviderPaintThrottledRequest.EVENT_REQUEST_ERROR, "onRequestError" ); 42 request.addEventObserver( this, MapProviderPaintThrottledRequest.EVENT_RESPONSE_COMPLETE, "onResponseComplete"); 43 request.addEventObserver( this, MapProviderPaintThrottledRequest.EVENT_RESPONSE_ERROR, "onResponseError" ); 45 44 request.send(); 46 45 … … 62 61 // Event Handlers 63 62 64 private function onResponseComplete( eventObj : Object) : Void63 private function onResponseComplete( clip : MovieClip, coordinate : Coordinate ) : Void 65 64 { 66 if ( eventObj.clip.bg._loaded && eventObj.clip.overlay._loaded )67 raisePaintComplete( eventObj.clip._parent, eventObj.coord);65 if ( clip.bg._loaded && clip.overlay._loaded ) 66 raisePaintComplete( clip._parent, coordinate ); 68 67 } 69 68 } trunk/as2/lib/com/modestmaps/mapproviders/google/GoogleRoadMapProvider.as
r134 r176 1 import org.casaframework.event.DispatchableInterface; 2 1 3 import com.modestmaps.core.Coordinate; 2 import com.modestmaps.geo.Location;3 4 import com.modestmaps.mapproviders.google.AbstractGoogleMapProvider; 4 5 import com.modestmaps.mapproviders.IMapProvider; 5 import com.modestmaps.events.IDispatchable;6 6 7 7 /** … … 10 10 class com.modestmaps.mapproviders.google.GoogleRoadMapProvider 11 11 extends AbstractGoogleMapProvider 12 implements IMapProvider, IDispatchable12 implements IMapProvider, DispatchableInterface 13 13 { 14 14 public function toString() : String trunk/as2/lib/com/modestmaps/mapproviders/MapProviderFactory.as
r168 r176 5 5 */ 6 6 7 import com.modestmaps.mapproviders.*; 8 import com.modestmaps.mapproviders.microsoft.*; 9 import com.modestmaps.mapproviders.google.*; 10 import com.modestmaps.mapproviders.yahoo.*; 7 import com.modestmaps.mapproviders.BlueMarbleMapProvider; 8 import com.modestmaps.mapproviders.google.GoogleAerialMapProvider; 9 import com.modestmaps.mapproviders.google.GoogleHybridMapProvider; 10 import com.modestmaps.mapproviders.google.GoogleRoadMapProvider; 11 import com.modestmaps.mapproviders.IMapProvider; 12 import com.modestmaps.mapproviders.MapProviders; 13 import com.modestmaps.mapproviders.microsoft.MicrosoftAerialMapProvider; 14 import com.modestmaps.mapproviders.microsoft.MicrosoftHybridMapProvider; 15 import com.modestmaps.mapproviders.microsoft.MicrosoftRoadMapProvider; 16 import com.modestmaps.mapproviders.OpenStreetMapProvider; 17 import com.modestmaps.mapproviders.VanillaMapProvider; 18 import com.modestmaps.mapproviders.yahoo.YahooAerialMapProvider; 19 import com.modestmaps.mapproviders.yahoo.YahooHybridMapProvider; 20 import com.modestmaps.mapproviders.yahoo.YahooRoadMapProvider; 11 21 12 22 class com.modestmaps.mapproviders.MapProviderFactory trunk/as2/lib/com/modestmaps/mapproviders/microsoft/MicrosoftAerialMapProvider.as
r114 r176 1 import org.casaframework.event.DispatchableInterface; 2 3 import com.modestmaps.core.Coordinate; 1 4 import com.modestmaps.mapproviders.IMapProvider; 2 5 import com.modestmaps.mapproviders.microsoft.AbstractMicrosoftMapProvider; 3 import com.modestmaps.core.Coordinate;4 import com.modestmaps.util.BinaryUtil;5 import com.modestmaps.events.IDispatchable;6 6 7 7 /** … … 11 11 class com.modestmaps.mapproviders.microsoft.MicrosoftAerialMapProvider 12 12 extends AbstractMicrosoftMapProvider 13 implements IMapProvider, IDispatchable13 implements IMapProvider, DispatchableInterface 14 14 { 15 15 public function toString() : String trunk/as2/lib/com/modestmaps/mapproviders/microsoft/MicrosoftHybridMapProvider.as
r114 r176 1 import org.casaframework.event.DispatchableInterface; 2 3 import com.modestmaps.core.Coordinate; 1 4 import com.modestmaps.mapproviders.IMapProvider; 2 5 import com.modestmaps.mapproviders.microsoft.AbstractMicrosoftMapProvider; 3 import com.modestmaps.core.Coordinate;4 import com.modestmaps.util.BinaryUtil;5 import com.modestmaps.events.IDispatchable;6 6 7 7 /** … … 11 11 class com.modestmaps.mapproviders.microsoft.MicrosoftHybridMapProvider 12 12 extends AbstractMicrosoftMapProvider 13 implements IMapProvider, IDispatchable13 implements IMapProvider, DispatchableInterface 14 14 { 15 15 public function toString() : String trunk/as2/lib/com/modestmaps/mapproviders/microsoft/MicrosoftRoadMapProvider.as
r114 r176 1 import org.casaframework.event.DispatchableInterface; 2 3 import com.modestmaps.core.Coordinate; 1 4 import com.modestmaps.mapproviders.IMapProvider; 2 5 import com.modestmaps.mapproviders.microsoft.AbstractMicrosoftMapProvider; 3 import com.modestmaps.core.Coordinate;4 import com.modestmaps.events.IDispatchable;5 6 6 7 … … 11 12 class com.modestmaps.mapproviders.microsoft.MicrosoftRoadMapProvider 12 13 extends AbstractMicrosoftMapProvider 13 implements IMapProvider, IDispatchable14 implements IMapProvider, DispatchableInterface 14 15 { 15 16 public function toString() : String trunk/as2/lib/com/modestmaps/mapproviders/OpenStreetMapProvider.as
r167 r176 1 import com.modestmaps.mapproviders.IMapProvider;2 import com.modestmaps.mapproviders.AbstractImageBasedMapProvider; 1 import org.casaframework.event.DispatchableInterface; 2 3 3 import com.modestmaps.core.Coordinate; 4 import com.modestmaps.events.IDispatchable;5 4 import com.modestmaps.geo.MercatorProjection; 6 5 import com.modestmaps.geo.Transformation; 6 import com.modestmaps.mapproviders.AbstractImageBasedMapProvider; 7 import com.modestmaps.mapproviders.IMapProvider; 7 8 8 9 /** … … 12 13 class com.modestmaps.mapproviders.OpenStreetMapProvider 13 14 extends AbstractImageBasedMapProvider 14 implements IMapProvider, IDispatchable15 implements IMapProvider, DispatchableInterface 15 16 { 16 17 public function OpenStreetMapProvider() trunk/as2/lib/com/modestmaps/mapproviders/VanillaMapProvider.as
r69 r176 3 3 */ 4 4 5 import org.casaframework.event.DispatchableInterface; 6 7 import com.modestmaps.core.Coordinate; 8 import com.modestmaps.mapproviders.AbstractMapProvider; 5 9 import com.modestmaps.mapproviders.IMapProvider; 6 import com.modestmaps.mapproviders.AbstractMapProvider;7 import com.modestmaps.core.Coordinate;8 import com.modestmaps.events.IDispatchable;9 10 10 11 class com.modestmaps.mapproviders.VanillaMapProvider 11 12 extends AbstractMapProvider 12 implements IMapProvider, IDispatchable13 implements IMapProvider, DispatchableInterface 13 14 { 14 15 public function paintTile( clip : MovieClip, coord : Coordinate ) : Void trunk/as2/lib/com/modestmaps/mapproviders/yahoo/YahooAerialMapProvider.as
r121 r176 1 import com.modestmaps.events.IDispatchable; 1 import org.casaframework.event.DispatchableInterface; 2 3 import com.modestmaps.core.Coordinate; 2 4 import com.modestmaps.mapproviders.IMapProvider; 3 5 import com.modestmaps.mapproviders.yahoo.AbstractYahooMapProvider; 4 import com.modestmaps.core.Coordinate;5 6 6 7 /** … … 9 10 class com.modestmaps.mapproviders.yahoo.YahooAerialMapProvider 10 11 extends AbstractYahooMapProvider 11 implements IMapProvider, IDispatchable12 implements IMapProvider, DispatchableInterface 12 13 { 13 14 public function toString() : String trunk/as2/lib/com/modestmaps/mapproviders/yahoo/YahooHybridMapProvider.as
r121 r176 1 import com.modestmaps.events.IDispatchable; 1 import org.casaframework.event.DispatchableInterface; 2 3 import com.modestmaps.core.Coordinate; 4 import com.modestmaps.io.MapProviderPaintThrottledRequest; 2 5 import com.modestmaps.mapproviders.IMapProvider; 3 6 import com.modestmaps.mapproviders.yahoo.AbstractYahooMapProvider; 4 import com.modestmaps.core.Coordinate;5 import com.modestmaps.io.MapProviderPaintThrottledRequest;6 import mx.utils.Delegate;7 7 8 8 /** … … 11 11 class com.modestmaps.mapproviders.yahoo.YahooHybridMapProvider 12 12 extends AbstractYahooMapProvider 13 implements IMapProvider, IDispatchable13 implements IMapProvider, DispatchableInterface 14 14 { 15 15 public function toString() : String … … 24 24 25 25 var request : MapProviderPaintThrottledRequest = new MapProviderPaintThrottledRequest( clip.bg, getBGTileUrl( coord ), coord ); 26 request.addEvent Listener( MapProviderPaintThrottledRequest.EVENT_REQUEST_ERROR, Delegate.create( this, this.onRequestError ));27 request.addEvent Listener( MapProviderPaintThrottledRequest.EVENT_RESPONSE_COMPLETE, Delegate.create( this, this.onResponseComplete ));28 request.addEvent Listener( MapProviderPaintThrottledRequest.EVENT_RESPONSE_ERROR, Delegate.create( this, this.onResponseError ));26 request.addEventObserver( this, MapProviderPaintThrottledRequest.EVENT_REQUEST_ERROR, "onRequestError" ); 27 request.addEventObserver( this, MapProviderPaintThrottledRequest.EVENT_RESPONSE_COMPLETE, "onResponseComplete"); 28 request.addEventObserver( this, MapProviderPaintThrottledRequest.EVENT_RESPONSE_ERROR, "onResponseError" ); 29 29 request.send(); 30 30 31 31 request = new MapProviderPaintThrottledRequest( clip.overlay, getOverlayTileUrl( coord ), coord ); 32 request.addEvent Listener( MapProviderPaintThrottledRequest.EVENT_REQUEST_ERROR, Delegate.create( this, this.onRequestError ));33 request.addEvent Listener( MapProviderPaintThrottledRequest.EVENT_RESPONSE_COMPLETE, Delegate.create( this, this.onResponseComplete ));34 request.addEvent Listener( MapProviderPaintThrottledRequest.EVENT_RESPONSE_ERROR, Delegate.create( this, this.onResponseError ));32 request.addEventObserver( this, MapProviderPaintThrottledRequest.EVENT_REQUEST_ERROR, "onRequestError" ); 33 request.addEventObserver( this, MapProviderPaintThrottledRequest.EVENT_RESPONSE_COMPLETE, "onResponseComplete"); 34 request.addEventObserver( this, MapProviderPaintThrottledRequest.EVENT_RESPONSE_ERROR, "onResponseError" ); 35 35 request.send(); 36 36 … … 61 61 // Event Handlers 62 62 63 private function onResponseComplete( eventObj : Object) : Void63 private function onResponseComplete( clip : MovieClip, coordinate : Coordinate ) : Void 64 64 { 65 if ( eventObj.clip.bg._loaded && eventObj.clip.overlay._loaded )66 raisePaintComplete( eventObj.clip._parent, eventObj.coord);65 if ( clip.bg._loaded && clip.overlay._loaded ) 66 raisePaintComplete( clip._parent, coordinate ); 67 67 } 68 68 } trunk/as2/lib/com/modestmaps/mapproviders/yahoo/YahooRoadMapProvider.as
r121 r176 1 import org.casaframework.event.DispatchableInterface; 2 1 3 import com.modestmaps.core.Coordinate; 2 import com.modestmaps.events.IDispatchable;3 import com.modestmaps.geo.Location;4 4 import com.modestmaps.mapproviders.IMapProvider; 5 5 import com.modestmaps.mapproviders.yahoo.AbstractYahooMapProvider; … … 10 10 class com.modestmaps.mapproviders.yahoo.YahooRoadMapProvider 11 11 extends AbstractYahooMapProvider 12 implements IMapProvider, IDispatchable12 implements IMapProvider, DispatchableInterface 13 13 { 14 14 public function toString() : String trunk/as2/lib/SampleClient.as
r172 r176 1 1 import mx.utils.Delegate; 2 3 import com.modestmaps.core.Point; 4 import com.modestmaps.geo.Location; 5 import com.modestmaps.Map; 6 import com.modestmaps.mapproviders.MapProviderFactory; 7 import com.modestmaps.mapproviders.MapProviders; 2 8 import com.stamen.twisted.Reactor; 3 import com.modestmaps.Map;4 import com.modestmaps.core.TileGrid;5 import com.modestmaps.mapproviders.MapProviders;6 import com.modestmaps.mapproviders.MapProviderFactory;7 import com.modestmaps.geo.Location;8 9 9 10 class SampleClient 10 11 { 11 12 private static var __map:Map; 13 private static var __navButtons:MovieClip; 12 14 private static var __mapButtons:MovieClip; 13 15 private static var __status:TextField; … … 19 21 __map = Map(clip.attachMovie(Map.symbolName, 'map', clip.getNextHighestDepth())); 20 22 __map.init(Stage.width-256, Stage.height-256, true, MapProviderFactory.getInstance().getMapProvider(MapProviders.GOOGLE_ROAD)); 21 __map.addEvent Listener(Map.EVENT_ZOOMED_BY, onZoomed);22 __map.addEvent Listener(Map.EVENT_STOP_ZOOMING, onStopZoom);23 __map.addEvent Listener(Map.EVENT_PANNED_BY, onPanned);24 __map.addEvent Listener(Map.EVENT_STOP_PANNING, onStopPan);25 __map.addEvent Listener(Map.EVENT_RESIZED_TO, onResized);23 __map.addEventObserver(SampleClient, Map.EVENT_ZOOMED_BY, "onZoomed"); 24 __map.addEventObserver(SampleClient, Map.EVENT_STOP_ZOOMING, "onStopZoom"); 25 __map.addEventObserver(SampleClient, Map.EVENT_PANNED_BY, "onPanned"); 26 __map.addEventObserver(SampleClient, Map.EVENT_STOP_PANNING, "onStopPan"); 27 __map.addEventObserver(SampleClient, Map.EVENT_RESIZED_TO, "onResized"); 26 28 27 29 __status = clip.createTextField('status', clip.getNextHighestDepth(), 0, 0, 600, 100); … … 38 40 //Reactor.callLater(2000, Delegate.create(__map, __map.setNewCenter), new Location(37.811411, -122.360916), 14); 39 41 40 __map
