真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

vb.net地圖控件,winform 地圖控件

請問vb.net添加了ARCGIS的mapcontrol控件后如何添加shp文件然后顯示出來?

你好 ,試下下面代碼,希望對你有用

成都創(chuàng)新互聯(lián)公司長期為上1000+客戶提供的網(wǎng)站建設(shè)服務(wù),團(tuán)隊(duì)從業(yè)經(jīng)驗(yàn)10年,關(guān)注不同地域、不同群體,并針對不同對象提供差異化的產(chǎn)品和服務(wù);打造開放共贏平臺,與合作伙伴共同營造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為孟連企業(yè)提供專業(yè)的成都做網(wǎng)站、成都網(wǎng)站制作,孟連網(wǎng)站改版等技術(shù)服務(wù)。擁有十多年豐富建站經(jīng)驗(yàn)和眾多成功案例,為您定制開發(fā)。

//這是直接根據(jù)路徑名稱加載

private voidmenuAddShp_Click(object sender, EventArgs e)

{

IWorkspaceFactory pWorkspaceFactory = new ShapefileWorkspaceFactory();

IWorkspace pWorkspace = pWorkspaceFactory.OpenFromFile(@"D:\GIS-Data",0);

IFeatureWorkspace pFeatureWorkspace =pWorkspace as IFeatureWorkspace;

IFeatureClass pFC =pFeatureWorkspace.OpenFeatureClass("continent.shp");

IFeatureLayer pFLayer = new FeatureLayerClass();

pFLayer.FeatureClass = pFC;

pFLayer.Name = pFC.AliasName;

ILayerpLayer = pFLayer as ILayer;

IMappMap = axMapControl1.Map;

pMap.AddLayer(pLayer);

axMapControl1.ActiveView.Refresh();

}

//這段是利用對話框添加

從工具箱往窗體上添加一個OpenFileDialog控件。

private voidmenuAddShp_Click(object sender, EventArgs e)

{

IWorkspaceFactorypWorkspaceFactory = new ShapefileWorkspaceFactory();

openFileDialog1.Filter = "shapefile文件(*.shp)|*.shp";

openFileDialog1.InitialDirectory = @"D:\GIS-Data";

openFileDialog1.Multiselect = false;

DialogResultpDialogResult = openFileDialog1.ShowDialog();

if(pDialogResult != DialogResult.OK)

return;

stringpPath = openFileDialog1.FileName;

stringpFolder = Path.GetDirectoryName(pPath);

stringpFileName = Path.GetFileName(pPath);

IWorkspacepWorkspace = pWorkspaceFactory.OpenFromFile(pFolder,0);

IFeatureWorkspacepFeatureWorkspace = pWorkspace as IFeatureWorkspace;

IFeatureClasspFC = pFeatureWorkspace.OpenFeatureClass(pFileName);

IFeatureLayerpFLayer = new FeatureLayerClass();

pFLayer.FeatureClass = pFC;

pFLayer.Name = pFC.AliasName;

ILayerpLayer = pFLayer as ILayer;

IMap pMap =axMapControl1.Map;

pMap.AddLayer(pLayer);

axMapControl1.ActiveView.Refresh();

}

VB.NET (c#) 想做個電子地圖 用什么控件或者第三方控件 (C/S)具體點(diǎn),謝謝了! 可以追加100分

是做網(wǎng)站中的電子地圖嗎?試試百度或者google地圖,很簡單有例子的。

其他的天地圖、MapABC、圖吧等。

vb.net 如何嵌入地圖

新建一個文件,寫入下面的代碼:

!doctype?html

html

head

meta?name="viewport"?content="initial-scale=1.0,?user-scalable=no"?/

meta?http-equiv="Content-Type"?content="text/html;?charset=gbk"?/

titleBaidu?Map?V1.2/title

script?type="text/javascript"?src=";services=true"

!--?add?baidu?map?api?--

/script

/head

body

div?id="container"?style="width:?600px;?height:?400px;"

/div

/body

/html

script?type="text/javascript"

var?map?=?new?BMap.Map("container");???????????? ????//?new?Map

var?point?=?new?BMap.Point(116.397128,?39.916527);??????//?Location,?(經(jīng)度,?緯度)

map.centerAndZoom(point,?15);??????????????????? ????//?show?Map

//?添加縮放功能

map.enableScrollWheelZoom();

map.enableKeyboard();

/script

保存到程序exe同一目錄下,文件名:map.html

然后BUTTON點(diǎn)擊事件:

WebBrowser1.Navigate(Application.StartupPath??"\map.html")

這樣就可以了

ps:經(jīng)緯度可以到百度地圖官網(wǎng)去獲取

或者到: ?去生成代碼


新聞標(biāo)題:vb.net地圖控件,winform 地圖控件
轉(zhuǎn)載來于:http://weahome.cn/article/hsssoi.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部