Exemplo n.º 1
0
        private void menuTableLoaderTableEnumerator_Click(object sender, System.EventArgs e)
        {
            // load a map with all tables opened so far.
            // clearing the map before this one would be a good idea
            MapTableLoader tl = new MapTableLoader(Session.Current.Catalog.EnumerateTables());

            LoadTables(tl);
        }
Exemplo n.º 2
0
        private void menuTableLoaderTableInfo_Click(object sender, System.EventArgs e)
        {
            string path;

            Session.Current.TableSearchPath.FileExists("world.tab", out path);
            TableInfo      ti = TableInfo.CreateFromFile(path);
            MapTableLoader tl = new MapTableLoader(ti);

            LoadTables(tl);
        }
Exemplo n.º 3
0
        private void menuTableLoaderFileArray_Click(object sender, System.EventArgs e)
        {
            string[] tables = new string[3];
            tables[0] = "us_cnty.tab";
            tables[1] = "usa_caps.tab";
            tables[2] = "uscty_1k.tab";

            MapTableLoader tl = new MapTableLoader(tables);

            LoadTables(tl);
        }
Exemplo n.º 4
0
        public void ShowMap()
        {
            string path      = Application.StartupPath; //Assembly.GetExecutingAssembly().Location;
            String TablePath = Path.Combine(path, "Map");
            String MWSPath   = Path.Combine(TablePath, "map.mws");

            MapInfo.Mapping.MapTableLoader tLoader   = new MapTableLoader();
            MapWorkSpaceLoader             mwsLoader = new MapWorkSpaceLoader(MWSPath);

            this.Map.Load(mwsLoader);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 初始化地图数据到内存
        /// </summary>
        public void InitMemMap()
        {
            mControl = new MapControl();
            string path      = Application.StartupPath; //Assembly.GetExecutingAssembly().Location;
            String TablePath = Path.Combine(path, "Map");
            String MWSPath   = Path.Combine(TablePath, "map.mws");

            MapInfo.Mapping.MapTableLoader tLoader = new MapTableLoader();
            map = mControl.Map;
            MapWorkSpaceLoader mwsLoader = new MapWorkSpaceLoader(MWSPath);

            map.Load(mwsLoader);
            cs = map.GetDisplayCoordSys();
        }
Exemplo n.º 6
0
        private void menuTableLoaderMultipleTables_Click(object sender, System.EventArgs e)
        {
            string path;

            Session.Current.TableSearchPath.FileExists("world.tab", out path);
            Table t1 = Session.Current.Catalog.OpenTable(path);

            Session.Current.TableSearchPath.FileExists("usa.tab", out path);
            Table t2 = Session.Current.Catalog.OpenTable(path);

            Session.Current.TableSearchPath.FileExists("mexico.tab", out path);
            Table          t3 = Session.Current.Catalog.OpenTable(path);
            MapTableLoader tl = new MapTableLoader(t1, t2, t3);

            LoadTables(tl);
        }
Exemplo n.º 7
0
 private void menuItemPickFiles_Click(object sender, System.EventArgs e)
 {
     System.Windows.Forms.OpenFileDialog openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
     openFileDialog1.Multiselect     = true;
     openFileDialog1.CheckFileExists = true;
     openFileDialog1.DefaultExt      = "TAB";
     openFileDialog1.Filter          = "MapInfo Tables (*.tab)|*.tab||";
     if (openFileDialog1.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
     {
         MapTableLoader tl = new MapTableLoader();
         foreach (string filename in openFileDialog1.FileNames)
         {
             tl.Add(filename);
         }
         LoadTables(tl);
     }
 }
Exemplo n.º 8
0
        private void menuTableLoaderMultipleFiles_Click(object sender, System.EventArgs e)
        {
            MapTableLoader tl = new MapTableLoader("ocean.tab", "usa.tab", "mexico.tab", "us_hiway.tab");

            LoadTables(tl);
        }
Exemplo n.º 9
0
        private void menuTableLoaderOneFile_Click(object sender, System.EventArgs e)
        {
            MapTableLoader tl = new MapTableLoader("world.tab");

            LoadTables(tl);
        }
Exemplo n.º 10
0
 private void menuTableLoaderTableInfo_Click(object sender, System.EventArgs e)
 {
     string path;
     Session.Current.TableSearchPath.FileExists("world.tab", out path);
     TableInfo ti = TableInfo.CreateFromFile(path);
     MapTableLoader tl = new MapTableLoader(ti);
     LoadTables(tl);
 }
Exemplo n.º 11
0
 private void menuTableLoaderTableEnumerator_Click(object sender, System.EventArgs e)
 {
     // load a map with all tables opened so far.
     // clearing the map before this one would be a good idea
     MapTableLoader tl = new MapTableLoader(Session.Current.Catalog.EnumerateTables());
     LoadTables(tl);
 }
Exemplo n.º 12
0
 private void menuTableLoaderOneFile_Click(object sender, System.EventArgs e)
 {
     MapTableLoader tl = new MapTableLoader("world.tab");
     LoadTables(tl);
 }
Exemplo n.º 13
0
 private void menuTableLoaderMultipleTables_Click(object sender, System.EventArgs e)
 {
     string path;
     Session.Current.TableSearchPath.FileExists("world.tab", out path);
     Table t1 = Session.Current.Catalog.OpenTable(path);
     Session.Current.TableSearchPath.FileExists("usa.tab", out path);
     Table t2 = Session.Current.Catalog.OpenTable(path);
     Session.Current.TableSearchPath.FileExists("mexico.tab", out path);
     Table t3 = Session.Current.Catalog.OpenTable(path);
     MapTableLoader tl = new MapTableLoader(t1, t2 ,t3);
     LoadTables(tl);
 }
Exemplo n.º 14
0
 private void menuTableLoaderMultipleFiles_Click(object sender, System.EventArgs e)
 {
     MapTableLoader tl = new MapTableLoader("ocean.tab", "usa.tab", "mexico.tab", "us_hiway.tab");
     LoadTables(tl);
 }
Exemplo n.º 15
0
        private void menuTableLoaderFileArray_Click(object sender, System.EventArgs e)
        {
            string[] tables = new string[3];
            tables[0]="us_cnty.tab";
            tables[1]="usa_caps.tab";
            tables[2]="uscty_1k.tab";

            MapTableLoader tl = new MapTableLoader(tables);
            LoadTables(tl);
        }
Exemplo n.º 16
0
 private void menuItemPickFiles_Click(object sender, System.EventArgs e)
 {
     System.Windows.Forms.OpenFileDialog openFileDialog1=new System.Windows.Forms.OpenFileDialog();
     openFileDialog1.Multiselect = true;
     openFileDialog1.CheckFileExists = true;
     openFileDialog1.DefaultExt = "TAB";
     openFileDialog1.Filter = "MapInfo Tables (*.tab)|*.tab||";
     if(openFileDialog1.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
     {
         MapTableLoader tl = new MapTableLoader();
         foreach(string filename in openFileDialog1.FileNames)
         {
             tl.Add(filename);
         }
         LoadTables(tl);
     }
 }