ArcGIS Developers

PolylineBuilder QML Type

Helper type for building immutable Polyline geometries. More...

Import Statement: import Esri.ArcGISRuntime 100.11
Since: Esri.ArcGISRuntime 100.0



Detailed Description

The spatial reference must be set before using the builder and cannot be changed after the builder contains parts. The initial shape stored in the builder can be assigned by using the geometry property. Change the contents of the shape by using the mutable PartCollection accessible from the parts property. Use the geometry property to get the immutable Polyline from the current state of this builder.

You can declare a PolylineBuilder and specify its spatial reference.

PolylineBuilder {
    id: polylineBuilderWGS84
    spatialReference: SpatialReference { wkid: 4326 }

Then, use the builder to create as many polylines as you wish. Here, it's used to create a single-part polyline.

polylineBuilderWGS84.addPointXY(-117.0, 34.0);
polylineBuilderWGS84.addPointXY(-116.0, 34.0);
polylineBuilderWGS84.addPointXY(-116.0, 35.0);

var polyline1 = polylineBuilderWGS84.geometry;

Property Documentation

parts : PartCollection

The part collection that this builder is constructing or modifying.

Feedback on this topic?