Packagecom.yahoo.maps.api.overlays
Classpublic class PolylineOverlay
InheritancePolylineOverlay Inheritance Overlay Inheritance flash.display.Sprite

Creates a map overlay which can plot lines, curves and shapes along locations over the map. The PolylineOverlay object contains a dataProvider property which consists of a series of LatLon points which, using the Graphics class, draws lines and curves to connect each point.


Example
   var overlay:PolylineOverlay = new PolylineOverlay(0x333333, 1, 2,false, false);
   overlay.dataProvider = [new LatLon(33.9455, -118.4001), new LatLon(40.6446, -73.7948), new LatLon(47.448,-122.298) ];
   _map.overlayManager.addOverlay(overlay);
  



Public Properties
 PropertyDefined by
 Inheritedcontainer : Sprite
A reference to the maps overlay container.
Overlay
  dataProvider : Array
An array of LatLon points of which the polyline will draw along.
PolylineOverlay
  fillAlpha : Number = 1
The alpha value for the fill area.
PolylineOverlay
  fillColor : uint
The hexidecimal color value for the fill area.
PolylineOverlay
  geodesic : Boolean
Determines whether the polyline will be drawn as a geodesic.
PolylineOverlay
  geodesicElements : Number
The amount of line segments that create the geodesic.
PolylineOverlay
  hasFill : Boolean
Determines whether the polyline has a fill.
PolylineOverlay
  lineAlpha : Number
The alpha value for the line.
PolylineOverlay
  lineColor : uint
The hexidecimal color value for the line.
PolylineOverlay
  lineThickness : Number
The thickness of the polyline in pixels
PolylineOverlay
  map : IYahooMap
[write-only]
PolylineOverlay
Public Methods
 MethodDefined by
  
PolylineOverlay(lineColor:uint = 0x0145DB, lineAlpha:Number = 1, lineThickness:Number = 2, geodesic:Boolean = false, hasFill:Boolean = false)
Creates a new PolylineOverlay object
PolylineOverlay
  
clear():void
Clears the polyline graphics using this.graphics.clear();
PolylineOverlay
  
Returns a clone of the overlay.
PolylineOverlay
 Inherited
destroy():void
Frees the overlays resources in preparation for garbage collection.
Overlay
  
drawBoundingBox(boundingBox:BoundingBox):void
Draws the overlay based on the northwest, northeast, southeast and southwest corners of the provided bounding box object.
PolylineOverlay
  
Returns the point-to-point distance along the polyline.
PolylineOverlay
 Inherited
Converts a LatLon point to a local XY Point
Overlay
 Inherited
Converts a local XY point to a LatLon object.
Overlay
  
Returns a BoundingBox object that contains the geographical area of the shape.
PolylineOverlay
 Inherited
lineToLatLon(latlon:LatLon):void
Draws a line using the current line style from the current drawing position to the specified LatLon location; the current drawing position is then set to the LatLon location.
Overlay
 Inherited
moveToLatLon(latlon:LatLon):void
Moves the current drawing position to the specified latitude and longitude point.
Overlay
 Inherited
Map move event handler.
Overlay
 Inherited
Map resize event handler.
Overlay
  
Map zoom event handler.
PolylineOverlay
 Inherited
Map type change event handler.
Overlay
  
redraw():void
Redraws the polyline using the assigned locations in the data provider.
PolylineOverlay
  
setProviderByMarkerSet(markers:Array):void
Sets the polyline dataProvider with the latlon properties from a marker.
PolylineOverlay
Property detail
dataProviderproperty
dataProvider:Array  [read-write]

An array of LatLon points of which the polyline will draw along.

Implementation
    public function get dataProvider():Array
    public function set dataProvider(value:Array):void
fillAlphaproperty 
public var fillAlpha:Number = 1

The alpha value for the fill area.

fillColorproperty 
public var fillColor:uint

The hexidecimal color value for the fill area.

geodesicproperty 
geodesic:Boolean  [read-write]

Determines whether the polyline will be drawn as a geodesic.

Implementation
    public function get geodesic():Boolean
    public function set geodesic(value:Boolean):void
geodesicElementsproperty 
geodesicElements:Number  [read-write]

The amount of line segments that create the geodesic. (Default=10)

Implementation
    public function get geodesicElements():Number
    public function set geodesicElements(value:Number):void
hasFillproperty 
public var hasFill:Boolean

Determines whether the polyline has a fill.

lineAlphaproperty 
public var lineAlpha:Number

The alpha value for the line.

lineColorproperty 
public var lineColor:uint

The hexidecimal color value for the line.

lineThicknessproperty 
public var lineThickness:Number

The thickness of the polyline in pixels

mapproperty 
map:IYahooMap  [write-only]Implementation
    public function set map(value:IYahooMap):void
Constructor detail
PolylineOverlay()constructor
public function PolylineOverlay(lineColor:uint = 0x0145DB, lineAlpha:Number = 1, lineThickness:Number = 2, geodesic:Boolean = false, hasFill:Boolean = false)

Creates a new PolylineOverlay object

Parameters
lineColor:uint (default = 0x0145DB) — The color of the line
 
lineAlpha:Number (default = 1) — The alpha value of the line.
 
lineThickness:Number (default = 2) — The thickness of the polyline.
 
geodesic:Boolean (default = false) — Determines whether the polyline will be drawn as a geodesic.
 
hasFill:Boolean (default = false) — Determines whether the polyline has a fill.
Method detail
clear()method
public function clear():void

Clears the polyline graphics using this.graphics.clear();

clone()method 
public function clone():PolylineOverlay

Returns a clone of the overlay.

Returns
PolylineOverlay
drawBoundingBox()method 
public function drawBoundingBox(boundingBox:BoundingBox):void

Draws the overlay based on the northwest, northeast, southeast and southwest corners of the provided bounding box object.

Parameters
boundingBox:BoundingBox

See also

BoundingBox
getDistance()method 
public function getDistance():DistanceResult

Returns the point-to-point distance along the polyline.

Returns
DistanceResult

See also

DistanceResult
getOverlayBounds()method 
public function getOverlayBounds():BoundingBox

Returns a BoundingBox object that contains the geographical area of the shape.

Returns
BoundingBox
onMapZoom()method 
public override function onMapZoom(event:YahooMapEvent):void

Map zoom event handler.

Parameters
event:YahooMapEvent
redraw()method 
public function redraw():void

Redraws the polyline using the assigned locations in the data provider.

setProviderByMarkerSet()method 
public function setProviderByMarkerSet(markers:Array):void

Sets the polyline dataProvider with the latlon properties from a marker. Ideally, you would pass _yahooMap.markerManager.markers in order to draw a line between each marker currently added to the map.

Parameters
markers:Array — An array of Marker objects.