Example #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            double    x         = Convert.ToDouble(textBox1.Text);
            double    y         = Convert.ToDouble(textBox2.Text);
            GISVertex onevertex = new GISVertex(x, y);

            polyvertexes.Add(onevertex);
            GISPolygon onepoly = new GISPolygon(polyvertexes);


            //获取属性信息
            //string attribute = textBox3.Text;
            //GISAttribute oneattribute = new GISAttribute();
            //oneattribute.AddValue(attribute);

            //新建一个GISFeature 并添加到features数组中
            GISFeature onefeature = new GISFeature(onepoly, null);

            features.Add(onefeature);

            //画出这个GISFeature
            Graphics graphics = this.CreateGraphics();

            onefeature.draw(graphics, false, 0);
            //参数分别是画笔 是否绘制属性 属性列表values的索引
        }
Example #2
0
        private void button5_Click(object sender, EventArgs e)
        {
            //获取属性信息
            string       attribute    = textBox3.Text;
            GISAttribute oneattribute = new GISAttribute();

            oneattribute.AddValue(attribute);

            GISPolygon onepoly  = new GISPolygon(polyvertexes);
            Graphics   graphics = this.CreateGraphics();

            oneattribute.draw(graphics, onepoly.endNode(), 0);
        }