大家帮帮忙吧!如何擦去用MAPX画的线路中的一部分曲线?(30分)

  • 主题发起人 主题发起人 民工助理
  • 开始时间 开始时间

民工助理

Unregistered / Unconfirmed
GUEST, unregistred user!
通过以下程序画了一条线,在实际应用中,需要擦除其中的一部分,其他的保留,请大家指点一下,应该怎么做!谢谢了!
var
Form1: TForm1;
EditLayer : Variant;
Init:boolean;
X1,Y1,X2,Y2:double;
implementation

{$R *.dfm}
//初始化
procedure TForm1.FormCreate(Sender: TObject);
Var
empty:Variant;
unusedVt: OleVariant;
begin
Map1.Geoset:='D:/Maps/dzdt.gst'; //装载图
TVarData(empty).vType := varError;
TVarData(empty).vError := DISP_E_PARAMNOTFOUND;
Map1.CreateCustomTool(CUSTOM_POINT_TOOL, miToolTypePoint, miSymbolCursor, miArrowCursor, miArrowCursor, empty);
Map1.CreateCustomTool(CUSTOM_POLYGON_TOOL, miToolTypePoly, miCrossCursor, miArrowCursor, miArrowCursor, empty);
Map1.CreateCustomTool(CUSTOM_POLYLINE_TOOL, miToolTypePoly, miCrossCursor, miArrowCursor, miArrowCursor, empty);
Map1.CreateCustomTool(CUSTOM_INFO_TOOL, miToolTypePoint, miCrossCursor, miArrowCursor, miArrowCursor, empty);
EditLayer := Map1.ControlInterface.Layers.Item('线路');
Map1.TitleText:='';
end;
//画线
procedure TForm1.Timer1Timer(Sender: TObject);
var pts : Variant; // Used for storing collection of points
newObj:Variant;
begin
pts := CreateOleObject('MapX.Points.4');
if Init=False then
begin
X1:=113.65678;
Y1:=34.756897;
end;
pts.AddXY(X1, Y1);
X2:=X1+Random(10)/1000;
Y2:=Y1+Random(5)/1000;
pts.AddXY(X2, Y2);
newObj := Map1.ControlInterface.FeatureFactory.CreateLine(pts, Map1.DefaultStyle);
EditLayer.AddFeature(newObj);
X1:=X2;
Y1:=Y2;
Init:=True;

end;
 
后退
顶部