mainxt
April 17, 2019, 9:33am
1
How to do it properly? Create new point I have is obtained. But to move to other coordinates already exists… unable. Here’s my code:
var
cBack: ICallback;
var GLayer: IShapefile := EzMap.Shapefile[GHandle];
var ShapeG: IShape := GLayer.Shape[MwShapeId];
var MoveToPoint: IPoint := CoPoint.Create;
MoveToPoint.x := xy[0];
MoveToPoint.y := xy[1];
GLayer.StartEditingShapes(True, cBack);
ShapeG.Point[0] := MoveToPoint;
GLayer.StopEditingShapes(True, True, cBack);
But something is clearly missing. The point remains in place.
mainxt
April 17, 2019, 4:16pm
2
Judging by the documentation should work like this:
ShapeG.set_Point(0,MoveToPoint);
but it does not work! Something’s missing!
Try using the EditUpdateShape call, to specifically set the Shape before saving edits. I think that you’re only editing the in-memory ShapeG variable, and not actually updating the Shapefile. Something like: ?
GLayer.StartEditingShapes(True, cBack);
ShapeG.Point[0] := MoveToPoint;
GLayer.EditUpdateShape(MwShapeId, ShapeG);
GidrantsLayer.StopEditingShapes(True, True, cBack);
mainxt
April 18, 2019, 5:02am
4
pmeems
Closed
April 22, 2019, 4:00pm
5
This topic was automatically closed after 4 days. New replies are no longer allowed.