Packagecom.esri.ags.geometry
Classpublic class Polyline
InheritancePolyline Inheritance Geometry Inheritance Object

An array of paths where each path is an array of MapPoints.

Default MXML Propertypaths

View the examples

See also

MapPoint


Public Properties
 PropertyDefined By
  extent : Extent
[override] [read-only] The extent of this polyline.
Polyline
  paths : Array
An array of paths.
Polyline
 InheritedspatialReference : SpatialReference
The spatial reference of the geometry.
Geometry
  type : String
[override] [read-only] The type of geometry is POLYLINE.
Polyline
Public Methods
 MethodDefined By
  
Polyline(paths:Array = null, spatialReference:SpatialReference = null)
Creates a new Polyline object.
Polyline
  
addPath(points:Array):void
Adds a path to the polyline.
Polyline
  
getPoint(pathIndex:int, pointIndex:int):MapPoint
Returns a point specified by a path and point in the path.
Polyline
  
insertPoint(pathIndex:int, pointIndex:int, point:MapPoint):void
Inserts a point into the polyline.
Polyline
  
removePath(index:int):Array
Removes a path from the polyline.
Polyline
  
removePoint(pathIndex:int, pointIndex:int):MapPoint
Removes a point from the polyline.
Polyline
  
setPoint(pathIndex:int, pointIndex:int, point:MapPoint):void
Sets(updates) an existing point in the polyline.
Polyline
Public Constants
 ConstantDefined By
 InheritedEXTENT : String = esriGeometryEnvelope
[static] An extent is defined by xmin, ymin, xmax and ymax.
Geometry
 InheritedMAPPOINT : String = esriGeometryPoint
[static] A MapPoint is a basic point with x (often longitude), y (often latitude) and an optional spatial reference.
Geometry
 InheritedMULTIPOINT : String = esriGeometryMultipoint
[static] A multipoint consists of one or more MapPoint(s).
Geometry
 InheritedPOLYGON : String = esriGeometryPolygon
[static] A polygon is a set of areas with three or more points.
Geometry
 InheritedPOLYLINE : String = esriGeometryPolyline
[static] A polyline is set of lines with two or more points.
Geometry
Property Detail
extentproperty
extent:Extent  [read-only] [override]

The extent of this polyline.


Implementation
    public function get extent():Extent
pathsproperty 
paths:Array

An array of paths. Each path is made up of an array of two or more MapPoints.


Implementation
    public function get paths():Array
    public function set paths(value:Array):void
typeproperty 
type:String  [read-only] [override]

The type of geometry is POLYLINE.


Implementation
    public function get type():String
Constructor Detail
Polyline()Constructor
public function Polyline(paths:Array = null, spatialReference:SpatialReference = null)

Creates a new Polyline object.

Parameters
paths:Array (default = null) — Array of paths. Each path is an array of MapPoints.
 
spatialReference:SpatialReference (default = null) — The spatial reference of the polyline.
Method Detail
addPath()method
public function addPath(points:Array):void

Adds a path to the polyline. When added the index of the path is incremented by one.

Parameters

points:Array — The array of MapPoints.

getPoint()method 
public function getPoint(pathIndex:int, pointIndex:int):MapPoint

Returns a point specified by a path and point in the path.

Parameters

pathIndex:int — The index of a path in a polyline.
 
pointIndex:int — The index of a point in a path.

Returns
MapPoint — A copy of the point at the specified index.
insertPoint()method 
public function insertPoint(pathIndex:int, pointIndex:int, point:MapPoint):void

Inserts a point into the polyline.

Parameters

pathIndex:int — The index of the path to insert point.
 
pointIndex:int — The index of the inserted point.
 
point:MapPoint — The point to be inserted.

removePath()method 
public function removePath(index:int):Array

Removes a path from the polyline. The index specifies which path to remove.

Parameters

index:int — The index of the path to remove.

Returns
Array
removePoint()method 
public function removePoint(pathIndex:int, pointIndex:int):MapPoint

Removes a point from the polyline.

Parameters

pathIndex:int — The index of the path to remove point.
 
pointIndex:int — The index of the point to be removed.

Returns
MapPoint
setPoint()method 
public function setPoint(pathIndex:int, pointIndex:int, point:MapPoint):void

Sets(updates) an existing point in the polyline.

Parameters

pathIndex:int — The index of the path to update point.
 
pointIndex:int — The index of the updated point.
 
point:MapPoint — The updated point.

Examples
MXML usage of Polyline:
 <esri:Graphic>
     <esri:Polyline spatialReference="{new SpatialReference(102100)}">
         <fx:Array>
             <fx:Array>
                 <esri:MapPoint x="15558700" y="1770100"/>
                 <esri:MapPoint x="12959100" y="2261100"/>
                 <esri:MapPoint x="11901900" y="3238400"/>
                 <esri:MapPoint x="1447100" y="4244300"/>
                 <esri:MapPoint x="-13627000" y="2012200"/>
                 <esri:MapPoint x="-13330400" y="1623400"/>
                 <esri:MapPoint x="-8733100" y="-24400"/>
                 <esri:MapPoint x="-7449500" y="1175400"/>
                 <esri:MapPoint x="-6681300" y="-4460100"/>
             </fx:Array>
         </fx:Array>
     </esri:Polyline>
 </esri:Graphic>