LazMapViewer: Fix usage of CachePath and CacheOnDisk in some example projects.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9301 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz 2024-03-29 17:53:20 +00:00
parent b1be720320
commit 67d62d9719
9 changed files with 17 additions and 39 deletions

View File

@ -14,9 +14,9 @@ object MainForm: TMainForm
Top = 0
Width = 933
Align = alClient
CachePath = '../../../../cache/'
DownloadEngine = MapView.BuiltInDLE
DrawingEngine = MapView.BuiltInDE
Layers = <>
Font.Color = clBlack
MapProvider = 'OpenStreetMap Mapnik'
UseThreads = True

View File

@ -65,13 +65,10 @@ var
crs: TCursor;
totalArea: TRealArea;
trackArea: TRealArea;
dir: String;
begin
crs := Screen.Cursor;
Screen.Cursor := crHourglass;
try
dir := ExpandFileName(Application.Location + '../../../cache/');
ForceDirectories(dir);
MapView.UseThreads := true;
MapView.MapProvider := cbProviders.Text;
MapView.Active := true;

View File

@ -44,10 +44,9 @@ object MainForm: TMainForm
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Panel1
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Panel1
AnchorSideBottom.Side = asrBottom
AnchorSideBottom.Control = Label1
Left = 0
Height = 205
Height = 184
Top = 298
Width = 363
Anchors = [akTop, akLeft, akRight, akBottom]
@ -160,6 +159,16 @@ object MainForm: TMainForm
ImageIndex = 0
OnClick = btnDeleteClick
end
object Label1: TLabel
Left = 0
Height = 15
Top = 488
Width = 363
Align = alBottom
BorderSpacing.Top = 6
Caption = 'CTRL+click in the map to measure the elevation.'
WordWrap = True
end
end
object Splitter2: TSplitter
Left = 614

View File

@ -18,6 +18,7 @@ type
cbElevDatasets: TComboBox;
DataGrid: TDrawGrid;
ImageList1: TImageList;
Label1: TLabel;
lblDatasets: TLabel;
lblURL: TLabel;
MapView: TMapView;
@ -65,12 +66,7 @@ const
{ TMainForm }
procedure TMainForm.FormCreate(Sender: TObject);
var
dir: String;
begin
dir := ExpandFileName(Application.Location + '../../../cache/');
ForceDirectories(dir);
MapView.CachePath := dir;
MapView.Center := RealPoint(47, 11);
MapView.Zoom := 8;
MapView.MapProvider := 'Google Satellite';

View File

@ -479,8 +479,6 @@ end;
procedure TMainForm.FormCreate(Sender: TObject);
var
homeDir: String;
cacheDir: String;
fn: String;
I: Integer;
begin
@ -498,14 +496,6 @@ begin
POIImage.LoadFromFile(fn);
end;
homeDir := Application.Location + '../../../'; // this should be the "examples" folder
cacheDir := homeDir + 'cache/';
if not ForceDirectories(cacheDir) then
begin
cacheDir := GetAppConfigDir(false) + 'cache/';
ForceDirectories(cacheDir);
end;
MapView.CachePath := cacheDir;
MapView.GetMapProviders(CbProviders.Items);
CbProviders.ItemIndex := CbProviders.Items.IndexOf(MapView.MapProvider);
sgLayers.Columns[1].PickList.Assign(CbProviders.Items);

View File

@ -611,7 +611,7 @@ object MainForm: TMainForm
item
ButtonStyle = cbsPickList
Title.Caption = 'Provider'
Width = 152
Width = 135
end>
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goSmoothScroll, goRowHighlight]
RowCount = 11
@ -622,7 +622,7 @@ object MainForm: TMainForm
ColWidths = (
35
66
152
135
)
Cells = (
11

View File

@ -496,8 +496,6 @@ end;
procedure TMainForm.FormCreate(Sender: TObject);
var
fn: String;
homeDir: String;
cacheDir: String;
I: Integer;
begin
cInputQueryEditSizePercents := 0;
@ -514,14 +512,6 @@ begin
POIImage.LoadFromFile(fn);
end;
homeDir := Application.Location + '../../../'; // this should be the "examples" folder
cacheDir := homeDir + 'cache/';
if not ForceDirectories(cacheDir) then
begin
cacheDir := GetAppConfigDir(false) + 'cache/';
ForceDirectories(cacheDir);
end;
MapView.CachePath := cacheDir;
MapView.GetMapProviders(CbProviders.Items);
sgLayers.Columns[1].PickList.Assign(CbProviders.Items);
CbProviders.ItemIndex := CbProviders.Items.IndexOf(MapView.MapProvider);

View File

@ -14,11 +14,11 @@ object MainForm: TMainForm
Top = 0
Width = 606
Align = alClient
CachePath = '../../../../cache/'
DefaultTrackColor = 140
DefaultTrackWidth = 3
DownloadEngine = MapView.BuiltInDLE
DrawingEngine = MapView.BuiltInDE
Layers = <>
Font.CharSet = ANSI_CHARSET
Font.Color = clBlack
Font.Pitch = fpVariable

View File

@ -70,14 +70,10 @@ end;
procedure TMainForm.FormActivate(Sender: TObject);
var
crs: TCursor;
dir: String;
begin
crs := Screen.Cursor;
Screen.Cursor := crHourglass;
try
dir := ExpandFileName(Application.Location + '../../../cache/');
ForceDirectories(dir);
MapView.CachePath := dir;
MapView.MapProvider := 'Google Maps'; //'Open Topo Map';
MapView.Active := true;