學生姓名: 張俊山
學生學號: 0809100122
所在班級: 10級地理資訊系統
實習時間: 2012-10-11
實習地點: 城環機房
實現放大縮小功能
實驗目的:
新增工具欄,分別實現放大、縮小、平移和全圖
滑鼠形狀新增固定圖層
驗證以開啟對話方塊的形式開啟mapobjects支援的所有格式中shp格式的圖層,完成顯示。掌握commanddialog 元件新增圖層的方法
實驗內容:
選擇選單"工程"—>"部件",新增microsoft windows common controls 6.0或microsoft windows common controls 5.0後,這樣就可以在左邊的工具箱中找到*******, imagelist。
然後,把*******, imagelist拖放
到form中就可以。
在相應按鈕(放大、平移、縮小和全圖)的click事件中分別加入以下**(或在工具欄的click事件中加入以下**):
map1.mousepointer = mozoomin
map1.mousepointer = mopan
map1.mousepointer = mozoomout
map1.mousepointer = modefault
載入固定資料夾下的shp檔案
dim dc as new dataconnection
dim layer as maplayer
dc.database = app.path
if not then
msgbox "在指定的資料夾下沒找到圖層資料檔案!"
endend if
set layer = new maplayer
set layer.geodataset = dc.findgeodataset("states")
map1.layers.add layer
set layer = new maplayer
set layer.geodataset = dc.findgeodataset("rivers")
map1.layers.add layer
map1.refresh
以對話方塊形式加shp圖層
匯入commondialog 元件,這一元件在物件庫microsoft common dialog control 6.0 中。新增map控制項,conmon dialog 控制項,並將其名稱改為cdlg1,新增乙個按鈕。
在form上增加乙個標註「增加圖層」的按鈕,並增加visual basic的commondialog控制項,以便確定shape檔案的路徑和檔名。雙擊增加圖層按鈕就可以程式設計了,增加以下的vb語句。
private sub commandl_click()
『開啟對話方塊的方式新增圖層
commondialog1.cancelerror = true
commondialog1.dialogtitle = "選擇地**件"
dim oconnect as new dataconnection
dim odataset as geodataset
dim sname as string
dim olayer as mapobjects2.maplayer
commondialog1.filter = "esri shapefiles (*.shp)|*.shp"
commondialog1.showopen
if len(commondialog1.filename) = 0 then exit sub
oconnect.database = curdir
if not then exit sub
sname = left(commondialog1.filetitle, len(commondialog1.filetitle) - 4)
set odataset = oconnect.findgeodataset(sname)
if odataset is nothing then exit sub
set olayer = new maplayer
olayer.geodataset = odataset
map1.layers.add olayer
map2.layers.add olayer
legend1.setmapsource map1
legend1.loadlegend true
map1.refresh
end sub
實驗心得:
基本掌握了怎樣新增工具欄,實現放大、縮小、平移和全圖的操作步驟,對新增圖層還不是很熟練;對其中的**雖然還不是很理解,但其基本方法和步驟還是基本掌握了。
計算機地圖製圖
第一章一 地圖 1 是按照一定的數學法則,將地球表面上的空間資訊,經概括綜合後以視覺化 數位化的符號形式,縮小表達在一定載體上的圖形模型。2 地圖可分為普通地圖 專題地圖 計算機地圖製圖又稱機助地圖製圖或數字地圖製圖,是以傳統的地圖製圖原理為基礎,以計算機及其外圍裝置為工具,採用資料庫技術和圖形數字...
計算機地圖製圖指導書
實驗 coreldraw專業繪圖工具認識和使用 一 實驗課時和型別 學時 2 實驗型別 驗證性 二 實驗目的 認識和理解coreldraw專業繪圖工具軟體,了解其基本功能,掌握coreldraw軟體的基本操作方法。掌握運用coreldraw繪製一幅專題地圖的基本步驟和方法,掌握部分技術性強的向量符號...
計算機上機實習
一 實習目的 上機實習是在學生已經學習了部分專業課以後進行的,是理論與實際相結合的重要環節。專業實習對於學生綜合素質的提高具有重要意義。專業實習的目的是提高學生的動手能力和綜合實踐能力,提高學生的學習興趣,為提高學生的就業競爭打好基礎。更好的掌握電腦的應用。二 實習時間 2011 6 20 2011...