首页 > Windows开发 > 详细

Delphi下使用MapWinGIS控件打开GIS图层

时间:2014-01-20 09:01:08      阅读:695      评论:0      收藏:0      [点我收藏+]
bubuko.com,布布扣
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.
bubuko.com,布布扣

Delphi下使用MapWinGIS控件打开GIS图层

原文:http://www.cnblogs.com/China3S/p/3526328.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!