Delphi下使用MapWinGIS控件打开GIS图层
2014-01-19 23:07
441 查看
unit Unit3; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Grids, Vcl.DBGrids, Data.DB, Vcl.OleCtrls, MapWinGIS_TLB, Vcl.ComCtrls, Vcl.StdCtrls, Vcl.OleServer, Bde.DBTables; type TForm3 = class(TForm) Button1: TButton; PageControl1: TPageControl; TabSheet1: TTabSheet; TabSheet2: TTabSheet; Map1: TMap; DataSource1: TDataSource; DBGrid1: TDBGrid; OpenDialog1: TOpenDialog; Table1: TTable; procedure Button1Click(Sender: TObject); private { Private declarations } AShape:MapWinGIS_TLB.Shapefile; ATable:MapWinGIS_TLB.Table; public { Public declarations } end; var Form3: TForm3; implementation {$R *.dfm} procedure TForm3.Button1Click(Sender: TObject); var i,MapHanle:integer; begin self.OpenDialog1.FileName :='*.SHP'; if self.OpenDialog1.Execute() then begin AShape:=MapWinGIS_TLB.CoShapefile.Create; AShape.Open(self.OpenDialog1.FileName,nil); MapHanle:=self.Map1.AddLayer(AShape,true); self.Table1.TableName :=ExtractFilePath(self.OpenDialog1.FileName)+'grid.dbf'; self.Table1.Active:=true; end; end; end.
相关文章推荐
- XE5完美破解
- Delphi第一个入门程序——鼠标点击计数 - imsoft.cnblogs
- Delphi 中经常使用的正则表达式
- Delphi- 数据加密和解密
- 翻箱倒柜,《Delphi中建议使用的语句》
- 使用Delphi收发GMail的邮件
- delphi调用c动态库实践
- Delphi XE5 Android 运行黑屏卡死的解决方法
- 电子书下载:DELPHI深度探索(第二版)
- Delphi 200X、XE中如何用并行实现循环的计算
- Delphi XE5 android 捕获几个事件
- delphi中单独编译pas生成dcu文件
- Delphi的并行计算
- 电子书下载:Delphi面向对象编程思想
- 电子书下载:Delphi模式编程
- Delphi调用C写的dll
- Delphi System 提供的编译期函数
- delphi调用存储过程
- delphi的常用条件编译指令---{$IFDEF} {$UNDEF}{$IFDEF}{$ELSE}{$ENDIF} .
- C++调用delphi开发的com组件细节