Description


Property for working with polylines on the map. Allows you to create/modify/delete polylines on the map.



 Methods and properties

 Description

 function Add: TPolylineItem

 Creates a new polyline object.

 function Bounds: TBounds

 Returns the coordinates of the rectangular area in which all the polylines are located.

 procedure Clear

 Removes all polylines from the collection. It will not remove polylines from the map. Use ClearPolylines method to remove polylines simultaneously from the map and TPolylines collection.

 property Count: Integer

 Returns the number of polylines in the collection (TPolylines).

 procedure Delete(Index: Integer)

 Deletes the specified polyline from the collection (TPolylines). To remove a polyline from the map use DeleteMapPolyline method.

 property Items[i]: TPolylineItem

 Returns the specified polyline.




Example


procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
var
    PolylineItem: TPolylineItem;
begin
    PolylineItem := Form1.Map1.Polylines.Add; // Create an object for a polyline
    PolylineItem.Polyline.Width := 2;
    PolylineItem.Polyline.Path.Add(50, 2); // add a starting point
    PolylineItem.Polyline.Path.Add(52, 4); // add a line
    PolylineItem.Polyline.Path.Add(50, 4); // add a line


    Form1.Map1.CreateMapPolyline(PolylineItem.Polyline); // display the created polyline on the map

    Form1.Map1.MapZoomTo(PolylineItem.Polyline.PathBounds); // set the map zoom to fit the created polyline
end;