zoukankan      html  css  js  c++  java
  • MapEase

    这是我用MapEase编的程,希望对你有参考作用  
       
      private   MEDataEngine.MeDataConnection   conn;       //map链接  
      private   AxMapEase.AxMeMap   mapMain;  
       
      private   void   FormMain_Load(object   sender,   System.EventArgs   e)  
      {  
              conn   =   new     MEDataEngine.MeDataConnectionClass();       //链接实例化  
              InitMapData();  
      }  
       
      //加载层  
      private   void   InitMapData()  
      {  
                        conn.Database   =   GetDataPath("..\\..\\..\\Data108");     //打开map所在目录      
      if   (!conn.Open())  
      {  
      MessageBox.Show("Could   not   connect   to   the   geo   database.");  
      return;  
      }  
       
      ///********************************************************  
      ///初始化mapMain  
      ///********************************************************  
      MeMapModel   mapModel1   =   new   MeMapModelClass();  
      mapModel1.BackColor   =   (MEMap.Colors)0xE3F6E1;  
       
      AddLayer("VDTable",   mapModel1);       //"VDTable"——table名  
       
      mapMain.MapModel   =   mapModel1;  
      mapMain.MouseTool   =   new   MePanToolClass();  
      }  
       
      private   void   AddLayer(string   dsName,   MeMapModel   mapModel)  
      {  
      //   get   geo   data   source   from   connection  
      MeSetVDataSource   dataSource;  
      dataSource   =   (MeSetVDataSource)conn.FindDataSource(dsName);  
      if   (dataSource   ==   null)  
      {  
      MessageBox.Show("Could   not   find   the   geo   data   source:   "   +   dsName); return;  
      }  
       
      //   open   the   geo   data   source  
      if   (!dataSource.Open(true,   true))  
      {  
      MessageBox.Show("Failed   to   open   the   geo   data   source:   "   +   dsName);  
      return;  
      }  
       
      //   create   a   geo   dataset   object   from   the   geo   data   source  
      MEDataEngine.MeVectorDataset   dataset   =   new   MEDataEngine.MeVectorDataset();  
      dataset.Open(dataSource,   mapModel.CoordinateSystem,   null);  
       
      //   then   add   the   dataset   to   the   map   model//s   Datasets   collection  
      mapModel.Datasets.Add(dataset);  
       
      //   create   layer   from   dataset  
      MeVectorLayer   layer   =   new   MeVectorLayerClass();  
      layer.Name   =   mapModel.Layers.GetDefaultName(dataset.Name);  
      MeRecordset   rs   =   new   MeRecordsetClass();  
      rs.Open(dataset,   null);  
      layer.DataSource   =   rs;  
       
      //   add   to   the   layers   collection  
      mapModel.Layers.Add(layer);  
      }
  • 相关阅读:
    UOJ 347(洛谷4220) 【WC2018】通道——随机化
    bzoj 5006(洛谷 4547) [THUWC2017]Bipartite 随机二分图——期望DP
    bzoj 5020(洛谷4546) [THUWC 2017]在美妙的数学王国中畅游——LCT+泰勒展开
    bzoj 4006 [JLOI2015]管道连接——斯坦纳树
    洛谷4294 [WC2008]游览计划——斯坦纳树
    CF 757 E Bash Plays with Functions —— 积性函数与质因数分解
    洛谷 P2444 [ POI 2000 ] 病毒 —— AC自动机+dfs
    洛谷 P1072 Hankson 的趣味题 —— 质因数分解
    洛谷 P1071 潜伏者 —— 模拟
    洛谷 P1541 乌龟棋 —— DP
  • 原文地址:https://www.cnblogs.com/lgzh3/p/992718.html
Copyright © 2011-2022 走看看