Packagecom.distriqt.extension.nativemaps.objects
Classpublic class Polyline
InheritancePolyline Inheritance Object
Subclasses Polygon

Polyline object representing a line overlay for the map or a line segment of a Polygon.

You must add a minimum of 2 points for a line to be drawn. Lines with less than 2 points will be ignored by the map.



Public Properties
 PropertyDefined By
  colour : int
Defines the colour of the line as an int in the ARGB format.
Polyline
  encodedPath : String
Set an encoded string representation of the points making up this polyline.
Polyline
  geodesic : Boolean
Defines whether the line is drawn using geodesic curves (true) or the Mercator projection (false).
Polyline
  name : String
A custom name you may set for the polyline overlay to be used as a reference. This name is not used internally but simply provides a helpful way to identify overlays. NOTE: Overlay names should be unique, you are responsible for managing these.
Polyline
  points : Vector.<LatLng>
The current list of LatLng points in this line.
Polyline
  visible : Boolean
Defines whether the line is visible or not, defaults to true.
Polyline
  visibleAsInt : int
[read-only]
Polyline
  width : Number
Defines the stroke width of the line in pixels, defaults to 1.0
Polyline
  zIndex : Number
Defines the Z Index or display order of this line.
Polyline
Public Methods
 MethodDefined By
  
Polyline(width:Number = 1, colour:uint = 0xFFFFFFFF, zIndex:Number = 0, visible:Boolean = true, geodesic:Boolean = false)
Constructor
Polyline
  
Adds a new point to the line
Polyline
  
addPoints(points:Vector.<LatLng>):Polyline
Add an array of points to the line
Polyline
  
clear():void
Removes all existing line points
Polyline
  
setColour(colour:int):Polyline
Sets the colour of the line as an int in the ARGB format.
Polyline
  
setEncodedPath(encodedPath:String):Polyline
Set an encoded string representation of the points making up this polyline.
Polyline
  
setGeodesic(useGeodesic:Boolean):Polyline
Defines whether the line is drawn using geodesic curves (true) or the Mercator projection (false).
Polyline
  
setName(name:String):Polyline
Sets a name for the polyline overlay to be used as a reference.
Polyline
  
setVisibility(visible:Boolean):Polyline
Defines whether the line is visible or not, defaults to true
Polyline
  
setWidth(width:Number):Polyline
Defines the stroke width of the line in pixels, defaults to 1.0
Polyline
  
setZIndex(zIndex:Number):Polyline
Defines the Z Index or display order of this line
Polyline
Property Detail
colourproperty
colour:int

Defines the colour of the line as an int in the ARGB format.

This number should represent an ARGB colour value. For example:


Implementation
    public function get colour():int
    public function set colour(value:int):void
encodedPathproperty 
encodedPath:String

Set an encoded string representation of the points making up this polyline. This string must be of a particular format as defined here: http://developers.google.com/maps/documentation/utilities/polylinealgorithm

You can use the PolyUtil class to encode an array of LatLng objects if required

Note: Setting this will override any points you have added to the Polyline


Implementation
    public function get encodedPath():String
    public function set encodedPath(value:String):void

See also


Example
         var polyline:Polyline = new Polyline();
         polyline.colour = 0xFFFF00FF;
         polyline.encodedPath = PolyUtil.encode(pointsArray);
         
geodesicproperty 
geodesic:Boolean

Defines whether the line is drawn using geodesic curves (true) or the Mercator projection (false). (Defaults to false)

Indicates whether the segments of the polygon should be drawn as geodesics, as opposed to straight lines on the Mercator projection. A geodesic is the shortest path between two points on the Earth's surface. The geodesic curve is constructed assuming the Earth is a sphere.


Implementation
    public function get geodesic():Boolean
    public function set geodesic(value:Boolean):void
nameproperty 
name:String

A custom name you may set for the polyline overlay to be used as a reference.

This name is not used internally but simply provides a helpful way to identify overlays.

NOTE: Overlay names should be unique, you are responsible for managing these.


Implementation
    public function get name():String
    public function set name(value:String):void
pointsproperty 
points:Vector.<LatLng>

The current list of LatLng points in this line.

Points added must be in counter-clockwise order


Implementation
    public function get points():Vector.<LatLng>
    public function set points(value:Vector.<LatLng>):void

See also

com.distriqt.extension.nativemaps.LatLng
visibleproperty 
visible:Boolean

Defines whether the line is visible or not, defaults to true.


Implementation
    public function get visible():Boolean
    public function set visible(value:Boolean):void
visibleAsIntproperty 
visibleAsInt:int  [read-only]


Implementation
    public function get visibleAsInt():int
widthproperty 
width:Number

Defines the stroke width of the line in pixels, defaults to 1.0


Implementation
    public function get width():Number
    public function set width(value:Number):void
zIndexproperty 
zIndex:Number

Defines the Z Index or display order of this line.

Overlays with higher zIndex values are drawn above those with lower values.


Implementation
    public function get zIndex():Number
    public function set zIndex(value:Number):void
Constructor Detail
Polyline()Constructor
public function Polyline(width:Number = 1, colour:uint = 0xFFFFFFFF, zIndex:Number = 0, visible:Boolean = true, geodesic:Boolean = false)

Constructor

Parameters
width:Number (default = 1)
 
colour:uint (default = 0xFFFFFFFF)
 
zIndex:Number (default = 0)
 
visible:Boolean (default = true)
 
geodesic:Boolean (default = false)
Method Detail
addPoint()method
public function addPoint(point:LatLng):Polyline

Adds a new point to the line

Parameters

point:LatLng

Returns
PolylinePolyline instance for chaining

See also

com.distriqt.extension.nativemaps.LatLng
addPoints()method 
public function addPoints(points:Vector.<LatLng>):Polyline

Add an array of points to the line

Parameters

points:Vector.<LatLng> — The points to append to the line

Returns
PolylinePolyline instance for chaining

See also

com.distriqt.extension.nativemaps.LatLng
clear()method 
public function clear():void

Removes all existing line points

setColour()method 
public function setColour(colour:int):Polyline

Sets the colour of the line as an int in the ARGB format.

This number should represent an ARGB colour value. For example:

Parameters

colour:int

Returns
PolylinePolyline instance for chaining

See also

setEncodedPath()method 
public function setEncodedPath(encodedPath:String):Polyline

Set an encoded string representation of the points making up this polyline.

Parameters

encodedPath:String

Returns
PolylinePolyline instance for chaining

See also

setGeodesic()method 
public function setGeodesic(useGeodesic:Boolean):Polyline

Defines whether the line is drawn using geodesic curves (true) or the Mercator projection (false). (Defaults to false).

Parameters

useGeodesic:Boolean

Returns
PolylinePolyline instance for chaining

See also

setName()method 
public function setName(name:String):Polyline

Sets a name for the polyline overlay to be used as a reference.

Parameters

name:String

Returns
PolylinePolyline instance for chaining

See also

setVisibility()method 
public function setVisibility(visible:Boolean):Polyline

Defines whether the line is visible or not, defaults to true

Parameters

visible:Boolean

Returns
PolylinePolyline instance for chaining

See also

setWidth()method 
public function setWidth(width:Number):Polyline

Defines the stroke width of the line in pixels, defaults to 1.0

Parameters

width:Number — The width of the line in pixels

Returns
PolylinePolyline instance for chaining

See also

setZIndex()method 
public function setZIndex(zIndex:Number):Polyline

Defines the Z Index or display order of this line

Parameters

zIndex:Number

Returns
PolylinePolyline instance for chaining

See also