?? unit1.pas
字號:
//MapInfo China
//James Liu
//20030/4/1
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, MapXLib_TLB, StdCtrls, DB, DBTables;
type
TForm1 = class(TForm)
Map1: TMap;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Database1: TDatabase;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button2Click(Sender: TObject);
begin
//application.Destroy ;
application.Terminate;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
LayerInfoObject: CMapXLayerInfo;
begin
LayerInfoObject := CoLayerInfo.Create;
LayerInfoObject.Type_ := miLayerInfoTypeServer;
// LayerInfoObject.AddParameter('FileSpec', 'c:\Program Files\MapInfo\MapX 5.0\Maps\worldcap.tab');
LayerInfoObject.AddParameter('Name', 'SpatialLayer');
LayerInfoObject.AddParameter('ConnectString','DSN=spatialsqlserver'); //必須參數
//LayerInfoObject.AddParameter('ConnectString','DSN=spatialsqlserver;UID=James;WSID=LIUYI;DATABASE=sqlserver2000;Trusted_Connection=Yes');
LayerInfoObject.AddParameter('Query','SELECT * FROM ASIACAPS');
LayerInfoObject.AddParameter('ToolKit','ODBC');
Map1.Layers.Add(LayerInfoObject, EmptyParam);
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
Map1.CurrentTool := miZoomInTool ;
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
Map1.CurrentTool := miZoomOutTool;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -