Changeset 544

Show
Ignore:
Timestamp:
04/10/08 10:26:59 (5 months ago)
Author:
tcollins
Message:

Patch for Events, and added "RemoveAllMarkers?" functions.

Fixed missing commitProperties in flex.Map

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/as3/lib/com/modestmaps/core/MarkerClip.as

    r503 r544  
    124124                delete markersByName[marker.name]; 
    125125            } 
     126            } 
     127             
     128            public function removeAllMarkers():void { 
     129                 
     130                /* Loop over all markers and remove displayObjects */ 
     131                for each(var marker:DisplayObject in markers) 
     132                { 
     133                        if(contains(marker)) 
     134                                removeChild(marker); 
     135                } 
     136                markers = new Array(); 
     137                markersByName = new Array(); 
     138                 
     139                locations = new Dictionary(); 
     140                 
     141                 
    126142            } 
    127143                 
  • trunk/as3/lib/com/modestmaps/events/MapEvent.as

    r537 r544  
    4242                public var newMapProvider:IMapProvider; 
    4343 
    44                 public function MapEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false) 
     44                public function MapEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false) 
    4545                { 
    4646                        super(type, bubbles, cancelable); 
  • trunk/as3/lib/com/modestmaps/events/MarkerEvent.as

    r447 r544  
    1919                protected var _location:Location; 
    2020                 
    21                 public function MarkerEvent(type:String, marker:DisplayObject, location:Location, bubbles:Boolean=false, cancelable:Boolean=false) 
     21                public function MarkerEvent(type:String, marker:DisplayObject, location:Location, bubbles:Boolean=true, cancelable:Boolean=false) 
    2222                { 
    2323                        super(type, bubbles, cancelable); 
  • trunk/as3/lib/com/modestmaps/flex/Map.as

    r344 r544  
    2626        import com.modestmaps.geo.*; 
    2727        import com.modestmaps.mapproviders.*; 
     28        import com.modestmaps.mapproviders.google.*; 
    2829        import com.modestmaps.mapproviders.microsoft.*; 
    29         import com.modestmaps.mapproviders.google.*; 
    3030        import com.modestmaps.mapproviders.yahoo.*; 
    3131         
    32         import flash.events.Event; 
    3332        import mx.core.UIComponent; 
    3433 
     
    6665                } 
    6766 
     67 
     68 
     69                override protected function commitProperties():void 
     70                { 
     71                        super.commitProperties(); 
     72                         
     73                        if (_map!=null) 
     74                        { 
     75                                if (mapZoomDirty) 
     76                                { 
     77                                        _map.setZoom(_zoom); 
     78                                        mapZoomDirty = false; 
     79                                } 
     80                                 
     81                                if (mapCenterDirty) 
     82                                { 
     83                                        _map.setCenter(_centerLocation); 
     84                                        mapCenterDirty = false; 
     85                                } 
     86                                 
     87                                if (mapExtentDirty) 
     88                                { 
     89                                        _map.setExtent(_extent); 
     90                                        mapExtentDirty = false; 
     91                                } 
     92                         
     93                        } 
     94                } 
     95 
     96 
    6897                /** 
    6998                 * Since we're not yet supporting the full Map interface, 
     
    245274                        invalidateProperties(); 
    246275                } 
     276                 
     277                public function get zoom():int { 
     278                        return _zoom; 
     279                } 
    247280 
    248281                protected var mapProviderDirty:Boolean = true; 
     
    345378                } 
    346379 
     380                public function removeAllMarkers():void { 
     381                        map.removeAllMakers(); 
     382                } 
     383 
    347384                /** 
    348385                 * TODO: implement our own event dispatchers here, 
  • trunk/as3/lib/com/modestmaps/Map.as

    r543 r544  
    702702                        markerClip.removeMarker(id); // also calls grid.removeMarker 
    703703                } 
     704 
     705                /**  
     706                 * Remove all markers  
     707                 */ 
     708                 
     709                public function removeAllMakers():void { 
     710                        markerClip.removeAllMarkers() 
     711                } 
    704712                 
    705713           /**