private void button2_Click(object sender, EventArgs e) { double x = Convert.ToDouble(textBox1.Text); double y = Convert.ToDouble(textBox2.Text); GISVertex onevertex = new GISVertex(x, y); linevertexes.Add(onevertex); GISLine oneline = new GISLine(linevertexes); //获取属性信息 //string attribute = textBox3.Text; //GISAttribute oneattribute = new GISAttribute(); //oneattribute.AddValue(attribute); //新建一个GISFeature 并添加到features数组中 GISFeature onefeature = new GISFeature(oneline, null); features.Add(onefeature); //画出这个GISFeature Graphics graphics = this.CreateGraphics(); onefeature.draw(graphics, false, 0); //显然此处不画属性 //参数分别是画笔 是否绘制属性 属性列表values的索引 }
private void button4_Click(object sender, EventArgs e) { //获取属性信息 string attribute = textBox3.Text; GISAttribute oneattribute = new GISAttribute(); oneattribute.AddValue(attribute); GISLine oneline = new GISLine(linevertexes); //创建line作为空间对象找到endnode作为属性绘制的位置 Graphics graphics = this.CreateGraphics(); oneattribute.draw(graphics, oneline.endNode(), 0); }