lazmapviewer: Fix download of HERE maps with fphttpclient.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6888 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2019-05-01 15:40:15 +00:00
parent 5c2ed7f07a
commit f3098589fc
4 changed files with 24 additions and 43 deletions

View File

@ -26,16 +26,13 @@
<FormatVersion Value="2"/> <FormatVersion Value="2"/>
<Modes Count="0"/> <Modes Count="0"/>
</RunParams> </RunParams>
<RequiredPackages Count="3"> <RequiredPackages Count="2">
<Item1> <Item1>
<PackageName Value="lazMapViewer_Synapse"/> <PackageName Value="lazMapViewerPkg"/>
</Item1> </Item1>
<Item2> <Item2>
<PackageName Value="lazMapViewerPkg"/>
</Item2>
<Item3>
<PackageName Value="LCL"/> <PackageName Value="LCL"/>
</Item3> </Item2>
</RequiredPackages> </RequiredPackages>
<Units Count="4"> <Units Count="4">
<Unit0> <Unit0>

View File

@ -617,7 +617,7 @@ object MainForm: TMainForm
Align = alClient Align = alClient
CacheOnDisk = True CacheOnDisk = True
CachePath = 'cache/' CachePath = 'cache/'
DownloadEngine = MVDESynapse1 DownloadEngine = MapView.BuiltIn
InactiveColor = clWhite InactiveColor = clWhite
MapProvider = 'OpenStreetMap Mapnik' MapProvider = 'OpenStreetMap Mapnik'
UseThreads = True UseThreads = True
@ -634,8 +634,4 @@ object MainForm: TMainForm
left = 328 left = 328
top = 224 top = 224
end end
object MVDESynapse1: TMVDESynapse
left = 347
top = 131
end
end end

View File

@ -7,7 +7,7 @@ interface
uses uses
Classes, SysUtils, Types, Forms, Controls, Graphics, Dialogs, Classes, SysUtils, Types, Forms, Controls, Graphics, Dialogs,
ExtCtrls, StdCtrls, ComCtrls, Buttons, ExtCtrls, StdCtrls, ComCtrls, Buttons,
mvGeoNames, mvMapViewer, mvTypes, mvGpsObj, mvDLESynapse; mvGeoNames, mvMapViewer, mvTypes, mvGpsObj;
type type
@ -49,7 +49,6 @@ type
ControlPanel: TPanel; ControlPanel: TPanel;
BtnLoadMapProviders: TSpeedButton; BtnLoadMapProviders: TSpeedButton;
BtnSaveMapProviders: TSpeedButton; BtnSaveMapProviders: TSpeedButton;
MVDESynapse1: TMVDESynapse;
ZoomTrackBar: TTrackBar; ZoomTrackBar: TTrackBar;
procedure BtnGoToClick(Sender: TObject); procedure BtnGoToClick(Sender: TObject);
procedure BtnSearchClick(Sender: TObject); procedure BtnSearchClick(Sender: TObject);

View File

@ -846,6 +846,8 @@ begin
end; end;
procedure TMapViewerEngine.RegisterProviders; procedure TMapViewerEngine.RegisterProviders;
var
HERE1, HERE2: String;
begin begin
// AddMapProvider('Aucun','',0,30, 0); ??? // AddMapProvider('Aucun','',0,30, 0); ???
@ -892,7 +894,7 @@ begin
'http://a%serv%.ortho.tiles.virtualearth.net/tiles/a%x%.jpg?g=72&shading=hill', 'http://a%serv%.ortho.tiles.virtualearth.net/tiles/a%x%.jpg?g=72&shading=hill',
1, 19, 4, nil, @GetQuadKey); 1, 19, 4, nil, @GetQuadKey);
AddMapProvider('Virtual Earth Hybrid', AddMapProvider('Virtual Earth Hybrid',
'https://h%serv%.ortho.tiles.virtualearth.net/tiles/h%x%.jpg?g=72&shading=hill', 'http://h%serv%.ortho.tiles.virtualearth.net/tiles/h%x%.jpg?g=72&shading=hill',
1, 19, 4, nil, @GetQuadKey); 1, 19, 4, nil, @GetQuadKey);
if (HERE_AppID <> '') and (HERE_AppCode <> '') then begin if (HERE_AppID <> '') and (HERE_AppCode <> '') then begin
@ -901,35 +903,22 @@ begin
// Store the APP_ID and APP_CODE obtained after registration in the // Store the APP_ID and APP_CODE obtained after registration in the
// ini file of the demo under key [HERE] as items APP_ID and APP_CODE and // ini file of the demo under key [HERE] as items APP_ID and APP_CODE and
// restart the demo. // restart the demo.
AddMapProvider('Here Maps', HERE1 := 'http://%serv%.base.maps.api.here.com/maptile/2.1/maptile/newest/';
'https://%serv%.base.maps.api.here.com/maptile/2.1/maptile/newest/normal.day/%z%/%x%/%y%/256/png8' + HERE2 := '/%z%/%x%/%y%/256/png8?app_id=' + HERE_AppID + '&app_code=' + HERE_AppCode;
'?app_id=' + HERE_AppID + '&app_code=' + HERE_AppCode, AddMapProvider('Here Maps', HERE1 + 'normal.day' + HERE2,
1, 19, 4, nil); 1, 19, 4, @GetYahooSvr);
AddMapProvider('Here Maps Grey', AddMapProvider('Here Maps Grey', HERE1 + 'normal.day.grey' + HERE2,
'https://%serv%.base.maps.api.here.com/maptile/2.1/maptile/newest/normal.day.grey/%z%/%x%/%y%/256/png8' + 1, 19, 4, @GetYahooSvr);
'?app_id=' + HERE_AppID + '&app_code=' + HERE_AppCode, AddMapProvider('Here Maps Reduced', HERE1 + 'reduced.day' + HERE2,
1, 19, 4, nil); 1, 19, 4, @GetYahooSvr);
AddMapProvider('Here Maps Reduced', AddMapProvider('Here Maps Transit', HERE1 + 'normal.day.transit' + HERE2,
'https://%serv%.base.maps.api.here.com/maptile/2.1/maptile/newest/reduced.day/%z%/%x%/%y%/256/png8' + 1, 19, 4, @GetYahooSvr);
'?app_id=' + HERE_AppID + '&app_code=' + HERE_AppCode, AddMapProvider('Here POI Maps', HERE1 + 'normal.day' + HERE2 + '&pois',
1, 19, 4, nil); 1, 19, 4, @GetYahooSvr);
AddMapProvider('Here Maps Transit', AddMapProvider('Here Pedestrian Maps', HERE1 + 'pedestrian.day' + HERE2,
'https://%serv%.base.maps.api.here.com/maptile/2.1/maptile/newest/normal.day.transit/%z%/%x%/%y%/256/png8' + 1, 19, 4, @GetYahooSvr);
'?app_id=' + HERE_AppID + '&app_code=' + HERE_AppCode, AddMapProvider('Here DreamWorks Maps', HERE1 + 'normal.day' + HERE2 + '&style=dreamworks',
1, 19, 4, nil); 1, 19, 4, @GetYahooSvr);
AddMapProvider('Here POI Maps',
'https://%serv%.base.maps.api.here.com/maptile/2.1/maptile/newest/normal.day/%z%/%x%/%y%/256/png8' +
'?app_id=' + HERE_AppID + '&app_code=' + HERE_AppCode + '&pois',
1, 19, 4, nil);
AddMapProvider('Here Pedestrian Maps',
'https://%serv%.base.maps.api.here.com/maptile/2.1/maptile/newest/pedestrian.day/%z%/%x%/%y%/256/png8'+
'?app_id=' + HERE_AppID + '&app_code=' + HERE_AppCode,
1, 19, 4, nil);
{ AddMapProvider('Here DreamWorks Maps', Format(url, ['normal.day']) + '&style=dreamworks',
1, 19, 4, nil);
AddMapProvider('Here Pedestrian Maps', Format(url, ['pededrian.day']),
1, 19, 4, nil);
}
end; end;
{ The Ovi Maps (former Nokia maps) are no longer available. { The Ovi Maps (former Nokia maps) are no longer available.