Package | com.distriqt.extension.nativemaps.objects |
Class | public class Polyline |
Inheritance | Polyline 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.
Property | Defined 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 |
Method | Defined 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 | ||
Add an array of points to the line
| Polyline | ||
clear():void
Removes all existing line points
| 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 | ||
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 | ||
Defines the stroke width of the line in pixels, defaults to 1.0
| Polyline | ||
Defines the Z Index or display order of this line
| Polyline |
colour | property |
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:
public function get colour():int
public function set colour(value:int):void
encodedPath | property |
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
public function get encodedPath():String
public function set encodedPath(value:String):void
See also
var polyline:Polyline = new Polyline(); polyline.colour = 0xFFFF00FF; polyline.encodedPath = PolyUtil.encode(pointsArray);
geodesic | property |
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.
public function get geodesic():Boolean
public function set geodesic(value:Boolean):void
name | property |
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.
public function get name():String
public function set name(value:String):void
points | property |
points:Vector.<LatLng>
The current list of LatLng points in this line.
Points added must be in counter-clockwise order
public function get points():Vector.<LatLng>
public function set points(value:Vector.<LatLng>):void
See also
visible | property |
visible:Boolean
Defines whether the line is visible or not, defaults to true
.
public function get visible():Boolean
public function set visible(value:Boolean):void
visibleAsInt | property |
visibleAsInt:int
[read-only] public function get visibleAsInt():int
width | property |
width:Number
Defines the stroke width of the line in pixels, defaults to 1.0
public function get width():Number
public function set width(value:Number):void
zIndex | property |
zIndex:Number
Defines the Z Index or display order of this line.
Overlays with higher zIndex values are drawn above those with lower values.
public function get zIndex():Number
public function set zIndex(value:Number):void
Polyline | () | Constructor |
public function Polyline(width:Number = 1, colour:uint = 0xFFFFFFFF, zIndex:Number = 0, visible:Boolean = true, geodesic:Boolean = false)
Constructor
Parameterswidth:Number (default = 1 )
| |
colour:uint (default = 0xFFFFFFFF )
| |
zIndex:Number (default = 0 )
| |
visible:Boolean (default = true )
| |
geodesic:Boolean (default = false )
|
addPoint | () | method |
public function addPoint(point:LatLng):Polyline
Adds a new point to the line
Parameters
point:LatLng |
Polyline — Polyline instance for chaining
|
See also
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
|
Polyline — Polyline instance for chaining
|
See also
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 |
Polyline — Polyline 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 |
Polyline — Polyline 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 |
Polyline — Polyline 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 |
Polyline — Polyline 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 |
Polyline — Polyline 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
|
Polyline — Polyline 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 |
Polyline — Polyline instance for chaining
|
See also