P
popi
Unregistered / Unconfirmed
GUEST, unregistred user!
在运行到ftNewObj:=MapMain.FeatureFactory.CreateCircularRegion时报错“点对象无效”,不知道是什么原因,这函数我初始化画圆时是对的,但程序运转之后当接受到画圆信息后开始报错。传进去的A_ftCurrent是我预先创建这些图元时保存好的值,跟踪过是对的和一开始初始化值一样!
请各位大虾帮忙~
procedure TfrmMain.DrawCirCle(A_ftCurrent:Variant;A_Radius1,A_Radius2,A_Radius3ouble);
var
lyrCurr,ftNewObj,ftNew:Variant;
pt:Variant;
begin
pt:=CreateOleObject('MapX.Point.4');
pt.Set(A_ftCurrent.CenterX,A_ftCurrent.CenterY);
lyrCurr:=MapMain.Layers.Item(gDrawLayerName);
FeatureInfLink.HasCirCle:=True;
//在图元点周边画三个红色圆
lyrCurr.style.RegionPattern:=0;
lyrCurr.style.regiontransparent:=true;
lyrCurr.style.regionborderwidth:=2;
lyrCurr.style.regionbordercolor:=miColorRed;
ftNewObj:=MapMain.FeatureFactory.CreateCircularRegion(0,pt,A_RADIUS1,miUnitmeter,EmptyParam,lyrCurr.Style);//报错
ftNew:=lyrCurr.AddFeature(ftNewObj);
FeatureInfLink.ftOneCircle:=ftNew;
ftNewObj:=MapMain.FeatureFactory.CreateCircularRegion(0,pt,A_RADIUS2,miUnitmeter,400,lyrCurr.Style);
ftNew:=lyrCurr.AddFeature(ftNewObj);
FeatureInfLink.ftTwoCircle:=ftNew;
ftNewObj:=MapMain.FeatureFactory.CreateCircularRegion(0,pt,A_RADIUS3,miUnitmeter,EmptyParam,lyrCurr.Style);
ftNew:=lyrCurr.AddFeature(ftNewObj);
FeatureInfLink.ftThreeCircle:=ftNew;
//MapMain.ZoomTo(gFindZoom,A_ftCurrent.CenterX,A_ftCurrent.CenterY);
A_ftCurrent.Style.SymbolBitmapName:='DoorOpen.bmp';
A_ftCurrent.Update;
varClear(pt);
end;
请各位大虾帮忙~
procedure TfrmMain.DrawCirCle(A_ftCurrent:Variant;A_Radius1,A_Radius2,A_Radius3ouble);
var
lyrCurr,ftNewObj,ftNew:Variant;
pt:Variant;
begin
pt:=CreateOleObject('MapX.Point.4');
pt.Set(A_ftCurrent.CenterX,A_ftCurrent.CenterY);
lyrCurr:=MapMain.Layers.Item(gDrawLayerName);
FeatureInfLink.HasCirCle:=True;
//在图元点周边画三个红色圆
lyrCurr.style.RegionPattern:=0;
lyrCurr.style.regiontransparent:=true;
lyrCurr.style.regionborderwidth:=2;
lyrCurr.style.regionbordercolor:=miColorRed;
ftNewObj:=MapMain.FeatureFactory.CreateCircularRegion(0,pt,A_RADIUS1,miUnitmeter,EmptyParam,lyrCurr.Style);//报错
ftNew:=lyrCurr.AddFeature(ftNewObj);
FeatureInfLink.ftOneCircle:=ftNew;
ftNewObj:=MapMain.FeatureFactory.CreateCircularRegion(0,pt,A_RADIUS2,miUnitmeter,400,lyrCurr.Style);
ftNew:=lyrCurr.AddFeature(ftNewObj);
FeatureInfLink.ftTwoCircle:=ftNew;
ftNewObj:=MapMain.FeatureFactory.CreateCircularRegion(0,pt,A_RADIUS3,miUnitmeter,EmptyParam,lyrCurr.Style);
ftNew:=lyrCurr.AddFeature(ftNewObj);
FeatureInfLink.ftThreeCircle:=ftNew;
//MapMain.ZoomTo(gFindZoom,A_ftCurrent.CenterX,A_ftCurrent.CenterY);
A_ftCurrent.Style.SymbolBitmapName:='DoorOpen.bmp';
A_ftCurrent.Update;
varClear(pt);
end;