示例#1
0
        //添加实体对象集
        private void addGeometryCollectionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            IGeometryCollection geometryCollection1 = new MultipointClass();
            IGeometryCollection geometryCollection2 = new MultipointClass();
            IMultipoint         multipoint;
            object missing = Type.Missing;
            IPoint point;

            for (int i = 0; i < 10; i++)
            {
                point = new PointClass();
                point.PutCoords(i * 2, i * 2);
                geometryCollection1.AddGeometry(point as IGeometry, ref missing, ref missing);
            }
            geometryCollection2.AddGeometryCollection(geometryCollection1);
            multipoint = geometryCollection2 as IMultipoint;
            addFeature("multipoint", multipoint as IGeometry);
            this.axMapControl1.Extent = multipoint.Envelope;
            this.axMapControl1.Refresh();
        }