Show
Ignore:
Timestamp:
12/04/07 01:53:19 (13 months ago)
Author:
gyuque
Message:

lang/actionscript/swfgmap: added events

Location:
lang/actionscript/swfgmap/trunk
Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • lang/actionscript/swfgmap/trunk/TestApp.as

    r2347 r2382  
    1515                        stage.align = StageAlign.TOP_LEFT; 
    1616                        stage.scaleMode = StageScaleMode.NO_SCALE; 
     17                         
     18                        setViewport(new GMapViewport(36.09992, 139.65497, 5)); 
     19                         
    1720                        d_outMetrics(); 
    1821                } 
  • lang/actionscript/swfgmap/trunk/gyuque/gmap/GMapView.as

    r2358 r2382  
    4040                        mLayerman = new LayerManager(); 
    4141                        addGoogleMapLayer(); 
     42 
     43                        if (options.initial_viewport) 
     44                        { 
     45                                setViewport(options.initial_viewport); 
     46                        } 
    4247                         
    4348                        hookStdEvents(); 
     49                } 
     50                 
     51                protected function setViewport(v:GMapViewport):void 
     52                { 
     53                        mCurrentViewport = v; 
     54 
     55                        var e:GMapViewEvent = new GMapViewEvent(v, GMapViewEvent.VIEWPORT_CHANGED); 
     56                        dispatchEvent(e); 
    4457                } 
    4558                 
     
    5467                protected function addGoogleMapLayer():Boolean 
    5568                { 
    56                         var lyr:Layer = new Layer(); 
     69                        var lyr:Layer = new Layer(this); 
    5770                        mLayerman.push(lyr); 
    58  
     71                         
    5972                        return true; 
    6073                } 
     
    7891                protected function onMouseOut(e:MouseEvent):void 
    7992                { 
    80                         mDrag.dragging = false; 
     93                        if (e.stageX < 0 || e.stageY < 0 ||  
     94                                e.stageX >= width || e.stageY >= height) 
     95                                mDrag.dragging = false; 
    8196                } 
    8297                 
  • lang/actionscript/swfgmap/trunk/gyuque/gmap/Layer.as

    r2358 r2382  
    11package gyuque.gmap 
    22{ 
     3        import flash.events.EventDispatcher; 
     4         
    35        public class Layer 
    46        { 
     7                public function Layer(eventSrc:EventDispatcher) 
     8                { 
     9                        eventSrc.addEventListener(GMapViewEvent.VIEWPORT_CHANGED, onViewportChanged); 
     10                } 
     11                 
     12                protected function onViewportChanged(e:GMapViewEvent):void 
     13                { 
     14                         
     15                } 
    516        } 
    617}