Changeset 140

Show
Ignore:
Timestamp:
02/28/07 15:22:59 (2 years ago)
Author:
allens
Message:

- made EventDispatcher? methods decorate AbstractMapProvider?.prototype instead of instances
- whitespace

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/as2/lib/com/modestmaps/geo/Map.as

    r138 r140  
    321321    { 
    322322        //grid.log('+ '+marker.toString()); 
    323         dispatchEvent({target: this, type: EVENT_MARKER_ENTERS, marker: marker}); 
     323        dispatchEvent({type: EVENT_MARKER_ENTERS, marker: marker}); 
    324324    } 
    325325     
     
    330330    { 
    331331        //grid.log('- '+marker.toString()); 
    332         dispatchEvent({target: this, type: EVENT_MARKER_LEAVES, marker: marker}); 
     332        dispatchEvent({type: EVENT_MARKER_LEAVES, marker: marker}); 
    333333    } 
    334334     
     
    339339    { 
    340340        //grid.log('Leaving zoom level '+zoomLevel+'...'); 
    341         dispatchEvent({target: this, type: EVENT_LEAVE_ZOOMLEVEL, level: zoomLevel}); 
     341        dispatchEvent({type: EVENT_LEAVE_ZOOMLEVEL, level: zoomLevel}); 
    342342    } 
    343343     
     
    348348    { 
    349349        //grid.log('...Entering zoom level '+zoomLevel); 
    350         dispatchEvent({target: this, type: EVENT_ENTER_ZOOMLEVEL, level: zoomLevel}); 
     350        dispatchEvent({type: EVENT_ENTER_ZOOMLEVEL, level: zoomLevel}); 
    351351    } 
    352352     
     
    357357    { 
    358358        //grid.log('Starting drag...'); 
    359         dispatchEvent({target: this, type: EVENT_START_PANNING}); 
     359        dispatchEvent({type: EVENT_START_PANNING}); 
    360360    } 
    361361     
     
    366366    { 
    367367        //grid.log('...Stopping drag'); 
    368         dispatchEvent({target: this, type: EVENT_STOP_PANNING}); 
     368        dispatchEvent({type: EVENT_STOP_PANNING}); 
    369369    } 
    370370} 
  • trunk/as2/lib/com/modestmaps/mapproviders/AbstractMapProvider.as

    r122 r140  
    2626        private var __bottomRightInLimit:Coordinate; 
    2727 
    28         // tracks if we're set up to broadcast event
    29         private static var _dispatcherInited : Boolean = false
     28        // decorate the AbstractMapProvider prototype with event dispatching method
     29        private static var _dispatcherInited = EventDispatcher.initialize(AbstractMapProvider.prototype)
    3030 
    3131        /* 
     
    3434        private function AbstractMapProvider() 
    3535        { 
    36                 // only set up broadcasting once, in the prototype 
    37                 if ( !_dispatcherInited ) 
    38                 {                
    39                         EventDispatcher.initialize( this.__proto__ ); 
    40                         _dispatcherInited = true; 
    41                 } 
    42  
    4336                __requestThrottler = RequestThrottler.getInstance(); 
    4437 
  • trunk/as2/lib/com/modestmaps/mapproviders/IMapProvider.as

    r121 r140  
    77interface com.modestmaps.mapproviders.IMapProvider  
    88{ 
    9         public function paint( clip : MovieClip, coord : Coordinate ) : Void; 
     9        public function paint(clip:MovieClip, coord:Coordinate):Void; 
    1010     
    1111   /* 
     
    3030    public function geometry():String; 
    3131     
    32     public function toString() : String; 
     32    public function toString():String; 
    3333     
    3434   /*