LazMapViewer: Add new properties LineColor and LineWidth to TGpsTrack. Add demo showing several individually colored tracks. Add some utility functions.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8102 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2021-09-29 15:11:12 +00:00
parent 68da1ac936
commit 9fcf5de570
12 changed files with 14439 additions and 12 deletions

View File

@@ -33,7 +33,9 @@ type
procedure ReadTrackSegment(ANode: TDOMNode; ATrack: TGpsTrack);
procedure ReadWayPoints(ANode: TDOMNode; AList: TGpsObjectList);
public
function LoadFromFile(AFileName: String; AList: TGpsObjectList): Integer;
function LoadFromFile(AFileName: String; AList: TGpsObjectList; out ABounds: TRealArea): Integer;
function LoadFromStream(AStream: TStream; AList: TGpsObjectList): Integer;
function LoadFromStream(AStream: TStream; AList: TGpsObjectList; out ABounds: TRealArea): Integer;
end;
@@ -83,6 +85,7 @@ begin
mn := 10*NUMBER[M[0]] + NUMBER[M[1]];
sec := 10*NUMBER[S[0]] + NUMBER[S[1]];
s1000 := 100*NUMBER[MS[0]] + 10*NUMBER[MS[1]] + NUMBER[MS[2]];
if (s1000 < 0) or (s1000 > 1000) then s1000 := 0;
end;
Result := EncodeDate(yr, mon, dy) + EncodeTime(hr, mn, sec, s1000);
end else
@@ -166,6 +169,13 @@ begin
end;
end;
function TGpxReader.LoadFromFile(AFileName: String; AList: TGpsObjectList): Integer;
var
area: TRealArea;
begin
Result := LoadFromFile(AFileName, AList, area);
end;
{ See LoadFromFile. }
function TGpxReader.LoadFromStream(AStream: TStream; AList: TGpsObjectList;
out ABounds: TRealArea): Integer;
@@ -190,6 +200,13 @@ begin
end;
end;
function TGpxReader.LoadFromStream(AStream: TStream; AList: TGpsObjectList): Integer;
var
area: TRealArea;
begin
Result := LoadFromStream(AStream, AList, area);
end;
procedure TGpxReader.ReadExtensions(ANode: TDOMNode; ATrack: TGpsTrack);
var
linenode: TDOMNode;