Changeset 357

Show
Ignore:
Timestamp:
10/24/07 10:09:30 (11 months ago)
Author:
tom
Message:

merging tweaks from Trulia Hindsight

Files:

Legend:

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

    r346 r357  
    66package com.modestmaps.core { 
    77 
     8        import com.modestmaps.Map; 
     9        import com.modestmaps.events.MapEvent; 
     10        import com.modestmaps.events.MarkerEvent; 
     11        import com.modestmaps.geo.Location; 
     12         
     13        import flash.display.DisplayObject; 
    814        import flash.display.Sprite; 
    9         import com.modestmaps.Map; 
    10         import com.modestmaps.geo.Location; 
    11         import com.modestmaps.core.MapExtent; 
    12         import com.modestmaps.events.MapEvent; 
     15        import flash.events.Event; 
    1316        import flash.geom.Point; 
    14         import com.modestmaps.events.MarkerEvent; 
    15         import flash.events.Event; 
    1617        import flash.utils.Dictionary; 
    17         import flash.display.DisplayObject; 
    18         import flash.utils.getTimer; 
    19         import flash.geom.Rectangle; 
    2018         
    2119        /** This is different from the as2 version for now, because 
     
    2725        { 
    2826                // TODO: mask me? 
    29             private var map:Map; 
     27            protected var map:Map; 
    3028            private var starting:Point; 
    3129            private var locations:Dictionary = new Dictionary(); 
    32             private var markers:Array = []; // all markers 
     30            protected var markers:Array = []; // all markers 
    3331            private var markersByName:Object = {}; 
    3432 
     
    5755            public function attachMarker(marker:DisplayObject, location:Location):void 
    5856            { 
     57                // TODO: optionally index markers and throw marker events? 
    5958                //map.grid.putMarker(marker.name, map.getMapProvider().locationCoordinate(location), location); 
    6059                 
     
    9493            } 
    9594                 
    96             private function updateClips(event:Event=null):void 
     95            public function updateClips(event:Event=null):void 
    9796            { 
    9897                //var t:int = flash.utils.getTimer(); 
     
    149148            } 
    150149                     
    151             public function onMapStartPanning(event:MapEvent):void 
     150            private function onMapStartPanning(event:MapEvent):void 
    152151            { 
    153152                starting = new Point(x, y); 
    154153            } 
    155154             
    156             public function onMapPanned(event:MapEvent):void 
     155            private function onMapPanned(event:MapEvent):void 
    157156            { 
    158157                if (starting) { 
     
    166165            } 
    167166             
    168             public function onMapStopPanning(event:MapEvent):void 
     167            private function onMapStopPanning(event:MapEvent):void 
    169168            { 
    170169                if (starting) { 
     
    175174            } 
    176175             
    177             public function onMapResized(event:MapEvent):void 
     176            private function onMapResized(event:MapEvent):void 
    178177            { 
    179178                x = event.newSize[0]/2; 
     
    182181            } 
    183182             
    184             public function onMapStartZooming(event:MapEvent):void 
     183            private function onMapStartZooming(event:MapEvent):void 
    185184            { 
    186185                // updateClips();  
    187186            } 
    188187             
    189             public function onMapStopZooming(event:MapEvent):void 
     188            private function onMapStopZooming(event:MapEvent):void 
    190189            { 
    191190                if (scaleZoom) { 
     
    195194            } 
    196195             
    197             public function onMapZoomedBy(event:MapEvent):void 
     196            private function onMapZoomedBy(event:MapEvent):void 
    198197            { 
    199198                if (scaleZoom) { 
  • trunk/as3/lib/com/modestmaps/core/Tile.as

    r296 r357  
    66package com.modestmaps.core 
    77{ 
    8     import com.modestmaps.core.Coordinate; 
    9     import com.modestmaps.core.TileGrid; 
    10     import com.modestmaps.core.TilePaintCall; 
    118    import com.modestmaps.events.MapProviderEvent; 
    12     import com.modestmaps.mapproviders.AbstractMapProvider; 
    139    import com.modestmaps.mapproviders.IMapProvider; 
    1410    import com.stamen.twisted.Reactor; 
    15  
    16     import flash.events.EventDispatcher; 
     11     
     12    import flash.display.Sprite; 
     13    import flash.events.TimerEvent; 
    1714    import flash.geom.Point; 
    18     import flash.display.Sprite; 
    19     import flash.text.TextField; 
    2015    import flash.utils.Timer; 
    21     import flash.events.TimerEvent; 
    2216     
    2317    public class Tile extends Sprite 
  • trunk/as3/lib/com/modestmaps/core/TileGrid.as

    r345 r357  
    133133                } 
    134134     
    135                 Reactor.callLater(condemnationDelay(), destroyTiles, condemnedTiles); 
     135                   Reactor.callLater(condemnationDelay(), destroyTiles, condemnedTiles); 
    136136 
    137137                zoomLevel = coord.zoom;                 
  • trunk/as3/lib/com/modestmaps/Map.as

    r340 r357  
    127127                setMapProvider(provider); 
    128128 
    129                         var extent:MapExtent = new MapExtent(85, -85, 180, -180); 
    130                 setExtent(extent); 
     129                        //var extent:MapExtent = new MapExtent(85, -85, 180, -180); 
     130                //setExtent(extent); 
    131131                 
    132132            } 
     
    166166            public function setCenterZoom(location:Location, zoom:Number):void 
    167167            { 
    168                 var center:MapPosition = coordinatePosition(__mapProvider.locationCoordinate(location).zoomTo(zoom)); 
    169                 // tell grid what the rock is cooking 
    170                 grid.resetTiles(center.coord, center.point); 
    171                 onExtentChanged(this.getExtent()); 
    172                 Reactor.callNextFrame(callCopyright); 
     168                if (zoom == grid.zoomLevel) { 
     169                    setCenter(location); 
     170                } 
     171                else { 
     172                var center:MapPosition = coordinatePosition(__mapProvider.locationCoordinate(location).zoomTo(zoom)); 
     173                // tell grid what the rock is cooking 
     174                grid.resetTiles(center.coord, center.point); 
     175                onExtentChanged(this.getExtent()); 
     176                Reactor.callNextFrame(callCopyright); 
     177            } 
    173178            } 
    174179            
     
    527532                var p:Point = locationPoint(location,this); 
    528533                if (p.x >= 0 && p.x <= getWidth() && p.y >= 0 && p.y <= getHeight()) { 
    529                         var center:Point = new Point(getWidth()/2, getHeight()/2); 
    530                         var perFrame:Point = p.subtract(center); 
     534                        var centerPoint:Point = new Point(getWidth()/2, getHeight()/2); 
     535                        var perFrame:Point = p.subtract(centerPoint); 
    531536                        perFrame.x /= panFrames; 
    532537                        perFrame.y /= panFrames; 
     
    534539                } 
    535540                else { 
    536                         setCenterZoom(location, getZoom()); 
     541                var center:MapPosition = coordinatePosition(__mapProvider.locationCoordinate(location).zoomTo(grid.zoomLevel)); 
     542                // tell grid what the rock is cooking 
     543                grid.resetTiles(center.coord, center.point); 
     544                onExtentChanged(this.getExtent()); 
     545                Reactor.callNextFrame(callCopyright); 
    537546                } 
    538547            } 
  • trunk/as3/lib/com/modestmaps/mapproviders/AbstractMapProvider.as

    r292 r357  
    2525        import com.modestmaps.io.RequestThrottler; 
    2626         
    27         import flash.display.DisplayObject
     27        import flash.display.Sprite
    2828        import flash.events.EventDispatcher; 
    29         import flash.text.TextColorType; 
    3029        import flash.text.TextField; 
    31         import flash.display.Sprite; 
    3230         
    3331        internal class AbstractMapProvider   
  • trunk/as3/lib/ModestMapsSample.as

    r356 r357  
    11package { 
    22         
     3        import com.modestmaps.Map; 
    34        import com.modestmaps.core.MapExtent; 
     5        import com.modestmaps.events.MapEvent; 
     6        import com.modestmaps.events.MarkerEvent; 
    47        import com.modestmaps.geo.Location; 
    5         import com.modestmaps.Map; 
    68        import com.modestmaps.mapproviders.*; 
    79        import com.modestmaps.mapproviders.google.*; 
     10        import com.modestmaps.mapproviders.microsoft.*; 
    811        import com.modestmaps.mapproviders.yahoo.*; 
    9         import com.modestmaps.mapproviders.microsoft.*; 
    1012        import com.stamen.twisted.Reactor; 
    11         import flash.geom.Point; 
     13         
    1214        import flash.display.Sprite; 
    13         import flash.text.TextField; 
    14         import flash.events.MouseEvent; 
    15         import flash.display.Stage; 
    16         import flash.events.Event; 
    1715        import flash.display.StageAlign; 
    1816        import flash.display.StageScaleMode; 
    19         import com.modestmaps.events.MapEvent; 
    20         import com.modestmaps.events.MarkerEvent; 
     17        import flash.events.Event; 
     18        import flash.events.MouseEvent; 
     19        import flash.text.TextField; 
    2120        import flash.text.TextFormat; 
    2221        import flash.text.TextFormatAlign; 
    23         import flash.filters.GlowFilter; 
    24         import flash.filters.BlurFilter; 
    2522        import flash.text.AntiAliasType; 
    2623