在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
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.
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论