import net.systemeD.halcyon.styleparser.*;
import net.systemeD.halcyon.connection.*;
+ /** The elastic is a visual indication of a way that the user is currently in the process of drawing. */
public class Elastic {
public var map:Map; // reference to parent map
private var _start:Point;
private var _end:Point;
+ /** Create and draw the elastic. */
public function Elastic(map:Map, start:Point, end:Point) {
this.map = map;
this._start = start;
return _end;
}
+ /** Remove all currently existing sprites */
public function removeSprites():void {
- // Remove all currently existing sprites
+
while (sprites.length>0) {
var d:DisplayObject=sprites.pop(); d.parent.removeChild(d);
}
}
+ /** Draws the elastic - a dashed line on the highest paint layer. */
public function redraw():void {
removeSprites();
- // Iterate through each sublayer, drawing any styles on that layer
- var p0:Point = start;
- var p1:Point = end;
-
// Create stroke object
var stroke:Shape = new Shape();
stroke.graphics.lineStyle(1, 0xff0000, 1, false, "normal", CapsStyle.ROUND, JointStyle.ROUND);
/** Defines map-related events. */
public class MapEvent extends Event {
+ /** Data has been requested for download. */
public static const DOWNLOAD:String = "download";
+ /** Viewport size has changed. */
public static const RESIZE:String = "resize";
+ /** Map has moved relative to viewport. */
public static const MOVE:String = "move";
+ /** Zoom level has changed. */
public static const SCALE:String = "scale";
+ /** Background imagery has moved relative to map. */
public static const NUDGE_BACKGROUND:String = "nudge_background";
+ /** Map has been created and is ready, although data is not yet downloaded. */
public static const INITIALISED:String = "initialized";
+ /** Backrgound imagery has changed to one with attribution that must not be obscured. */
public static const BUMP:String = "bump";
public static const ERROR:String = "error"; // ** FIXME - this should be a dedicated ErrorEvent class
+ /** Event-specific parameters. */
public var params:Object;
+ /** Creates event with name given by a constant, with event-specific parameters. */
public function MapEvent(eventname:String, params:Object) {
super(eventname);
this.params=params;