You've already forked lazarus-ccr
LazMapViewer: Add urls for OpenWeatherMaps.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6889 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -421,7 +421,11 @@ begin
|
||||
try
|
||||
HERE_AppID := ini.ReadString('HERE', 'APP_ID', '');
|
||||
HERE_AppCode := ini.ReadString('HERE', 'APP_CODE', '');
|
||||
if (HERE_AppID <> '') and (HERE_AppCode <> '') then begin
|
||||
OpenWeatherMap_ApiKey := ini.ReadString('OpenWeatherMap', 'API_Key', '');
|
||||
|
||||
if ((HERE_AppID <> '') and (HERE_AppCode <> '')) or
|
||||
(OpenWeatherMap_ApiKey <> '') then
|
||||
begin
|
||||
MapView.Engine.ClearMapProviders;
|
||||
MapView.Engine.RegisterProviders;
|
||||
MapView.GetMapProviders(CbProviders.Items);
|
||||
@ -585,6 +589,9 @@ begin
|
||||
if HERE_AppCode <> '' then
|
||||
ini.WriteString('HERE', 'APP_CODE', HERE_AppCode);
|
||||
|
||||
if OpenWeatherMap_ApiKey <> '' then
|
||||
ini.WriteString('OpenWeatherMap', 'API_Key', OpenWeatherMap_ApiKey);
|
||||
|
||||
ini.EraseSection('Locations');
|
||||
for i := 0 to CbLocations.Items.Count-1 do
|
||||
ini.WriteString('Locations', 'Item'+IntToStr(i), CbLocations.Items[i]);
|
||||
|
@ -177,6 +177,7 @@ procedure SplitGps(AValue: Double; out ADegs, AMins, ASecs: Double);
|
||||
var
|
||||
HERE_AppID: String = '';
|
||||
HERE_AppCode: String = '';
|
||||
OpenWeatherMap_ApiKey: String = '';
|
||||
|
||||
|
||||
implementation
|
||||
@ -921,6 +922,28 @@ begin
|
||||
1, 19, 4, @GetYahooSvr);
|
||||
end;
|
||||
|
||||
if (OpenWeatherMap_ApiKey <> '') then begin
|
||||
// Registration required to access OpenWeatherMaps
|
||||
// https://home.openweathermap.org/users/sign_up
|
||||
// Store the API key found on the website in the ini file of the demo under
|
||||
// key [OpenWeatherMap] and API_Key and restart the demo
|
||||
AddMapProvider('OpenWeatherMap Clouds',
|
||||
'https://tile.openweathermap.org/map/clouds_new/%z%/%x%/%y%.png?appid=' + OpenWeatherMap_ApiKey,
|
||||
1, 19, 1, nil);
|
||||
AddMapProvider('OpenWeatherMap Precipitation',
|
||||
'https://tile.openweathermap.org/map/precipitation_new/%z%/%x%/%y%.png?appid=' + OpenWeatherMap_ApiKey,
|
||||
1, 19, 1, nil);
|
||||
AddMapProvider('OpenWeatherMap Pressure',
|
||||
'https://tile.openweathermap.org/map/pressure_new/%z%/%x%/%y%.png?appid=' + OpenWeatherMap_ApiKey,
|
||||
1, 19, 1, nil);
|
||||
AddMapProvider('OpenWeatherMap Temperature',
|
||||
'https://tile.openweathermap.org/map/temp_new/%z%/%x%/%y%.png?appid=' + OpenWeatherMap_ApiKey,
|
||||
1, 19, 1, nil);
|
||||
AddMapProvider('OpenWeatherMap Wind',
|
||||
'https://tile.openweathermap.org/map/wind_new/%z%/%x%/%y%.png?appid=' + OpenWeatherMap_ApiKey,
|
||||
1, 19, 1, nil);
|
||||
end;
|
||||
|
||||
{ The Ovi Maps (former Nokia maps) are no longer available.
|
||||
|
||||
AddMapProvider('Ovi Normal',
|
||||
|
Reference in New Issue
Block a user