Changeset 357
- Timestamp:
- 10/24/07 10:09:30 (11 months ago)
- Files:
-
- trunk/as3/lib/com/modestmaps/core/MarkerClip.as (modified) (9 diffs)
- trunk/as3/lib/com/modestmaps/core/Tile.as (modified) (1 diff)
- trunk/as3/lib/com/modestmaps/core/TileGrid.as (modified) (1 diff)
- trunk/as3/lib/com/modestmaps/Map.as (modified) (4 diffs)
- trunk/as3/lib/com/modestmaps/mapproviders/AbstractMapProvider.as (modified) (1 diff)
- trunk/as3/lib/ModestMapsSample.as (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/as3/lib/com/modestmaps/core/MarkerClip.as
r346 r357 6 6 package com.modestmaps.core { 7 7 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; 8 14 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; 13 16 import flash.geom.Point; 14 import com.modestmaps.events.MarkerEvent;15 import flash.events.Event;16 17 import flash.utils.Dictionary; 17 import flash.display.DisplayObject;18 import flash.utils.getTimer;19 import flash.geom.Rectangle;20 18 21 19 /** This is different from the as2 version for now, because … … 27 25 { 28 26 // TODO: mask me? 29 pr ivatevar map:Map;27 protected var map:Map; 30 28 private var starting:Point; 31 29 private var locations:Dictionary = new Dictionary(); 32 pr ivatevar markers:Array = []; // all markers30 protected var markers:Array = []; // all markers 33 31 private var markersByName:Object = {}; 34 32 … … 57 55 public function attachMarker(marker:DisplayObject, location:Location):void 58 56 { 57 // TODO: optionally index markers and throw marker events? 59 58 //map.grid.putMarker(marker.name, map.getMapProvider().locationCoordinate(location), location); 60 59 … … 94 93 } 95 94 96 p rivatefunction updateClips(event:Event=null):void95 public function updateClips(event:Event=null):void 97 96 { 98 97 //var t:int = flash.utils.getTimer(); … … 149 148 } 150 149 151 p ublicfunction onMapStartPanning(event:MapEvent):void150 private function onMapStartPanning(event:MapEvent):void 152 151 { 153 152 starting = new Point(x, y); 154 153 } 155 154 156 p ublicfunction onMapPanned(event:MapEvent):void155 private function onMapPanned(event:MapEvent):void 157 156 { 158 157 if (starting) { … … 166 165 } 167 166 168 p ublicfunction onMapStopPanning(event:MapEvent):void167 private function onMapStopPanning(event:MapEvent):void 169 168 { 170 169 if (starting) { … … 175 174 } 176 175 177 p ublicfunction onMapResized(event:MapEvent):void176 private function onMapResized(event:MapEvent):void 178 177 { 179 178 x = event.newSize[0]/2; … … 182 181 } 183 182 184 p ublicfunction onMapStartZooming(event:MapEvent):void183 private function onMapStartZooming(event:MapEvent):void 185 184 { 186 185 // updateClips(); 187 186 } 188 187 189 p ublicfunction onMapStopZooming(event:MapEvent):void188 private function onMapStopZooming(event:MapEvent):void 190 189 { 191 190 if (scaleZoom) { … … 195 194 } 196 195 197 p ublicfunction onMapZoomedBy(event:MapEvent):void196 private function onMapZoomedBy(event:MapEvent):void 198 197 { 199 198 if (scaleZoom) { trunk/as3/lib/com/modestmaps/core/Tile.as
r296 r357 6 6 package com.modestmaps.core 7 7 { 8 import com.modestmaps.core.Coordinate;9 import com.modestmaps.core.TileGrid;10 import com.modestmaps.core.TilePaintCall;11 8 import com.modestmaps.events.MapProviderEvent; 12 import com.modestmaps.mapproviders.AbstractMapProvider;13 9 import com.modestmaps.mapproviders.IMapProvider; 14 10 import com.stamen.twisted.Reactor; 15 16 import flash.events.EventDispatcher; 11 12 import flash.display.Sprite; 13 import flash.events.TimerEvent; 17 14 import flash.geom.Point; 18 import flash.display.Sprite;19 import flash.text.TextField;20 15 import flash.utils.Timer; 21 import flash.events.TimerEvent;22 16 23 17 public class Tile extends Sprite trunk/as3/lib/com/modestmaps/core/TileGrid.as
r345 r357 133 133 } 134 134 135 Reactor.callLater(condemnationDelay(), destroyTiles, condemnedTiles);135 Reactor.callLater(condemnationDelay(), destroyTiles, condemnedTiles); 136 136 137 137 zoomLevel = coord.zoom; trunk/as3/lib/com/modestmaps/Map.as
r340 r357 127 127 setMapProvider(provider); 128 128 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); 131 131 132 132 } … … 166 166 public function setCenterZoom(location:Location, zoom:Number):void 167 167 { 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 } 173 178 } 174 179 … … 527 532 var p:Point = locationPoint(location,this); 528 533 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); 531 536 perFrame.x /= panFrames; 532 537 perFrame.y /= panFrames; … … 534 539 } 535 540 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); 537 546 } 538 547 } trunk/as3/lib/com/modestmaps/mapproviders/AbstractMapProvider.as
r292 r357 25 25 import com.modestmaps.io.RequestThrottler; 26 26 27 import flash.display. DisplayObject;27 import flash.display.Sprite; 28 28 import flash.events.EventDispatcher; 29 import flash.text.TextColorType;30 29 import flash.text.TextField; 31 import flash.display.Sprite;32 30 33 31 internal class AbstractMapProvider trunk/as3/lib/ModestMapsSample.as
r356 r357 1 1 package { 2 2 3 import com.modestmaps.Map; 3 4 import com.modestmaps.core.MapExtent; 5 import com.modestmaps.events.MapEvent; 6 import com.modestmaps.events.MarkerEvent; 4 7 import com.modestmaps.geo.Location; 5 import com.modestmaps.Map;6 8 import com.modestmaps.mapproviders.*; 7 9 import com.modestmaps.mapproviders.google.*; 10 import com.modestmaps.mapproviders.microsoft.*; 8 11 import com.modestmaps.mapproviders.yahoo.*; 9 import com.modestmaps.mapproviders.microsoft.*;10 12 import com.stamen.twisted.Reactor; 11 import flash.geom.Point;13 12 14 import flash.display.Sprite; 13 import flash.text.TextField;14 import flash.events.MouseEvent;15 import flash.display.Stage;16 import flash.events.Event;17 15 import flash.display.StageAlign; 18 16 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; 21 20 import flash.text.TextFormat; 22 21 import flash.text.TextFormatAlign; 23 import flash.filters.GlowFilter;24 import flash.filters.BlurFilter;25 22 import flash.text.AntiAliasType; 26 23
