P
pandame
Unregistered / Unconfirmed
GUEST, unregistred user!
var
xx,yy:double;
ptoint;
aa:Style;
clientLayer:layer;
NewObj:Variant;
begin
......
clientLayer:=map1.Layers.CreateLayer('客户点',EmptyParam,1,EmptyParam,EmptyParam);//新建一个图层
clientLayer.Visible:=True;
//设置该图层可见
clientLayer.Editable:=True;
//设置图层可编辑,以便画Feature于该图层
map1.Layers.AnimationLayer:=clientLayer;
//设置新建图层为活动层
pt:=copoint.Create;
AA:=costyle.Create;
AA.SymbolType:=misymbolTypeTrueTypeFont;
AA.SymbolCharacter:=53;
pt.Set_(xx,yy);//前面省略的程序已经得到了xx、yy的值
NewObj:=map1.FeatureFactory.CreateSymbol(pt,AA);
Map1.layers.insertionlayer.AddFeature(NewObj,EmptyParam);
clientLayer.Refresh;
end;
这是我借鉴来的代码,出错了,那该怎么写呢?请教大虾指点!!
编译没有错,但运行时报错:access violation at address 51081416 in module'dgis'.read of address 00000000.
xx,yy:double;
ptoint;
aa:Style;
clientLayer:layer;
NewObj:Variant;
begin
......
clientLayer:=map1.Layers.CreateLayer('客户点',EmptyParam,1,EmptyParam,EmptyParam);//新建一个图层
clientLayer.Visible:=True;
//设置该图层可见
clientLayer.Editable:=True;
//设置图层可编辑,以便画Feature于该图层
map1.Layers.AnimationLayer:=clientLayer;
//设置新建图层为活动层
pt:=copoint.Create;
AA:=costyle.Create;
AA.SymbolType:=misymbolTypeTrueTypeFont;
AA.SymbolCharacter:=53;
pt.Set_(xx,yy);//前面省略的程序已经得到了xx、yy的值
NewObj:=map1.FeatureFactory.CreateSymbol(pt,AA);
Map1.layers.insertionlayer.AddFeature(NewObj,EmptyParam);
clientLayer.Refresh;
end;
这是我借鉴来的代码,出错了,那该怎么写呢?请教大虾指点!!
编译没有错,但运行时报错:access violation at address 51081416 in module'dgis'.read of address 00000000.