Changeset 545

Show
Ignore:
Timestamp:
04/10/08 10:32:05 (8 months ago)
Author:
tcollins
Message:

Fixed the map not redrawing when assigned a new provider (missing invalidate displayList).

Added "removeMarker" and "addMarker" functions to flex.Map (just calls the appropriate putMarker and removeMarker functions on the wrapped Map class).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/as3/lib/com/modestmaps/flex/Map.as

    r544 r545  
    3030        import com.modestmaps.mapproviders.yahoo.*; 
    3131         
     32        import flash.display.DisplayObject; 
     33         
    3234        import mx.core.UIComponent; 
    3335 
     
    337339                        mapProviderDirty = true; 
    338340                        invalidateProperties(); 
     341                        invalidateDisplayList(); 
     342                } 
     343 
     344 
     345                /** 
     346                * Adds a marker (displayObject) to the map. The marker should be a custom DisplayObject that also references any dataObjects you desire, for quick reference on MarkerEvent.CLICK 
     347                *  
     348                * @param Location Object that defines lat/long for marker 
     349                 * @param marker (DisplayObject) that is used for display. 
     350                */               
     351                 
     352                public function addMarker(location:Location, marker:DisplayObject):void { 
     353                        map.putMarker(location,marker); 
     354                } 
     355                 
     356                public function removeMarker(marker:DisplayObject):void { 
     357                        map.removeMarker(marker.name); 
    339358                } 
    340359