C#调用MapObject 去http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleShow&d=26414看看吧,也许有用。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这是我用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);} highcharts制作图表 出现中文乱码 怎样把下载地址转换到自己的服务器上面 新人求解 控件伸缩如何实现? 自动的读取其它网站网页显示的信息 ssis包,添加了变量,如何保存在密码中 visual studio 2005做好了的工程想改名怎么改? MaskTextBox如果在输入的时候,显示空格 "#VAR1#","#VAR2#"这样的字符代表什么意思阿? 英文翻译几句话,急!急!急!急!! 谁来帮帮我啊 我是个初学c# 发送短消息 求救,为什么我的windows服务无法启动? 难道没有listItem的属性吗?
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);
}