LazMapViewer: Extend LinkedMaps demo with zoom buttons.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9556 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
b96869c8fc
commit
1e6d2ffcf8
@ -78,6 +78,9 @@
|
|||||||
<Item>
|
<Item>
|
||||||
<Name Value="EFOpenError"/>
|
<Name Value="EFOpenError"/>
|
||||||
</Item>
|
</Item>
|
||||||
|
<Item>
|
||||||
|
<Name Value="EInvalidGraphic"/>
|
||||||
|
</Item>
|
||||||
</Exceptions>
|
</Exceptions>
|
||||||
</Debugging>
|
</Debugging>
|
||||||
</CONFIG>
|
</CONFIG>
|
||||||
|
@ -29,7 +29,7 @@ object MainForm: TMainForm
|
|||||||
Left = 0
|
Left = 0
|
||||||
Height = 375
|
Height = 375
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 552
|
Width = 541
|
||||||
Cyclic = True
|
Cyclic = True
|
||||||
DownloadEngine = MapView1.BuiltInDLE
|
DownloadEngine = MapView1.BuiltInDLE
|
||||||
DrawingEngine = MapView1.BuiltInDE
|
DrawingEngine = MapView1.BuiltInDE
|
||||||
@ -37,14 +37,44 @@ object MainForm: TMainForm
|
|||||||
Font.Color = clBlack
|
Font.Color = clBlack
|
||||||
MapProvider = 'OpenStreetMap Mapnik'
|
MapProvider = 'OpenStreetMap Mapnik'
|
||||||
PluginManager = PluginManager
|
PluginManager = PluginManager
|
||||||
UseThreads = True
|
|
||||||
ZoomToCursor = False
|
ZoomToCursor = False
|
||||||
|
OnZoomChange = MapView1ZoomChange
|
||||||
|
object btnZoomIn: TSpeedButton
|
||||||
|
AnchorSideLeft.Control = MapView1
|
||||||
|
AnchorSideTop.Control = MapView1
|
||||||
|
Left = 4
|
||||||
|
Height = 22
|
||||||
|
Top = 4
|
||||||
|
Width = 23
|
||||||
|
BorderSpacing.Left = 4
|
||||||
|
BorderSpacing.Top = 4
|
||||||
|
Images = ImageList
|
||||||
|
ImageIndex = 0
|
||||||
|
ShowHint = True
|
||||||
|
ParentShowHint = False
|
||||||
|
OnClick = btnZoomInClick
|
||||||
|
end
|
||||||
|
object btnZoomOut: TSpeedButton
|
||||||
|
AnchorSideLeft.Control = btnZoomIn
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
AnchorSideTop.Control = btnZoomIn
|
||||||
|
Left = 29
|
||||||
|
Height = 22
|
||||||
|
Top = 4
|
||||||
|
Width = 23
|
||||||
|
BorderSpacing.Left = 2
|
||||||
|
Images = ImageList
|
||||||
|
ImageIndex = 1
|
||||||
|
ShowHint = True
|
||||||
|
ParentShowHint = False
|
||||||
|
OnClick = btnZoomOutClick
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object MapView2: TMapView
|
object MapView2: TMapView
|
||||||
Left = 556
|
Left = 545
|
||||||
Height = 375
|
Height = 375
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 553
|
Width = 564
|
||||||
Cyclic = True
|
Cyclic = True
|
||||||
DownloadEngine = MapView2.BuiltInDLE
|
DownloadEngine = MapView2.BuiltInDLE
|
||||||
DrawingEngine = MapView2.BuiltInDE
|
DrawingEngine = MapView2.BuiltInDE
|
||||||
@ -52,7 +82,6 @@ object MainForm: TMainForm
|
|||||||
Font.Color = clBlack
|
Font.Color = clBlack
|
||||||
MapProvider = 'Maps For Free'
|
MapProvider = 'Maps For Free'
|
||||||
PluginManager = PluginManager
|
PluginManager = PluginManager
|
||||||
UseThreads = True
|
|
||||||
ZoomToCursor = False
|
ZoomToCursor = False
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -72,4 +101,64 @@ object MainForm: TMainForm
|
|||||||
object LinkedMapsPlugin: TLinkedMapsPlugin
|
object LinkedMapsPlugin: TLinkedMapsPlugin
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
object ImageList: TImageList
|
||||||
|
Scaled = True
|
||||||
|
Left = 424
|
||||||
|
Top = 208
|
||||||
|
Bitmap = {
|
||||||
|
4C7A020000001000000010000000420100000000000078DAED534B4A0341107D
|
||||||
|
4B5DC70BE841B2521002DE4010CC1DC40BF8B9802E8D1BA16BD04DEEE05E67A2
|
||||||
|
E8C6A5DEC0B8B1F2AA4960AC748F19051171F1A8EEEAAAEA57D5FD54155AC3ED
|
||||||
|
25D6AA02FD2A60CFACEDD5C5A4F07081954A5010CFCC1B1047D1DA5E2076FE49
|
||||||
|
EEA3E55C0B96EB67B62797633BCFD5B0FAC461DD570AB63FC4181FC669AA5F72
|
||||||
|
7C3AC392ABA9733C18E7E71167C53E139C74CEC738F2DAADFB4605F6CB8083B8
|
||||||
|
16EC589E87F9634F8CB3F82FDF1F70EEEF9FF5EFE79EEBFF46B0EAEB960582BD
|
||||||
|
51D3FCC9FB94BE61EAFDEEAFD0697A7FF67FC2F377E68F895EC31F92F8DFD867
|
||||||
|
7C6FB38217BB97763C9D67B686FFFF36AB59BFE4B0C9DCD7698D37EEB716D185
|
||||||
|
9B49CFF1D8F8668D61DB7CC35DC0BAE5D276F58FEA3FA1BD56FAF768ABFF0C87
|
||||||
|
1FD37FF2FE16FACFF5BFA8FE3DFEF5FF3BF53F0133D22DDC
|
||||||
|
}
|
||||||
|
BitmapAdv = {
|
||||||
|
4C69020000004C7A0200000018000000180000000A0200000000000078DAED56
|
||||||
|
BB4E0251109D420BA3958985967E82C618EDECD54EF4076C7CD65AFAF8085B1B
|
||||||
|
61573E4025A1B33226F25083580A9848B4034DC87ACEBA6B102FBB7761959050
|
||||||
|
4C0676F69E799DB93B966589F5CF923564286BCA66C69004A400F9707482CF69
|
||||||
|
6F153B63CA0A709E2139FCDE4B9B329F3264863A13937D3C7F8094D2318904C5
|
||||||
|
C6995D9CAD02673D99943ED53B7CEEE45685DED1C63664D9C19E6BB45D1A32F0
|
||||||
|
2B4FBCE7F858D2A9B75D13C4ADB00DC356A156E4BB055BF1E658063DF1BFF2CD
|
||||||
|
A96A727F2263B059D4AA5AC19657C5F52357F204BD54D9BCF09DFC0E20E73EF8
|
||||||
|
45F2C3FD7F6DC8482A2EE3B6803BC4A7769FD15E87BF08FB930FFE3BF067DD5E
|
||||||
|
B2DEC4F4908ADB739EE3791FFCC25FC60F6E5E70765AAABF2987B09FF9F07383
|
||||||
|
7319943F5747D20FDB23B8B1A6C1FF12791A88FF866CB3B67EFC77662512707E
|
||||||
|
57F17E0D3EEED09B49AD7B13F7097D702E9BDD3FAC891377AD8E4FAF99A84C69
|
||||||
|
DE71CCA3C8B9B47B1793059B83D04E2FF336DF10770367B57DB09E9C79CE25B9
|
||||||
|
477E53DBFFD14BDA59131BB3451F3A721B95096096EB7D2086B7ECA94C77930F
|
||||||
|
D64451AB72B3990CCB472BDF500D1F6EAD5EC28CFFBB1F711965DCD45607769F
|
||||||
|
DEFE137CFF51E619D2FEE3936FDBFB8F9784B1FF68E4DEDEFEA390AEDA7F4288
|
||||||
|
DF6BFFD1F866B7B5FF784918FB8F4FDEA1EC3F4DE6B7B7FFF4F69FDEFED3E1FD
|
||||||
|
E713F12DF5B64C7A020000002000000020000000B30200000000000078DAED57
|
||||||
|
BB6ED440143D4820419B02F80104943C0A14100FF11128E20BA0E311A8E82978
|
||||||
|
4908A4D0A422ACC716BF90224B88A2348977D38202117D16DA987B66C71218BC
|
||||||
|
9E59CF5829A6B892E5B977EE9DFB3E4551A038F08443DB3D9C1FA6B83D48708F
|
||||||
|
C46FFEE35928BD43859342AF060ABB42450DED8A3D2FF3259CF0F9DE418A4772
|
||||||
|
F74FA17DA1953CC1C3ED0457B7329CD1A4702D579897B3BEB163449EB6FE5855
|
||||||
|
38266FEE993B3F898F2F35C9E4296685774DCB24F8F06511475BBC7BC9E85ED8
|
||||||
|
58C0115BD9E5651C16D9A746369DC60FC6E7947FDD2267DEF20EC9CF07AEB9C6
|
||||||
|
18D2E77C4BAD8D099E90EACEE933138B914B4E9A3CDF6F8AB7F06D9026FA31C1
|
||||||
|
65EDC7142FACE33EAEB1150B3B1BF56B1BC48FC2F7DD260FF20C1769EFB87E3C
|
||||||
|
E937B934EE510D77B2AF092F6BDA9BFE04374C3DCE35BE5FDEAD6DCD70AA9A6B
|
||||||
|
A5BE9284EF17E99FFF959CDC54386D5B07E4212F657CE9678FD4FA15EE5BF86A
|
||||||
|
4EC73FC5755FFE9737DDD4772ADC6AE295B85F30BCF3BEF36F98E19C43FDF5BD
|
||||||
|
BD5F6155EEFB66DB8739434D0C66DBEA97F32BA69E9FD9F63FF64ADD33153E4F
|
||||||
|
9A3B96FD775D686FF3238EBBCC80B20EE5FE37D3CE1F915F2C67A0F861C679FE
|
||||||
|
2ABC9F76FE6E257857D98D76AA3DA589B83B708730F26B4DF9F047BCD7FFB79F
|
||||||
|
7106B8DA403F98588CCC3D7D5D4FD253CBFD4BF7D7048F4D9E93674F28F36783
|
||||||
|
C94999A1ACA309FB27CF9E33D7186FFADCA70DA53FD847749F34FB37BFC7BDE5
|
||||||
|
EFFAA60EEAAAB1F547DEC3D9D07821DA6065C38E7B7FF06C438ABB5DE0C75A1B
|
||||||
|
3AD25FDA50A9CDAF5DF8BFD2276764BEDD2175AD3BE2FF88FF23FE6F8FFF9B28
|
||||||
|
34FEB7DCE583E17F873D3808FE77CD25DFF8DF210641F07F1D7585FF6DF587C2
|
||||||
|
FFD6F51408FFBBE69F6FFCEFD04F82E07F4BDDC1F0BF65FF8DF83FE2FF88FF23
|
||||||
|
F68EF83FE2FF038DFF7F03282ECCBC
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -5,7 +5,7 @@ unit main;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils,
|
Buttons, Classes, SysUtils, Math,
|
||||||
Graphics, Controls, StdCtrls, ExtCtrls, Forms,
|
Graphics, Controls, StdCtrls, ExtCtrls, Forms,
|
||||||
mvMapViewer, mvPluginCore, mvPlugins;
|
mvMapViewer, mvPluginCore, mvPlugins;
|
||||||
|
|
||||||
@ -14,14 +14,21 @@ type
|
|||||||
{ TMainForm }
|
{ TMainForm }
|
||||||
|
|
||||||
TMainForm = class(TForm)
|
TMainForm = class(TForm)
|
||||||
|
ImageList: TImageList;
|
||||||
Label1: TLabel;
|
Label1: TLabel;
|
||||||
MapView1: TMapView;
|
MapView1: TMapView;
|
||||||
MapView2: TMapView;
|
MapView2: TMapView;
|
||||||
Panel1: TPanel;
|
Panel1: TPanel;
|
||||||
PluginManager: TMvPluginManager;
|
PluginManager: TMvPluginManager;
|
||||||
LinkedMapsPlugin: TLinkedMapsPlugin;
|
LinkedMapsPlugin: TLinkedMapsPlugin;
|
||||||
|
btnZoomIn: TSpeedButton;
|
||||||
|
btnZoomOut: TSpeedButton;
|
||||||
|
procedure btnZoomInClick(Sender: TObject);
|
||||||
|
procedure btnZoomOutClick(Sender: TObject);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure MapView1ZoomChange(Sender: TObject);
|
||||||
private
|
private
|
||||||
|
procedure UpdateZoomBtns;
|
||||||
|
|
||||||
public
|
public
|
||||||
|
|
||||||
@ -38,6 +45,30 @@ procedure TMainForm.FormCreate(Sender: TObject);
|
|||||||
begin
|
begin
|
||||||
MapView1.Active := true;
|
MapView1.Active := true;
|
||||||
MapView2.Active := true;
|
MapView2.Active := true;
|
||||||
|
UpdateZoomBtns;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.btnZoomInClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
MapView1.Zoom := MapView1.Zoom + 1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.btnZoomOutClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
MapView1.Zoom := MapView1.Zoom - 1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.MapView1ZoomChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
UpdateZoomBtns;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.UpdateZoomBtns;
|
||||||
|
begin
|
||||||
|
btnZoomOut.Enabled := (MapView1.Zoom > MapView1.ZoomMin);
|
||||||
|
btnZoomIn.Enabled := (MapView1.Zoom < MapView1.ZoomMax);
|
||||||
|
btnZoomOut.Hint := Format('Zoom out (Current zoom level: %d)', [MapView1.Zoom]);
|
||||||
|
btnZoomIn.Hint := Format('Zoom in (Current zoom level: %d)', [MapView1.Zoom]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user