You've already forked lazarus-ccr
LazMapViewer: Add URLs for Google maps.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6838 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -1,11 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<CONFIG>
|
<CONFIG>
|
||||||
<ProjectOptions>
|
<ProjectOptions>
|
||||||
<Version Value="11"/>
|
<Version Value="12"/>
|
||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
<General>
|
<General>
|
||||||
|
<Flags>
|
||||||
|
<CompatibilityMode Value="True"/>
|
||||||
|
</Flags>
|
||||||
<SessionStorage Value="InProjectDir"/>
|
<SessionStorage Value="InProjectDir"/>
|
||||||
<MainUnit Value="0"/>
|
|
||||||
<Title Value="MapViewer_Demo"/>
|
<Title Value="MapViewer_Demo"/>
|
||||||
<Scaled Value="True"/>
|
<Scaled Value="True"/>
|
||||||
<ResourceType Value="res"/>
|
<ResourceType Value="res"/>
|
||||||
@@ -15,7 +17,7 @@
|
|||||||
</XPManifest>
|
</XPManifest>
|
||||||
</General>
|
</General>
|
||||||
<BuildModes Count="1">
|
<BuildModes Count="1">
|
||||||
<Item1 Name="Default" Default="True"/>
|
<Item1 Name="default" Default="True"/>
|
||||||
</BuildModes>
|
</BuildModes>
|
||||||
<PublishOptions>
|
<PublishOptions>
|
||||||
<Version Value="2"/>
|
<Version Value="2"/>
|
||||||
|
@@ -34,6 +34,7 @@ object MainForm: TMainForm
|
|||||||
BorderSpacing.Left = 8
|
BorderSpacing.Left = 8
|
||||||
BorderSpacing.Top = 8
|
BorderSpacing.Top = 8
|
||||||
BorderSpacing.Right = 8
|
BorderSpacing.Right = 8
|
||||||
|
DropDownCount = 24
|
||||||
ItemHeight = 15
|
ItemHeight = 15
|
||||||
OnChange = CbProvidersChange
|
OnChange = CbProvidersChange
|
||||||
Style = csDropDownList
|
Style = csDropDownList
|
||||||
|
@@ -259,6 +259,9 @@ var
|
|||||||
bmp: TBitmap;
|
bmp: TBitmap;
|
||||||
img: TLazIntfImage;
|
img: TLazIntfImage;
|
||||||
begin
|
begin
|
||||||
|
if not (ACanvas is TFPCustomCanvas) then
|
||||||
|
exit;
|
||||||
|
|
||||||
// Screen coordinates of the GPS point
|
// Screen coordinates of the GPS point
|
||||||
P := TMapView(Sender).LonLatToScreen(APoint.RealPoint);
|
P := TMapView(Sender).LonLatToScreen(APoint.RealPoint);
|
||||||
|
|
||||||
@@ -273,7 +276,7 @@ begin
|
|||||||
txt := APoint.Name;
|
txt := APoint.Name;
|
||||||
bmp := TBitmap.Create;
|
bmp := TBitmap.Create;
|
||||||
try
|
try
|
||||||
bmp.PixelFormat := pf32Bit;
|
// bmp.PixelFormat := pf32Bit;
|
||||||
w := bmp.Canvas.TextWidth(txt);
|
w := bmp.Canvas.TextWidth(txt);
|
||||||
h := bmp.Canvas.TextHeight(txt);
|
h := bmp.Canvas.TextHeight(txt);
|
||||||
bmp.SetSize(w, h);
|
bmp.SetSize(w, h);
|
||||||
|
@@ -68,7 +68,6 @@ var
|
|||||||
realURL: String;
|
realURL: String;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
inherited DownloadFile(Url, str);
|
|
||||||
FHttp := THTTPSend.Create;
|
FHttp := THTTPSend.Create;
|
||||||
try
|
try
|
||||||
if FUseProxy then
|
if FUseProxy then
|
||||||
|
@@ -68,7 +68,6 @@ procedure TMVDEFPC.DownloadFile(const Url: string; AStream: TStream);
|
|||||||
var
|
var
|
||||||
http: TFpHttpClient;
|
http: TFpHttpClient;
|
||||||
begin
|
begin
|
||||||
inherited;
|
|
||||||
http := TFpHttpClient.Create(nil);
|
http := TFpHttpClient.Create(nil);
|
||||||
try
|
try
|
||||||
{$IF FPC_FullVersion >= 30000}
|
{$IF FPC_FullVersion >= 30000}
|
||||||
|
@@ -761,14 +761,25 @@ end;
|
|||||||
|
|
||||||
procedure TMapViewerEngine.RegisterProviders;
|
procedure TMapViewerEngine.RegisterProviders;
|
||||||
begin
|
begin
|
||||||
AddMapProvider('Aucun','',0,30, 0);
|
// AddMapProvider('Aucun','',0,30, 0); ???
|
||||||
|
|
||||||
|
AddMapProvider('Google Normal',
|
||||||
|
'http://mt%serv%.google.com/vt/lyrs=m@145&v=w2.104&x=%x%&y=%y%&z=%z%',
|
||||||
|
0, 19, 4, nil);
|
||||||
|
AddMapProvider('Google Hybrid',
|
||||||
|
'http://mt%serv%.google.com/vt/lyrs=h@145&v=w2.104&x=%x%&y=%y%&z=%z%',
|
||||||
|
0, 19, 4, nil);
|
||||||
|
AddMapProvider('Google Physical',
|
||||||
|
'http://mt%serv%.google.com/vt/lyrs=t@145&v=w2.104&x=%x%&y=%y%&z=%z%',
|
||||||
|
0, 19, 4, nil);
|
||||||
|
|
||||||
{
|
{
|
||||||
AddMapProvider('Google Satellite','http://khm%d.google.com/kh/v=82&x=%x%&y=%y%&z=%z%&s=Ga',4);
|
|
||||||
AddMapProvider('Google Hybrid','http://khm%d.google.com/kh/v=82&x=%x%&y=%y%&z=%z%&s=Ga',4);
|
AddMapProvider('Google Hybrid','http://khm%d.google.com/kh/v=82&x=%x%&y=%y%&z=%z%&s=Ga',4);
|
||||||
AddMapProvider('Google Hybrid','http://mt%d.google.com/vt/lyrs=h@145&v=w2.104&x=%d&y=%d&z=%z%',4);
|
AddMapProvider('Google Hybrid','http://mt%d.google.com/vt/lyrs=h@145&v=w2.104&x=%d&y=%d&z=%z%',4);
|
||||||
AddMapProvider('Google physical','http://mt%d.google.com/vt/lyrs=t@145&v=w2.104&x=%d&y=%d&z=%z%',4);
|
AddMapProvider('Google physical','http://mt%d.google.com/vt/lyrs=t@145&v=w2.104&x=%d&y=%d&z=%z%',4);
|
||||||
AddMapProvider('Google Physical Hybrid','http://mt%d.google.com/vt/lyrs=t@145&v=w2.104&x=%x%&y=%y%&z=%z%',4);
|
AddMapProvider('Google Physical Hybrid','http://mt%d.google.com/vt/lyrs=t@145&v=w2.104&x=%x%&y=%y%&z=%z%',4);
|
||||||
AddMapProvider('Google Physical Hybrid','http://mt%d.google.com/vt/lyrs=h@145&v=w2.104&x=%x%&y=%y%&z=%z%',4);}
|
AddMapProvider('Google Physical Hybrid','http://mt%d.google.com/vt/lyrs=h@145&v=w2.104&x=%x%&y=%y%&z=%z%',4);
|
||||||
|
}
|
||||||
//AddMapProvider('OpenStreetMap Osmarender','http://%serv%.tah.openstreetmap.org/Tiles/tile/%z%/%x%/%y%.png',0,20,3, @getLetterSvr); // [Char(Ord('a')+Random(3)), Z, X, Y]));
|
//AddMapProvider('OpenStreetMap Osmarender','http://%serv%.tah.openstreetmap.org/Tiles/tile/%z%/%x%/%y%.png',0,20,3, @getLetterSvr); // [Char(Ord('a')+Random(3)), Z, X, Y]));
|
||||||
//AddMapProvider('Yahoo Normal','http://maps%serv%.yimg.com/hx/tl?b=1&v=4.3&.intl=en&x=%x%&y=%y%d&z=%d&r=1' , 0,20,3,@GetYahooSvr, nil, @getYahooY, @GetYahooZ); //(Z+1]));
|
//AddMapProvider('Yahoo Normal','http://maps%serv%.yimg.com/hx/tl?b=1&v=4.3&.intl=en&x=%x%&y=%y%d&z=%d&r=1' , 0,20,3,@GetYahooSvr, nil, @getYahooY, @GetYahooZ); //(Z+1]));
|
||||||
//AddMapProvider('Yahoo Satellite','http://maps%serv%.yimg.com/ae/ximg?v=1.9&t=a&s=256&.intl=en&x=%d&y=%d&z=%d&r=1', 0,20,3,@GetYahooSvr, nil, @getYahooY, @GetYahooZ); //[Random(3)+1, X, YahooY(Y), Z+1]));
|
//AddMapProvider('Yahoo Satellite','http://maps%serv%.yimg.com/ae/ximg?v=1.9&t=a&s=256&.intl=en&x=%d&y=%d&z=%d&r=1', 0,20,3,@GetYahooSvr, nil, @getYahooY, @GetYahooZ); //[Random(3)+1, X, YahooY(Y), Z+1]));
|
||||||
@@ -806,8 +817,6 @@ begin
|
|||||||
AddMapProvider('Ovi Physical',
|
AddMapProvider('Ovi Physical',
|
||||||
'http://%serv%.maptile.maps.svc.ovi.com/maptiler/v2/maptile/newest/terrain.day/%z%/%x%/%y%/256/png8',
|
'http://%serv%.maptile.maps.svc.ovi.com/maptiler/v2/maptile/newest/terrain.day/%z%/%x%/%y%/256/png8',
|
||||||
0, 20, 5, @GetLetterSvr);
|
0, 20, 5, @GetLetterSvr);
|
||||||
// AddMapProvider('Google Normal', 'http://mt%d.google.com/vt/lyrs=m@145&v=w2.104&x=%d&y=%d&z=%d', [Random(4), X, Y, Z]));
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
AddMapProvider('Yahoo Normal','http://maps%serv%.yimg.com/hx/tl?b=1&v=4.3&.intl=en&x=%x%&y=%y%d&z=%d&r=1' , 0,20,3,@GetYahooSvr, nil, @getYahooY, @GetYahooZ); //(Z+1]));
|
AddMapProvider('Yahoo Normal','http://maps%serv%.yimg.com/hx/tl?b=1&v=4.3&.intl=en&x=%x%&y=%y%d&z=%d&r=1' , 0,20,3,@GetYahooSvr, nil, @getYahooY, @GetYahooZ); //(Z+1]));
|
||||||
|
Reference in New Issue
Block a user