Changeset 191
- Timestamp:
- 03/21/07 09:42:26 (2 years ago)
- Files:
-
- trunk/as2/lib/com/modestmaps/Map.as (modified) (2 diffs)
- trunk/as2/lib/com/modestmaps/mapproviders/AbstractImageBasedMapProvider.as (modified) (4 diffs)
- trunk/as2/lib/com/modestmaps/mapproviders/AbstractMapProvider.as (modified) (8 diffs)
- trunk/as2/lib/com/modestmaps/mapproviders/OpenStreetMapProvider.as (modified) (2 diffs)
- trunk/as2/lib/com/modestmaps/mapproviders/VanillaMapProvider.as (modified) (3 diffs)
- trunk/LICENSE.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/as2/lib/com/modestmaps/Map.as
r189 r191 1 /* 1 /** 2 2 * vim:et sts=4 sw=4 cindent: 3 3 * @ignore … … 8 8 * com.modestmaps.Map is the base class and interface for Modest Maps. 9 9 * 10 * Correctly attaching an instance of this MovieClip subclass should result 11 * in a pannable map. Controls and event handlers must be added separately. 10 * @description Map is the base class and interface for Modest Maps. 11 * Correctly attaching an instance of this MovieClip subclass 12 * should result in a pannable map. Controls and event 13 * handlers must be added separately. 12 14 * 13 15 * @usage <code> trunk/as2/lib/com/modestmaps/mapproviders/AbstractImageBasedMapProvider.as
r177 r191 1 /** 2 * vim:et sts=4 sw=4 cindent: 3 * @ignore 4 * 5 * @author darren 6 * @author migurski 7 * 8 * AbstractImageBasedMapProvider is the base class for all MapProviders 9 * that use externally loaded images to paint Tiles. 10 * 11 * @see com.modestmaps.mapproviders.AbstractMapProvider 12 */ 13 1 14 import com.modestmaps.core.Coordinate; 2 15 import com.modestmaps.io.MapProviderPaintThrottledRequest; 3 16 import com.modestmaps.mapproviders.AbstractMapProvider; 4 17 5 /**6 * @author darren7 */8 18 class com.modestmaps.mapproviders.AbstractImageBasedMapProvider 9 19 extends AbstractMapProvider 10 20 { 11 12 function AbstractImageBasedMapProvider() { 21 /** 22 * Abstract constructor, should not be instantiated directly. 23 */ 24 function AbstractImageBasedMapProvider() 25 { 13 26 super(); 14 27 } 15 28 29 /** 30 * Generates a new MapProviderPaintThrottledRequest to load in an 31 * external image. 32 * 33 * @see com.modestmaps.mapproviders.AbstractMapProvider 34 * @param clip The MovieClip to contain the graphics. 35 * @param coord The coordinate of the Tile that contains the clip. 36 37 */ 16 38 public function paint( clip : MovieClip, coord : Coordinate ) : Void 17 39 { … … 38 60 // Event Handlers 39 61 62 /** 63 * Event handler for MapProviderPaintThrottledRequest.EVENT_REQUEST_ERROR 64 */ 40 65 private function onRequestError( clip : MovieClip ) : Void 41 66 { … … 43 68 } 44 69 70 /** 71 * Event handler for MapProviderPaintThrottledRequest.EVENT_RESPONSE_COMPLETE 72 */ 45 73 private function onResponseComplete( clip : MovieClip, coordinate : Coordinate ) : Void 46 74 { … … 48 76 } 49 77 78 /** 79 * Event handler for MapProviderPaintThrottledRequest.EVENT_RESPONSE_ERROR 80 */ 50 81 private function onResponseError( clip : MovieClip, errorCode : String, httpStatus : Number ) : Void 51 82 { trunk/as2/lib/com/modestmaps/mapproviders/AbstractMapProvider.as
r179 r191 1 /** 2 * vim:et sts=4 sw=4 cindent: 3 * @ignore 4 * 5 * @author darren 6 * @author migurski 7 * 8 * AbstractMapProvider is the base class for all MapProviders. 9 * 10 * @description AbstractMapProvider is the base class for all 11 * MapProviders. MapProviders are primarily responsible 12 * for "painting" map Tiles with the correct 13 * graphic imagery. 14 */ 15 1 16 import org.casaframework.event.DispatchableInterface; 2 17 import org.casaframework.event.EventDispatcher; … … 9 24 import com.modestmaps.io.RequestThrottler; 10 25 11 /**12 * @author darren13 */14 26 class com.modestmaps.mapproviders.AbstractMapProvider 15 27 extends EventDispatcher … … 27 39 28 40 /* 29 * Constructor.41 * Abstract constructor, should not be instantiated directly. 30 42 */ 31 43 private function AbstractMapProvider() … … 40 52 } 41 53 54 /** 55 * Paints a map graphic onto the supplied MovieClip. 56 * 57 * @param clip The MovieClip to contain the graphics. 58 * @param coord The coordinate of the Tile that contains the clip. 59 */ 42 60 public function paint( clip : MovieClip, coord : Coordinate ) : Void 43 61 { … … 53 71 } 54 72 73 /** 74 * Generates a copy of the specified coordinate. 75 * 76 * @param coord The Coordinate to copy. 77 */ 55 78 public function sourceCoordinate(coord:Coordinate):Coordinate 56 79 { … … 72 95 } 73 96 97 /** 98 * Creates a text label for debugging purposes. 99 * 100 * @param clip The MovieClip to contain the label. 101 * @param label The text the label. 102 */ 74 103 public function createLabel( clip : MovieClip, label : String ) : Void 75 104 { … … 83 112 tf.text = label; 84 113 } 85 86 // Private Methods 87 88 private function raisePaintComplete( clip : MovieClip, coord : Coordinate ) : Void 89 { 90 dispatchEvent( AbstractMapProvider.EVENT_PAINT_COMPLETE, clip, coord ); 91 } 92 114 93 115 /* 94 116 * Return projected and transformed coordinate for a location. … … 106 128 return __projection.coordinateLocation(coordinate); 107 129 } 130 131 // Private Methods 132 133 private function raisePaintComplete( clip : MovieClip, coord : Coordinate ) : Void 134 { 135 dispatchEvent( AbstractMapProvider.EVENT_PAINT_COMPLETE, clip, coord ); 136 } 108 137 } trunk/as2/lib/com/modestmaps/mapproviders/OpenStreetMapProvider.as
r176 r191 1 /** 2 * MapProvider for Open Street Map data. 3 * 4 * @author migurski 5 */ 6 1 7 import org.casaframework.event.DispatchableInterface; 2 8 … … 6 12 import com.modestmaps.mapproviders.AbstractImageBasedMapProvider; 7 13 import com.modestmaps.mapproviders.IMapProvider; 8 9 /**10 * @author migurski11 */12 14 13 15 class com.modestmaps.mapproviders.OpenStreetMapProvider trunk/as2/lib/com/modestmaps/mapproviders/VanillaMapProvider.as
r176 r191 1 1 /** 2 * Provides the simplest possible graphic for a Tile, useful for debugging purposes. 3 * 2 4 * @author darren 3 5 */ … … 15 17 public function paintTile( clip : MovieClip, coord : Coordinate ) : Void 16 18 { 17 super.paint( clip, coord );19 super.paint( clip, coord ); 18 20 19 21 with ( clip ) … … 32 34 createLabel( clip, coord.toString() ); 33 35 34 // TODO: Fire even when paint is done.36 raisePaintComplete(); 35 37 } 36 38 } trunk/LICENSE.txt
r173 r191 1 1 Copyright (c) 2007 2 2 Michal Migurski (Stamen Design) 3 Darren David (Look ||Feel)3 Darren David (Look or Feel) 4 4 Shawn Allen (Stamen Design) 5 5 … … 17 17 documentation and/or other materials provided with the distribution. 18 18 19 Neither the name of Stamen Design, Look ||Feel, nor the names of its19 Neither the name of Stamen Design, Look or Feel, nor the names of its 20 20 contributors may be used to endorse or promote products derived from 21 21 this software without specific prior written permission.
