示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog of = new OpenFileDialog();

            of.Multiselect = true;
            string[] filenames = {};
            if (of.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                filenames = of.FileNames;
            }
            if (filenames.Length == 0)
            {
                MessageBox.Show("Choose shpfile!");
            }
            else
            {
                layers.Clear();
                for (int i = 0; i < filenames.Length; i++)
                {
                    ShapeFileRW shp = new ShapeFileRW(filenames[i]);
                    layers.Add(shp.GetLayer());
                }
                FullExtent();
            }
        }
示例#2
0
        private void Form2_Load(object sender, EventArgs e)
        {
            ShapeFileRW shapefilerw3 = new ShapeFileRW(@"data\states.shp");

            layers.Add(shapefilerw3.GetLayer());
            ShapeFileRW shapefilerw1 = new ShapeFileRW(@"data\roads.shp");

            layers.Add(shapefilerw1.GetLayer());
            ShapeFileRW shapefilerw2 = new ShapeFileRW(@"data\cities.shp");

            layers.Add(shapefilerw2.GetLayer());

            FullExtent();
        }