MapXtreme 应用 将图元放在指定的位置

public void SetFeatureLocation(Feature fr, double x, double y)
        {
            if (fr != null)
            {
                DPoint lastP = fr.Geometry.Centroid;

                double stepX = x - lastP.x;
                double stepY = y - lastP.y;

                fr.Geometry.GeometryEditor.OffsetByXY(stepX, stepY, DistanceUnit.Degree, DistanceType.Spherical);
                fr.Geometry.EditingComplete();
                fr.Update();
            }
        }

 

==========================================

GeometryEditor 下有三个方式

        void OffsetByAngle(double angle, double distance, DistanceUnit unit, DistanceType type);
        void OffsetByXY(double deltaX, double deltaY, DistanceUnit unit, DistanceType type);
        void Rotate(DPoint anchorPoint, double angle);

==========================================

posted on 2013-02-20 11:39  读懂洋字码  阅读(221)  评论(0编辑  收藏  举报