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

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

Default MXML Propertypaths


Example
MXML usage of Polyline:
 <esri:Graphic>
     <esri:Polyline spatialReference="{new SpatialReference(4326)}">
         <mx:Array>
             <mx:Array>
                 <esri:MapPoint x="139.766" y="35.700"/>
                 <esri:MapPoint x="116.412" y="39.900"/>
                 <esri:MapPoint x="106.916" y="47.916"/>
                 <esri:MapPoint x="13" y="55.59"/>
                 <esri:MapPoint x="-122.414" y="37.784"/>
                 <esri:MapPoint x="-119.749" y="34.4289"/>
             </mx:Array>
         </mx:Array>
     </esri:Polyline>
 </esri:Graphic>

See also

MapPoint


Public Properties
 PropertyDefined by
  extent : Extent
[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
[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:Number, pointIndex:Number):MapPoint
Returns a point specified by a path and point in the path [added in version 1.3].
Polyline
  
insertPoint(pathIndex:int, pointIndex:int, point:MapPoint):void
Inserts a point into the polyline [added in version 1.3].
Polyline
  
removePath(index:int):Array
Removes a path from the polyline [added in version 1.3].
Polyline
  
removePoint(pathIndex:int, pointIndex:int):MapPoint
Removes a point from the polyline [added in version 1.3].
Polyline
  
setPoint(pathIndex:int, pointIndex:int, point:MapPoint):void
Sets (updates) an existing point in the polyline [added in version 1.3].
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]

The extent of this polyline.

Implementation
    public function get extent():Extent
pathsproperty 
paths:Array  [read-write]

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]

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. A 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:Number, pointIndex:Number):MapPoint

Returns a point specified by a path and point in the path [added in version 1.3].

Parameters
pathIndex:Number — The index of a path in a polyline.
 
pointIndex:Number — 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 [added in version 1.3].

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 [added in version 1.3]. 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 [added in version 1.3].

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 [added in version 1.3].

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