示例#1
0
        private void Btchangethematic_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedItem == null)
            {
                return;
            }
            GISLayer layer = Document.getLayer(listBox1.SelectedItem.ToString());

            //唯一值地图
            if (comboBox2.SelectedIndex == 0)
            {
                layer.MakeUnifiedValueMap();
                GISThematic Thematic = layer.Thematics[layer.ThematicType];
                Thematic.InsideColor  = btfillcolor.BackColor;
                Thematic.OutsideColor = btboundcolor.BackColor;
                Thematic.Size         = (tbdrawsize.Text == "") ? Thematic.Size : Int32.Parse(tbdrawsize.Text);
            }
            //独立值地图
            else if (comboBox2.SelectedIndex == 1)
            {
                layer.MakeUniqueValueMap(comboBox3.SelectedIndex);
            }
            //分层设色地图
            else if (comboBox2.SelectedIndex == 2)
            {
                if (layer.MakeGradualColor(comboBox3.SelectedIndex, Int32.Parse(tblevelnumber.Text)) == false)
                {
                    MessageBox.Show("基于该属性无法绘制分层设色地图!!");
                    return;
                }
            }
            //更新地图绘制
            Mapwindow.UpdateMap();
        }
示例#2
0
        private void Btchangethematic_Click(object sender, EventArgs e)
        {
            Color maxvcolor = btmaxvcolor.BackColor;
            Color minvcolor = btminvcolor.BackColor;
            Color edgecolor = btedgecolor.BackColor;

            //如果选择的是默认的分位数分级方法
            if (cbleveltype.SelectedIndex == 0)
            {
                if (layer.MakeGradualColor(cbattribute.SelectedIndex, Int32.Parse(tblevelnumber.Text), maxvcolor, minvcolor, edgecolor) == false)
                {
                    MessageBox.Show("基于该属性无法绘制分层设色地图!!");
                    return;
                }
            }
            //如果选择的是等间隔分级方法
            else if (cbleveltype.SelectedIndex == 1)
            {
                if (layer.MakeGradualColorByGap(cbattribute.SelectedIndex, Int32.Parse(tblevelnumber.Text), maxvcolor, minvcolor, edgecolor) == false)
                {
                    MessageBox.Show("基于该属性无法绘制等间隔的分层设色地图!!");
                    return;
                }
            }
            //如果选择标准差分级方法
            else if (cbleveltype.SelectedIndex == 2)
            {
                if (layer.MakeGradualColorBySD(cbattribute.SelectedIndex, maxvcolor, minvcolor, edgecolor) == false)
                {
                    MessageBox.Show("基于该属性无法绘制标准差法分层设色地图!!");
                    return;
                }
            }

            //更新地图绘制
            if (sender.Equals(preview))
            {
                PreviewWindow.UpdateMap();
            }
            else if (sender.Equals(btchangethematic))
            {
                Mapwindow.UpdateMap();
            }
        }