LazMapViewer: Fix fulldemo ignoring designtime-selection of MapProvider at first run.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9328 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
64723e46e1
commit
5aaf2b4d92
@ -145,7 +145,7 @@ var
|
|||||||
|
|
||||||
function CalcIniName: String;
|
function CalcIniName: String;
|
||||||
begin
|
begin
|
||||||
Result := ChangeFileExt(Application.ExeName, '.ini');
|
Result := Application.Location + 'mapviewer_demo.ini';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -662,14 +662,15 @@ begin
|
|||||||
OpenWeatherMap_ApiKey := ini.ReadString('OpenWeatherMap', 'API_Key', '');
|
OpenWeatherMap_ApiKey := ini.ReadString('OpenWeatherMap', 'API_Key', '');
|
||||||
ThunderForest_ApiKey := ini.ReadString('ThunderForest', 'API_Key', '');
|
ThunderForest_ApiKey := ini.ReadString('ThunderForest', 'API_Key', '');
|
||||||
|
|
||||||
|
provider := ini.ReadString('MapView', 'Provider', '');
|
||||||
|
if provider <> '' then
|
||||||
|
begin
|
||||||
list := TStringList.Create;
|
list := TStringList.Create;
|
||||||
try
|
try
|
||||||
MapView.Engine.ClearMapProviders;
|
MapView.Engine.ClearMapProviders;
|
||||||
MapView.Engine.RegisterProviders;
|
MapView.Engine.RegisterProviders;
|
||||||
MapView.GetMapProviders(list);
|
MapView.GetMapProviders(list);
|
||||||
sgLayers.Columns[1].PickList.Assign(list);
|
sgLayers.Columns[1].PickList.Assign(list);
|
||||||
|
|
||||||
provider := ini.ReadString('MapView', 'Provider', MapView.MapProvider);
|
|
||||||
if MapView.Engine.MapProviderByName(provider) = nil then
|
if MapView.Engine.MapProviderByName(provider) = nil then
|
||||||
begin
|
begin
|
||||||
MessageDlg('Map provider "' + provider + '" not found.', mtError, [mbOK], 0);
|
MessageDlg('Map provider "' + provider + '" not found.', mtError, [mbOK], 0);
|
||||||
@ -679,6 +680,7 @@ begin
|
|||||||
finally
|
finally
|
||||||
list.Free;
|
list.Free;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
MapView.InactiveColor := ini.ReadInteger('MapView', 'MapBkgrColor', MapView.InactiveColor);
|
MapView.InactiveColor := ini.ReadInteger('MapView', 'MapBkgrColor', MapView.InactiveColor);
|
||||||
MapView.Zoom := ini.ReadInteger('MapView', 'Zoom', MapView.Zoom);
|
MapView.Zoom := ini.ReadInteger('MapView', 'Zoom', MapView.Zoom);
|
||||||
|
|||||||
@ -102,7 +102,7 @@
|
|||||||
<Version Value="11"/>
|
<Version Value="11"/>
|
||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
<Target>
|
<Target>
|
||||||
<Filename Value="bin\$(TargetCPU)-$(TargetOS)\MapViewer_Demo"/>
|
<Filename Value="bin\$(TargetCPU)-$(TargetOS)\MapViewer_Demo_with_Addons"/>
|
||||||
</Target>
|
</Target>
|
||||||
<SearchPaths>
|
<SearchPaths>
|
||||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user