这是我做的一个gisdemo,还在研究,看看怎么样,给点评价:(100分)

  • 主题发起人 delphilai
  • 开始时间
D

delphilai

Unregistered / Unconfirmed
GUEST, unregistred user!
这是我做的一个gisdemo,还在研究,看看怎么样,给点评价:
http://www.info98.net/delphilai/ftp/gisdemo.exe
 
我在另一个帖子里发了一句话:我下载了你的程序,运行时报错“类没有注册”。
 
看起来不错,不过好多常用的按钮都没有作用,还没作完吧

吕大侠,你的错误就是因为没有安装mapX控件了
他的这个东西是delphi在mapX的二次开发的。不向你的那个完全从底层写起。
 
下面我把我自己研究的一些主要的常用的mapx实现方法拿出来给大家分享,让大家少找点弯路。
现在自己开始摸mapx,手头上没什么资料,很痛苦的事,所以希望大家都能把自己的收获拿出来共享,
一起进步。

3.2.1GeosetNew:新建地图
procedure GeosetNew(var map1:TMap);
begin

//Clear the Geoset, so we start with a new one
Map1.Geoset := '';
//Allow the user to choose what coordinate system
Map1.DisplayCoordSys.PickCoordSys(0,0);
//Allow the user to add new layers
Map1.Layers.LayersDlg(0,0);
end;

3.2.2 GeoSetOpen:打开地图
function GeoSetOpen(var map1:TMap;var sPath:string;var sLastFile:String):string;
var
opendlg:TOpenDialog;
begin

Result:='UnKnown';
openDlg:=TopenDialog.Create(map1.GetParentComponent);
with opendlgdo

begin

Title:='Open GeoSet';
DefaultExt:='GST';
InitialDir:=sPath;
Options:=[ofOverwritePrompt,ofHideReadOnly,ofPathMustExist,ofFileMustExist];
//Look for the most recently used file as a default
FileName:= sLastFile;
//Give user the option of *.GST or *.* for file types
Filter:='MapX Geoset (*.GST)|*.GST|All Files(*.*)';
//By default show *.GST (1st item from the Filter property)
FilterIndex:= 1;
if Execute then

begin

if FileName='' then
exit;
//Load the geoset
map1.Geoset:=fileName;
map1.Title.Visible:= false;
sLastFile:=filename;
Result:= map1.geosets.item(map1.Geoset).userName;
end;

end;

openDLg.free;
end;

3.2.3 GeoSetSave:保存地图
procedure GeoSetSave(var map1:TMap;var sGeosetName,sLastFile:string);
begin

map1.SaveMapAsGeoset(sGeosetName,sLastFile);
end;

3.2.4 GeoSetSaveAs:地图另存为
procedure GeoSetSaveAs(map1:TMap;var sGeosetName,sLastFile:string);
var
Savedlg:TSaveDialog;
begin


SaveDlg:=TSaveDialog.Create(map1.GetParentComponent);
with savedlgdo

begin

Title:='Save Geoset';
DefaultExt:='GST';
Options:=[ofOverwritePrompt,ofHideReadOnly,ofPathMustExist,ofFileMustExist];
FileName:=sLastFile;
Filter:='MapX Geoset (*.GST)|*.GST|All Files(*.*)|*.*';
if execute then

begin

if fileName='' then
exit;
if length(fileName)>255 then

sLastFile:=copy(fileName,1,255)
else

sLastFile:=fileName;
sGeosetName:=sLastFile;
while pos('/',sGeosetName)>0do

delete(sGeosetName,1,pos('/',sGeosetName));
if pos('.GST',UpperCase(sGeosetName))>0 then

delete(sGeosetName,Length(sGeosetName)-4+1,4);
Map1.SaveMapAsGeoset(sGeosetName,sLastFile);
end;

end;

saveDlg.Free;
end;

3.2.5属性信息的修改
1)创建自定义工具:CUSTOM_FEATUREINFO_TOOL
2)在map1的ontoolused事件中:
begin

lyr := map1.Layers.Item(cmbLayer.Text);//Here should select the 'Us Capital' layer;
pnt := copoint.Create;
pnt.Set_(x1,y1);
try
ftrs := lyr.SearchAtPoint(pnt);
dst := map1.Datasets.add(midatasetlayer,lyr,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam);
flds := dst.fields;
ftr := ftrs.item(1);
stabar.Panels[0].Text:= ftr.Name+' is Selected';
except
//No features are selected;
stabar.Panels[0].Text:='No features are selected';
exit;
end;

finfo.Enter(lyr,flds,ftr);
end;

3)finfo窗体的enter函数
//finfo是feature的属性信息窗体
procedure TfInfo.Enter(lyr:CMapXLayer;
flds:CMapXfields;var ftr:CMapxFeature);
var
i, j:integer;
label_field:Array[0..MAX_LAYERS_COUNT] of TStaticText;
Edit_field:Array[0..MAX_LAYERS_COUNT] of TEdit;
fldsname : array[1..MAX_LAYERS_COUNT] of variant;

begin

freeControls;
CurrentFtr:= ftr;
CurrentLyr:= Lyr;
for j := 1 to flds.Countdo

begin

fldsname[j] := flds.item(j).name;
lyr.KeyField := fldsname[j];
Label_field[j]:=TStaticText.Create(fInfo.Scrbox);
Label_field[j].Name:='Label_'+inttostr(j);
Label_field[j].Parent:=TWinControl(finfo.scrbox);
Label_Field[j].AutoSize:=false;
Label_field[j].Alignment:=taRightJustify;
Label_field[j].Left:=10;
Label_field[j].Width:=72;
Label_Field[j].Top:=(j-1)*24+10;
Label_Field[j].Caption:=fldsName[j];

Edit_Field[j]:=TEdit.Create(finfo.scrbox);
Edit_Field[j].Name:='Edit_'+flds.item(j).Name;
Edit_Field[j].Text:=Ftr.KeyValue;
//Value;
Edit_Field[j].Left:=88;
Edit_Field[j].Width:=125;
Edit_Field[j].top:=(j-1)*24+8;
Edit_field[j].Parent:=TWinControl(finfo.scrbox);
Edit_field[j].OnKeyPress:=Finfo.editKeyPress;
end;

finfo.Width:=232;
finfo.Height:=(j+1)*24;
finfo.show;

end;

3.2.6CreateTemporaryLayer创建临时层
createTemporaryLayer(map1:Tmap)
var
LayerName:string;
begin

try
if fLayerNew.ShowModal=mrok then

begin

if trim(FlayerNew.Edit1.Text)='' then
exit;
LayerName:=trim(fLayerNew.Edit1.Text);
CurrentLayer:=Map1.Layers.CreateLayer( LayerName,EmptyParam,EmptyParam,EmptyParam,EmptyParam );
map1.Layers.AnimationLayer := CurrentLayer;
updatecmbLayer;
end;

except

end;

end;

3.2.7 CreatePermanenceLayer创建永久层
CreatePermanenceLayer(map1:Tmap)
var
sFileName:string;
openDlg:TOpenDialog;
begin

//This uses the opemdialog to open a MapInfo Table and add it as a layer.
OpenDlg:=TOpenDialog.Create(map1.GetParentComponent);
with openDlgdo

begin

Title:='Add Layer';
Filter:='MapInfo Tables (*.tab)|*.tab';
if Execute then

begin

if length(filename)=0 then
exit;
sFileName:=fileName;
map1.Layers.Add(sFileName,emptyParam);
end;

end;

end;



 
谢谢楼主。
 
请问你导出为不同类型的文件是怎么做的呢?
 
下面这些代码是我自己用程序来控制图层,类似于Map1.LayersDLG。

unit uLayer_Control;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, OleCtrls, MapXLib_TLB;

type
TfLayerControl = class(TForm)
Label1: TLabel;
ListBox1: TListBox;
sbUP: TSpeedButton;
sbDown: TSpeedButton;
sbAdd: TSpeedButton;
sbRemove: TSpeedButton;
GroupBox1: TGroupBox;
cbVisible: TCheckBox;
cbEditable: TCheckBox;
cbAutoLabel: TCheckBox;
cbSelectable: TCheckBox;
cbInsertionLayer: TCheckBox;
cbShowCentroids: TCheckBox;
cbShowNodes: TCheckBox;
cbShowLineDirection: TCheckBox;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
procedure FormActivate(Sender: TObject);
procedure ListBox1Click(Sender: TObject);
procedure cbVisibleClick(Sender: TObject);
procedure cbEditableClick(Sender: TObject);
procedure cbAutoLabelClick(Sender: TObject);
procedure cbShowNodesClick(Sender: TObject);
procedure cbSelectableClick(Sender: TObject);
procedure cbInsertionLayerClick(Sender: TObject);
procedure cbShowCentroidsClick(Sender: TObject);
procedure cbShowLineDirectionClick(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure sbUPClick(Sender: TObject);
procedure sbDownClick(Sender: TObject);
procedure sbAddClick(Sender: TObject);
procedure sbRemoveClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure InitialLayerOptionArr;
function CheckInsertionLayer(Lyr:CMapxLayer):boolean;
procedure UpdateLayerListbox;
//Update the ListBox1;
procedure UpdateLayerOptionArr;
//Update the ChkLayerOptionArr;
procedure UpdateLayerOption;
//Update the map1's LayerOption;
procedure UpdateLayerOptionChkBox;
//update the checkbox's checked state when the listbox'selection is changed
procedure MoveArray(iFrom,iTo:integer);
//change the LayerOptionArr between the iFrom and iTo;

end;


var
fLayerControl: TfLayerControl;


implementation

uses uMain, uInter;



{$R *.dfm}

procedure TfLayerControl.FormActivate(Sender: TObject);
begin

initialLayerOptionArr;
UpdateLayerListbox;
updateLayerOptionChkBox;
end;


procedure TflayerControl.UpdateLayerListbox;
var
i:integer;
begin

ListBox1.Clear;
for i:=1 to fMain.Map1.Layers.Countdo

begin

Listbox1.Items.Add(fMain.Map1.Layers.item(i).Name);
end;

Listbox1.ItemIndex:=0;
updateLayerOptionChkBox;
end;


procedure TfLayerControl.UpdateLayerOptionArr;
var
i,j:integer;
begin

for i:=1 to fMain.map1.Layers.Countdo

begin

ChkLayerOptionArr[i-1,OptVisible]:= fMain.map1.Layers.Item(i).Visible
ChkLayerOptionArr[i-1,OptEditalbe]:= fMain.map1.Layers.Item(i).Editable;
ChkLayerOptionArr[i-1,OptAutoLabel]:= fMain.map1.Layers.Item(i).AutoLabel;
ChkLayerOptionArr[i-1,OptShowNodes]:= fMain.map1.Layers.Item(i).ShowNodes;
ChkLayerOptionArr[i-1,OptSelectable]:= fMain.map1.Layers.Item(i).Selectable;
ChkLayerOptionArr[i-1,OptInsertionLayer]:= CheckInsertionLayer(fMain.map1.Layers.Item(i));
ChkLayerOptionArr[i-1,OptShowCentroids]:= fMain.map1.Layers.Item(i).ShowCentroids;
ChkLayerOptionArr[i-1,OptShowLineDirection]:= fMain.map1.Layers.Item(i).ShowLineDirection;
end;

end;


procedure TfLayerControl.UpdateLayerOption;
var
i:integer;
begin

for i:=1 to fMain.map1.Layers.Countdo

begin

fMain.map1.Layers.Item(i).Visible:= ChkLayerOptionArr[i-1,OptVisible];
fMain.map1.Layers.Item(i).Editable:=ChkLayerOptionArr[i-1,OptEditalbe]
fMain.map1.Layers.Item(i).AutoLabel:= ChkLayerOptionArr[i-1,OptAutoLabel];
fMain.map1.Layers.Item(i).ShowNodes:= ChkLayerOptionArr[i-1,OptShowNodes];
fMain.map1.Layers.Item(i).Selectable:= ChkLayerOptionArr[i-1,OptSelectable];
if ChkLayerOptionArr[i-1,OptInsertionLayer] then

fMain.map1.Layers.insertionLayer:= fMain.map1.Layers.Item(i);
fMain.map1.Layers.Item(i).ShowCentroids:= ChkLayerOptionArr[i-1,OptShowCentroids];
fMain.map1.Layers.Item(i).ShowLineDirection:= ChkLayerOptionArr[i-1,OptShowLineDirection];
end;

end;


procedure TfLayerControl.UpdateLayerOptionChkBox;
var
lyr:CMapXLayer;
i:integer;
begin

if listbox1.Items.Count>0 then

begin

if Listbox1.ItemIndex<0 then
Listbox1.ItemIndex:=0
i:=listbox1.ItemIndex;
cbVisible.Checked:=ChkLayerOptionArr[i,OptVisible]
cbEditable.Checked:=ChkLayerOptionArr[i,OptEditalbe]
cbAutoLabel.Checked:=ChkLayerOptionArr[i,OptAutoLabel]
cbSelectable.Checked:=ChkLayerOptionArr[i,OptSelectable]
cbInsertionLayer.Checked:=ChkLayerOptionArr[i,OptInsertionLayer]
cbShowCentroids.Checked:=ChkLayerOptionArr[i,OptShowCentroids]
cbShowLineDirection.Checked:=ChkLayerOptionArr[i,OptShowLineDirection]
end
else

begin

cbVisible.Checked:=false;
cbEditable.Checked:=false;
cbAutoLabel.Checked:=false;
cbSelectable.Checked:=false;
cbInsertionLayer.Checked:=false;
cbShowCentroids.Checked:=false;
cbShowLineDirection.Checked:=false;
end;


end;


function TfLayerControl.CheckInsertionLayer(Lyr:CMapxLayer):boolean;
begin

result:=(lyr=fmain.Map1.Layers.InsertionLayer);
end;


procedure TfLayerControl.InitialLayerOptionArr;
var
i,j:integer;
begin

for i:=1 to fMain.map1.Layers.Countdo

begin

ChkLayerOptionArr[i-1,OptVisible]:= fMain.map1.Layers.Item(i).Visible
ChkLayerOptionArr[i-1,OptEditalbe]:= fMain.map1.Layers.Item(i).Editable;
ChkLayerOptionArr[i-1,OptAutoLabel]:= fMain.map1.Layers.Item(i).AutoLabel;
ChkLayerOptionArr[i-1,OptShowNodes]:= fMain.map1.Layers.Item(i).ShowNodes;
ChkLayerOptionArr[i-1,OptSelectable]:= fMain.map1.Layers.Item(i).Selectable;
ChkLayerOptionArr[i-1,OptInsertionLayer]:= CheckInsertionLayer(fMain.map1.Layers.Item(i));
ChkLayerOptionArr[i-1,OptShowCentroids]:= fMain.map1.Layers.Item(i).ShowCentroids;
ChkLayerOptionArr[i-1,OptShowLineDirection]:= fMain.map1.Layers.Item(i).ShowLineDirection;
end;

end;


procedure TfLayerControl.ListBox1Click(Sender: TObject);
begin

UpdateLayerOptionChkBox;
end;


procedure TfLayerControl.cbVisibleClick(Sender: TObject);
begin

ChkLayerOptionArr[listbox1.ItemIndex,OptVisible]:=(sender as TCheckBox).Checked;
end;


procedure TfLayerControl.cbEditableClick(Sender: TObject);
begin

ChkLayerOptionArr[listbox1.ItemIndex,OptVisible]:=(sender as TCheckBox).Checked;
end;


procedure TfLayerControl.cbAutoLabelClick(Sender: TObject);
begin

ChkLayerOptionArr[listbox1.ItemIndex,OptAutoLabel]:=(sender as TCheckBox).Checked;
end;


procedure TfLayerControl.cbShowNodesClick(Sender: TObject);
begin

ChkLayerOptionArr[listbox1.ItemIndex,OptShowNodes]:=(sender as TCheckBox).Checked;
end;


procedure TfLayerControl.cbSelectableClick(Sender: TObject);
begin

ChkLayerOptionArr[listbox1.ItemIndex,OptSelectable]:=(sender as TCheckBox).Checked;
end;


procedure TfLayerControl.cbInsertionLayerClick(Sender: TObject);
begin

ChkLayerOptionArr[listbox1.ItemIndex,OptInsertionLayer]:=(sender as TCheckBox).Checked;
end;


procedure TfLayerControl.cbShowCentroidsClick(Sender: TObject);
begin

ChkLayerOptionArr[listbox1.ItemIndex,OptShowCentroids]:=(sender as TCheckBox).Checked;
end;


procedure TfLayerControl.cbShowLineDirectionClick(Sender: TObject);
begin

ChkLayerOptionArr[listbox1.ItemIndex,OptShowLineDirection]:=(sender as TCheckBox).Checked;
end;


procedure TfLayerControl.BitBtn3Click(Sender: TObject);
begin

updateLayerOption;
end;


procedure TfLayerControl.BitBtn1Click(Sender: TObject);
begin

updateLayerOption;
close;
end;


procedure TfLayerControl.BitBtn2Click(Sender: TObject);
begin

close;
end;


procedure TfLayerControl.sbUPClick(Sender: TObject);
var
i:integer;
begin

i:=listbox1.ItemIndex;
if i>0 then

begin

fMain.Map1.Layers.Move(i+1,i);
MoveArray(i,i-1);
end;

UpdateLayerListbox;
end;


procedure TflayerControl.MoveArray(iFrom,iTo:integer);
var
tmpArr:array[TLayerOption]of boolean;
begin


tmpArr[OptVisible]:= ChkLayerOptionArr[iFrom,OptVisible];
tmpArr[OptEditalbe]:=ChkLayerOptionArr[iFrom,OptEditalbe];
tmpArr[OptAutoLabel]:=ChkLayerOptionArr[iFrom,OptAutoLabel];
tmpArr[OptShowNodes]:=ChkLayerOptionArr[iFrom,OptShowNodes];
tmpArr[OptSelectable]:=ChkLayerOptionArr[iFrom,OptSelectable];
tmpArr[OptInsertionLayer]:=ChkLayerOptionArr[iFrom,OptInsertionLayer];
tmpArr[OptShowCentroids]:=ChkLayerOptionArr[iFrom,OptShowCentroids];
tmpArr[OptShowLineDirection]:=ChkLayerOptionArr[iFrom,OptShowLineDirection];

ChkLayerOptionArr[iFrom,OptVisible]:=ChkLayerOptionArr[iTo,OptVisible];
ChkLayerOptionArr[iFrom,OptEditalbe]:=ChkLayerOptionArr[iTo,OptEditalbe];
ChkLayerOptionArr[iFrom,OptAutoLabel]:=ChkLayerOptionArr[iTo,OptAutoLabel];
ChkLayerOptionArr[iFrom,OptShowNodes]:=ChkLayerOptionArr[iTo,OptShowNodes];
ChkLayerOptionArr[iFrom,OptSelectable]:=ChkLayerOptionArr[iTo,OptSelectable];
ChkLayerOptionArr[iFrom,OptInsertionLayer]:=ChkLayerOptionArr[iTo,OptInsertionLayer];
ChkLayerOptionArr[iFrom,OptShowCentroids]:=ChkLayerOptionArr[iTo,OptShowCentroids];
ChkLayerOptionArr[iFrom,OptShowLineDirection]:=ChkLayerOptionArr[iTo,OptShowLineDirection];

ChkLayerOptionArr[iTo,OptVisible]:=tmpArr[OptVisible];
ChkLayerOptionArr[iTo,OptEditalbe]:=tmpArr[OptEditalbe];
ChkLayerOptionArr[iTo,OptAutoLabel]:=tmpArr[OptAutoLabel];
ChkLayerOptionArr[iTo,OptShowNodes]:=tmpArr[OptShowNodes];
ChkLayerOptionArr[iTo,OptSelectable]:=tmpArr[OptSelectable];
ChkLayerOptionArr[iTo,OptInsertionLayer]:=tmpArr[OptInsertionLayer];
ChkLayerOptionArr[iTo,OptShowCentroids]:=tmpArr[OptShowCentroids];
ChkLayerOptionArr[iTo,OptShowLineDirection]:=tmpArr[OptShowLineDirection];

end;


procedure TfLayerControl.sbDownClick(Sender: TObject);
var
i:integer;
begin

i:=listbox1.ItemIndex;
if i<listbox1.Items.Count then

begin

fmain.Map1.Layers.Move(i+1,i+2);
MoveArray(i,i+1);
end;

UpdateLayerListbox;
end;


procedure TfLayerControl.sbAddClick(Sender: TObject);
var
sFileName:string;
begin

//This uses the opemdialog to open a MapInfo Table and add it as a layer.
with fmain.openDlgdo

begin

Title:='Add Layer';
Filter:='MapInfo Tables (*.tab)|*.tab';
if Execute then

begin

if length(filename)=0 then
exit;
sFileName:=fileName;
fmain.map1.Layers.Add(sFileName,emptyParam);
fmain.updatecmbLayer;
UpdateLayerListbox;
UpdateLayerOptionArr;
updateLayerOptionChkBox;
end;

end;

end;


procedure TfLayerControl.sbRemoveClick(Sender: TObject);
begin

fmain.map1.Layers.Remove(listbox1.Items.Text);
fmain.updatecmbLayer;
UpdateLayerListbox;
UpdateLayerOptionArr;
updateLayerOptionChkBox;
end;


end.
 
supercai:我以为导出为图片文件是比较容易的,所以没想贴出来,既然你想知道,就给你吧:


Procedure MapExport(Map1:Tmap;Format:integer;Width,Height:integer);
var
Location:string;
SaveDlg:TSaveDialog;
begin

SaveDlg:=TSaveDialog.Create(application);
with saveDlgdo

begin

Title:='Save as...';
case Format of
0:
begin

Filter := 'WMF files(*.WMF)|*.WMF';
DefaultExt:='WMF';
end;

1:
begin

Filter := 'BMP files(*.BMP)|*.BMP';
DefaultExt:='BMP';
end;

2:
begin

Filter := 'GIF files(*.GIF )|*.GIF';
DefaultExt:='GIF';
end;

3:
begin

Filter := 'JPEG files(*.JPEG)|*.JPEG';

DefaultExt:='JPEG';
end;

4:
begin

Filter := 'tif files(*.tif)|*.tif';
DefaultExt:='tif';
end;

5:
begin

Filter := 'PNG files(*.PNG)|*.PNG';
DefaultExt:='PNG';
end;

6:
begin

Filter := 'PSD files(*.PSD)|*.PSD';
DefaultExt:='PSD';
end;

end;

Options:=[ofOverwritePrompt,ofHideReadOnly,ofPathMustExist,ofFileMustExist];
if execute then

begin

if fileName='' then
exit;
if length(fileName)>255 then

Location:=copy(fileName,1,255)
else

Location:=filename;
Map1.PaperUnit := miUnitCentimeter;
map1.exportMap(location,format,width,height);
end;


end;

end;



调用时:
MapExport(map1,miFormatWMF,EmptyParam,EmptyParam);
MapExport(map1,miFormatGIF,EmptyParam,EmptyParam);
……
 
这么好的萜子居然没人捧场,tmd以后不帖了
 
老兄别灰心,主要是这里太冷清了,对于你的热情帮助,再次表示感谢。。//bow..[:)]
 
坚决捧场!,虽然我不是搞GIS的,但这类行为应该得到大家的支持!
请Delphilai,到这里领分
http://www.delphibbs.com/delphibbs/dispq.asp?lid=1398671
 
请到这里领http://211.101.4.25/delphibbs/dispq.asp?lid=1398708
 
penkerlove和supercai,谢谢你们两的好意,我对分无所谓的拉,以后不必这样给我分了,
我这样帖出来只是因为自己在摸索gis地理信息系统,而这技术在在国内还是很大的空白,
自己摸很痛苦,手上没什么资料,所以希望大富翁一起学习共同进步,以后欢迎做gis的同行和我交流。
Email:delphilai@163.com
QQ:67906994
 
我建议你这样来考虑,把GIS作为一种插件的形式来向其他系统如OA等提供相应功能。我建议你了解一下ArcGIS产品系列,尤其是ArcInfo和MapObjects,这应该是全球最好的GIS软件了。
 
谢谢以上各位了!
 
lanhe,我们公司用mapinfo的mapx控件,下面是相关文档对MapObjects和MapX的主要功能的对比:
功能 MapObjects MapX
显示的地图数据格式 Arcview的SHP、ARC/INFO的coverage、SDE图层 MapInfo的数据格式
叠加栅格图像 有 有
对地图的常用操作 放大、缩小、漫游等 放大、缩小、漫游等
图层控制 增加、移走、设置当前层 增加、移走、设置当前层
属性数据绑定 有 有
地图信息查询方式 1. 通过鼠标选取特征2. 通过SQL查找特征3. 通过空间操作选取特征 1. 通过鼠标选取特征2. 通过SQL查找特征3. 通过空间操作选取特征
专题地图 较弱 有
GPS集成 有 有
用户绘图图层 无 有
生成/编辑地图对象 较弱 较弱
地图标注 有 有
地图符号化 较弱 较强
分析功能 无 无
地理编码 有 有
可使用的开发语言 VC、VB、PowerBuilder、Delphi、Access等 VC、VB、PowerBuilder、Delphi、Lotus Notes等
所以我还是爱我的mapx呵呵
 
正在学mapx+delphi
坚决捧场!
 
看来 同行不少啊,大家一起学习
 
关于绑定dataset的函数:
Procedure BindLayer(var map1:Tmap);
var
Lyr: CMapXLayer;
i,j: integer;
LyrName:string;
flag:boolean;
ds: CMapxDataset;
begin


for i:=1 to map1.Layers.Countdo

begin

lyr:=map1.Layers.Item(i);
LyrName:= lyr.Name;
flag:=CheckDatasetCreated(map1,lyrName);
if not flag then

begin

try
datasetArr:=map1.Datasets.Add(miDatasetLayer,lyr,lyr.Name,EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam);
except
//Create dataset fail because of unknown reason;
end;

end;


end;


end;


// check if the bind dataset for the lyrName has been created
function CheckDatasetCreated(map1:TMap;
lyrName:String):Boolean;
var
ds: CMapxDataset;
i:integer;
begin

Result:=false;
For i:=1 to Map1.Datasets.Countdo

begin

ds:=Map1.Datasets.Item(i);
if Lowercase( LyrName)=Lowercase(trim(ds.Name)) then

begin

Result:=true;
break;
end;

end;


end;

 
哥们,辛苦了
我支持你
 
顶部