property Polylines[i]: TPolylineItem
Description
Property for accessing existing polylines on the map. Allows you to change/delete polylines on the map.
Свойства |
Описание |
property Clickable: Boolean |
When set to true, enables clicking on the polyline. If the value is False, then the OnPolylineClick event will not be triggered. |
property Color: TColor |
The color of the polyline. |
property Editable: Boolean |
When set to true, the polyline can be edited. |
property Geodesic: Boolean |
When set to true, each edge is rendered as a geodesic. When set to false, render each edge as a straight line. |
property HoverColor: TColor |
The color of the polyline when hovered. |
property Opacity: Integer |
The opacity of the polyline. (values 1-100). |
property Path: TPath |
The ordered sequence of coordinates of the polyline. |
property Path[i]: TPathItem |
Returns a point with coordinates by its index. |
property PathBounds: TBounds |
Returns the coordinates of the rectangular area where the given polyline is located. |
property Tag: Integer |
Allows you to assign a number to a component for your own needs. |
property TagString: string |
Allows you to assign a string to a component for your own needs. |
property TagObject: TObject |
The object associated with the polyline |
property Width: Integer |
The width of the polyline in pixels. |
property Visible: Boolean |
When set to true, the polyline is shown on the map. |
property Zindex: Integer |
The zIndex compared to other elements on the map. |
Example
// move all polylines by 0.001 latitude and longitude
procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
var
iLine, iPath, cLine, cPath: integer;
begin
cLine := Form1.Map1.Polylines.Count-1;
for iLine := 0 to cLine do
begin
cPath := Form1.Map1.Polylines[iLine].Polyline.Path.Count-1;
for iPath := 0 to cPath do
begin
Form1.Map1.Polylines[iLine].Polyline.Path[iPath].Latitude := Form1.Map1.Polylines[iLine].Polyline.Path[iPath].Latitude + 0.001;
Form1.Map1.Polylines[iLine].Polyline.Path[iPath].Longitude := Form1.Map1.Polylines[iLine].Polyline.Path[iPath].Longitude + 0.001;
end;
Form1.Map1.UpdateMapPolyline(Form1.Map1.Polylines[iLine].Polyline); // update the polyline on the map
end;
end;