diff --git a/components/lazmapviewer/lazmapviewerpkg.lpk b/components/lazmapviewer/lazmapviewerpkg.lpk
index 6215e1af3..022bf2a14 100644
--- a/components/lazmapviewer/lazmapviewerpkg.lpk
+++ b/components/lazmapviewer/lazmapviewerpkg.lpk
@@ -25,7 +25,7 @@ This is a fork of MapViewer by ti_dic (https://sourceforge.net/p/roadbook/code/c
-
+
@@ -37,7 +37,7 @@ This is a fork of MapViewer by ti_dic (https://sourceforge.net/p/roadbook/code/c
-
+
@@ -53,15 +53,15 @@ This is a fork of MapViewer by ti_dic (https://sourceforge.net/p/roadbook/code/c
-
+
-
+
-
+
@@ -73,13 +73,10 @@ This is a fork of MapViewer by ti_dic (https://sourceforge.net/p/roadbook/code/c
-
+
-
-
-
diff --git a/components/lazmapviewer/source/addons/synapse_downloadengine/lazmapviewer_synapse.lpk b/components/lazmapviewer/source/addons/synapse_downloadengine/lazmapviewer_synapse.lpk
new file mode 100644
index 000000000..5e5e66042
--- /dev/null
+++ b/components/lazmapviewer/source/addons/synapse_downloadengine/lazmapviewer_synapse.lpk
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/lazmapviewer/source/addons/synapse_downloadengine/lazmapviewer_synapse.pas b/components/lazmapviewer/source/addons/synapse_downloadengine/lazmapviewer_synapse.pas
new file mode 100644
index 000000000..dcd31e01b
--- /dev/null
+++ b/components/lazmapviewer/source/addons/synapse_downloadengine/lazmapviewer_synapse.pas
@@ -0,0 +1,22 @@
+{ This file was automatically created by Lazarus. Do not edit!
+ This source is only used to compile and install the package.
+ }
+
+unit lazMapViewer_Synapse;
+
+{$warn 5023 off : no warning about unused units}
+interface
+
+uses
+ mvDLESynapse, LazarusPackageIntf;
+
+implementation
+
+procedure Register;
+begin
+ RegisterUnit('mvDLESynapse', @mvDLESynapse.Register);
+end;
+
+initialization
+ RegisterPackage('lazMapViewer_Synapse', @Register);
+end.
diff --git a/components/lazmapviewer/source/mvdlesynapse.pas b/components/lazmapviewer/source/addons/synapse_downloadengine/mvdlesynapse.pas
similarity index 83%
rename from components/lazmapviewer/source/mvdlesynapse.pas
rename to components/lazmapviewer/source/addons/synapse_downloadengine/mvdlesynapse.pas
index ab6fd9d9e..36a85c4b0 100644
--- a/components/lazmapviewer/source/mvdlesynapse.pas
+++ b/components/lazmapviewer/source/addons/synapse_downloadengine/mvdlesynapse.pas
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Library General Public License
along with this library; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1335, USA.
}
unit mvDLESynapse;
@@ -23,13 +23,13 @@ unit mvDLESynapse;
interface
uses
- mvDownloadEngine,SysUtils, Classes, httpsend;
+ mvDownloadEngine, SysUtils, Classes, httpsend;
type
{ TMVDESynapse }
- TMVDESynapse = class(TCustomDownloadEngine)
+ TMVDESynapse = class(TMvCustomDownloadEngine)
private
FProxyHost: string;
FProxyPassword: string;
@@ -40,15 +40,26 @@ type
procedure DownloadFile(const Url: string; str: TStream); override;
published
- property UseProxy: Boolean read FUseProxy write FUseProxy;
+ property UseProxy: Boolean read FUseProxy write FUseProxy default false;
property ProxyHost: string read FProxyHost write FProxyHost;
- property ProxyPort: Integer read FProxyPort write FProxyPort;
+ property ProxyPort: Integer read FProxyPort write FProxyPort default 0;
property ProxyUsername: string read FProxyUsername write FProxyUsername;
property ProxyPassword: string read FProxyPassword write FProxyPassword;
end;
+procedure Register;
+
implementation
+uses
+ mvTypes;
+
+procedure Register;
+begin
+ RegisterComponents(PALETTE_PAGE, [TMVDESynapse]);
+end;
+
+
{ TMVDESynapse }
procedure TMVDESynapse.DownloadFile(const Url: string; str: TStream);
diff --git a/components/lazmapviewer/source/mvmapviewer.pas b/components/lazmapviewer/source/mvmapviewer.pas
index 8c4fa3587..6c0915a1f 100644
--- a/components/lazmapviewer/source/mvmapviewer.pas
+++ b/components/lazmapviewer/source/mvmapviewer.pas
@@ -46,6 +46,7 @@ Type
TMapView = class(TCustomControl)
private
FDownloadEngine: TMvCustomDownloadEngine;
+ FBuiltinDownloadEngine: TMvCustomDownloadEngine;
FEngine: TMapViewerEngine;
{$IFDEF USE_RGBGRAPHICS}
Buffer: TRGB32Bitmap;
@@ -67,6 +68,7 @@ Type
function GetCacheOnDisk: boolean;
function GetCachePath: String;
function GetCenter: TRealPoint;
+ function GetDownloadEngine: TMvCustomDownloadEngine;
function GetMapProvider: String;
function GetOnCenterMove: TNotifyEvent;
function GetOnChange: TNotifyEvent;
@@ -77,6 +79,7 @@ Type
procedure SetCacheOnDisk(AValue: boolean);
procedure SetCachePath(AValue: String);
procedure SetCenter(AValue: TRealPoint);
+ procedure SetDownloadEngine(AValue: TMvCustomDownloadEngine);
procedure SetInactiveColor(AValue: TColor);
procedure SetMapProvider(AValue: String);
procedure SetOnCenterMove(AValue: TNotifyEvent);
@@ -115,7 +118,6 @@ Type
procedure ZoomOnObj(obj: TGPSObj);
procedure WaitEndOfRendering;
property Center: TRealPoint read GetCenter write SetCenter;
- property DownloadEngine: TMvCustomDownloadEngine read FDownloadEngine;
property Engine: TMapViewerEngine read FEngine;
property GPSItems: TGPSObjectList read FGPSItems;
published
@@ -123,6 +125,7 @@ Type
property Align;
property CacheOnDisk: boolean read GetCacheOnDisk write SetCacheOnDisk;
property CachePath: String read GetCachePath write SetCachePath;
+ property DownloadEngine: TMvCustomDownloadEngine read FDownloadEngine write FDownloadEngine;
property Height default 150;
property InactiveColor: TColor read FInactiveColor write SetInactiveColor;
property MapProvider: String read GetMapProvider write SetMapProvider;
@@ -335,6 +338,14 @@ begin
Result := Engine.Center;
end;
+function TMapView.GetDownloadEngine: TMvCustomDownloadEngine;
+begin
+ if FDownloadEngine = nil then
+ Result := FBuiltinDownloadEngine
+ else
+ Result := FDownloadEngine;
+end;
+
function TMapView.GetMapProvider: String;
begin
result := Engine.MapProvider;
@@ -380,6 +391,12 @@ begin
Engine.Center := AValue;
end;
+procedure TMapView.SetDownloadEngine(AValue: TMvCustomDownloadEngine);
+begin
+ FDownloadEngine := AValue;
+ FEngine.DownloadEngine := GetDownloadEngine;
+end;
+
procedure TMapView.SetInactiveColor(AValue: TColor);
begin
if FInactiveColor = AValue then
@@ -736,7 +753,7 @@ begin
FGPSItems.OnModified := @OnGPSItemsModified;
FInactiveColor := clWhite;
FEngine := TMapViewerEngine.Create(self);
- FdownloadEngine := TMvDEFpc.Create(self);
+ FBuiltinDownloadEngine := TMvDEFpc.Create(self);
{$IFDEF USE_RGBGRAPHICS}
Buffer := TRGB32Bitmap.Create(Width,Height);
{$ENDIF}
@@ -747,7 +764,7 @@ begin
Engine.CacheOnDisk := true;
Engine.OnDrawTile := @DoDrawTile;
Engine.DrawTitleInGuiThread := false;
- Engine.DownloadEngine := FDownloadengine;
+ Engine.DownloadEngine := FBuiltinDownloadEngine;
inherited Create(AOwner);
Width := 150;
Height := 150;
diff --git a/components/lazmapviewer/source/mvmapviewerreg.pas b/components/lazmapviewer/source/mvmapviewerreg.pas
index 89c7e12d1..86ba1d72c 100644
--- a/components/lazmapviewer/source/mvmapviewerreg.pas
+++ b/components/lazmapviewer/source/mvmapviewerreg.pas
@@ -14,14 +14,13 @@ implementation
{$R mvmapviewer_icons.res}
uses
- mvGeoNames, mvMapViewer;
+ mvTypes, mvGeoNames, mvMapViewer, mvDLEFpc;
procedure Register;
-const
- PALETTE = 'Misc';
begin
- RegisterComponents(PALETTE, [TMapView]);
- RegisterComponents(PALETTE, [TMvGeoNames]);
+ RegisterComponents(PALETTE_PAGE, [TMapView]);
+ RegisterComponents(PALETTE_PAGE, [TMvGeoNames]);
+ RegisterComponents(PALETTE_PAGE, [TMvDEFpc]);
end;
end.
diff --git a/components/lazmapviewer/source/mvtypes.pas b/components/lazmapviewer/source/mvtypes.pas
index 646fcd6b4..96b8025c3 100644
--- a/components/lazmapviewer/source/mvtypes.pas
+++ b/components/lazmapviewer/source/mvtypes.pas
@@ -29,6 +29,7 @@ uses
const
TILE_SIZE = 256;
+ PALETTE_PAGE = 'Misc';
Type
{ TArea }