Changeset 95
- Timestamp:
- 02/06/07 09:52:37 (2 years ago)
- Files:
-
- trunk/as2/lib/com/modestmaps/core/TileGrid.as (modified) (1 diff)
- trunk/as2/lib/com/modestmaps/geo/Map.as (modified) (3 diffs)
- trunk/as2/lib/com/modestmaps/mapproviders/AbstractMapProvider.as (modified) (1 diff)
- trunk/as2/lib/com/modestmaps/mapproviders/IMapProvider.as (modified) (1 diff)
- trunk/as2/lib/SampleClient.as (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/as2/lib/com/modestmaps/core/TileGrid.as
r94 r95 1025 1025 } 1026 1026 1027 public function repaintTiles():Void 1028 { 1029 var active:/*Tile*/Array = activeTiles(); 1030 1031 for(var i:Number = 0; i < active.length; i += 1) 1032 active[i].paint(mapProvider, active[i].coord); 1033 } 1034 1027 1035 private function redraw() 1028 1036 { trunk/as2/lib/com/modestmaps/geo/Map.as
r94 r95 92 92 public function setNewExtent(locations:/*Location*/Array):Void 93 93 { 94 if(!locations) 95 return; 96 94 97 var extent:Object = calculateMapExtent(locations); 95 98 grid.resetTiles(Coordinate(extent['coord']), Point(extent['point'])); … … 163 166 { 164 167 var corners:/*Location*/Array = []; 168 169 if(!mapProvider) 170 return corners; 165 171 166 172 var TL:Coordinate = grid.topLeftCoordinate(); … … 202 208 } 203 209 204 public function setMapProvider(mapProviderType:Number):Void 205 { 206 this.mapProviderType = mapProviderType; 207 var mapProviderFactory:MapProviderFactory = MapProviderFactory.getInstance(); 208 mapProvider = MapProviderFactory.getInstance().getMapProvider(mapProviderType); 210 public function setMapProvider(providerType:Number):Void 211 { 212 var previousGeometry:String = mapProvider.geometry(); 213 var extent:/*Location*/Array = getCurrentExtent(); 214 215 mapProviderType = providerType; 216 mapProvider = MapProviderFactory.getInstance().getMapProvider(mapProviderType); 209 217 grid.mapProvider = mapProvider; 218 219 if(mapProvider.geometry() == previousGeometry) { 220 grid.repaintTiles(); 221 222 } else { 223 setNewExtent(extent); 224 225 } 210 226 } 211 227 trunk/as2/lib/com/modestmaps/mapproviders/AbstractMapProvider.as
r75 r95 58 58 * String signature of the current map provider's geometric behavior. 59 59 */ 60 public function toString():String60 public function geometry():String 61 61 { 62 62 return __projection.toString(); trunk/as2/lib/com/modestmaps/mapproviders/IMapProvider.as
r75 r95 24 24 */ 25 25 public function outerLimits():/*Coordinate*/Array; 26 27 /* 28 * A string which describes the projection and transformation of a map provider. 29 */ 30 public function geometry():String; 26 31 } trunk/as2/lib/SampleClient.as
r94 r95 55 55 private static function showRoad() : Void 56 56 { 57 var extent : /*Location*/Array = __map.getCurrentExtent();58 57 __map.setMapProvider( MapProviders.MICROSOFT_ROAD ); 59 __map.setNewExtent( extent );60 58 } 61 59 62 60 private static function showAerial() : Void 63 61 { 64 var extent : /*Location*/Array = __map.getCurrentExtent();65 62 __map.setMapProvider( MapProviders.MICROSOFT_AERIAL ); 66 __map.setNewExtent( extent );67 63 } 68 64 69 65 private static function showHybrid() : Void 70 66 { 71 var extent : /*Location*/Array = __map.getCurrentExtent();72 67 __map.setMapProvider( MapProviders.MICROSOFT_HYBRID ); 73 __map.setNewExtent( extent );74 68 } 75 69
