MapGuide開發手記(一)安裝Mapguide與樣本程式

來源:互聯網
上載者:User

安裝Mapguide與樣本程式

有些資料來自自己的翻譯,有些資訊源於網路,僅供參考,無著作權,歡迎轉載。

 

1、安裝MapGuide Server:

** 下載MgServerSetup.exe,並安裝MapGuide Server。

** 可以使用多台電腦共同提供MapGuide Server的功能,當在多台電腦上安裝MapGuide Server時,需要設定一台電腦作為site server,其他的電腦作為support server,在安裝support server時需要提供site server的IP地址。

** MapGuide Server (mgserver.exe)程式在系統啟動時預設為自動啟動,服務名為MapGuide Server(1.2)或MapGuide Server v2.0(2.0)。可以用命令net start/stop/restart "MapGuide Server v2.0"啟動/停止/重啟該服務。

2、安裝MapGuide WebServer Extensions

** 下載MgWebServerExtensionsSetup.exe,安裝MapGuide WebServer Extention。

** MapGuide Server和MapGuide WebServer Extention可以安裝在同一台電腦上,也可安裝在不同的電腦上,需要安裝在其他電腦上時,要提供安裝了MapGuide Server的電腦的IP地址。

** MapGuide WebServer Extention支援的WebServer配置環境:

1) IIS Configuration(對初學者比較適合,支援ASP.NET開發,需ASP.NET 2.0.50727或更高版本的支援);

2) Bundled Configuration(通過Apache Http Server的FastCGI模式支援PHP開發、通過Apache Tomcat支援Java開發);

3) Manual Configuration;

3、測試安裝結果

安裝好MapGuide Server和Extension後,可以訪問以下地址測試是否安裝成功:

(1)測試MapAgent

http://localhost/mapguide/mapagent/mapagent.fcgi?OPERATION=ENUMERATERESOURCES&VERSION=1.0.0&LOCALE=en&RESOURCEID=Library://&TYPE=&DEPTH=-1

預設使用者名: Administrator

預設密碼:admin

以上的使用者名稱和密碼區分大小寫。

如果頁面顯示一個XML檔案,則表示安裝成功。

(2)測試Site Administrator

http://localhost/mapguide/mapadmin/login.php

預設使用者名: Administrator

預設密碼:admin

以上的使用者名稱和密碼區分大小寫。

如果可以登入Site Administrator頁面,則安裝成功。Site Administrator中可以修改所有的Server配置資訊。

(3)測試Web Server Extensions

http://localhost/mapguide/mapviewerajax/ajaxviewer.aspx?WEBLAYOUT=Library://ATest.WebLayout

由於當前MapGuide中沒有ATest.WebLayout,頁面應該顯示如下錯誤資訊:

Resource was not found: Library://ATest.WebLayout,這表示Web Server Extension安裝成功,並可以正常的接收和處理請求。

4、安裝MapGuide DwfViewer

DwfViewer是Mapguide使用的向量資料瀏覽器,安裝了DwfViewer後即可在IE瀏覽器中瀏覽Mapguide向量地圖。

下載DwfViewerSetup_chs.exe安裝Dwf瀏覽器。

5、安裝MapGuide樣本資料

** 下載Mapguide樣本資料Sheboygan.mgp。

** 在Mapguide Server上裝載Sheboygan樣本資料的步驟如下:

(1)將Sheboygan.mgp檔案拷貝到Packages目錄(C:/Program Files/MapGuideOpenSource2.0/Server/Packages)中:

(2)開啟Site Administrator:http://localhost/mapguide/mapadmin/login.php

預設使用者名: Administrator

預設密碼:admin

(3)選擇Configure Services菜單

(4)在Resource Services項中,Package folder目錄資訊應該與步驟(1)中相同:即MapGuideOpenSource安裝目錄/Server/Packages

(5)選擇Manage Packages菜單

(6)在Load Package項中選擇Sheboygan.mgp,點擊Load Package。

資料裝載完畢後,狀態列會顯示Load Succeeded資訊。

如果裝載不成功,可查看日誌資訊:MapGuideOpenSource安裝目錄/Server/Packages/Sheboygan.mgp.log

測試是否成功:

可用MapGuide Studio,則可以在其中查看樣本資料;

也可以使用http方式測試樣本資料裝載成功與否,開啟:http://localhost/mapguide/mapagent/index.html,選擇EnumerateResources選項,在Type 中輸入 WebLayout,點擊提交,如果樣本資料裝載成功,應該獲得如下6個WebLayout:

Library://Samples/Sheboygan/Layouts/SheboyganPhp.WebLayout

Library://Samples/Sheboygan/Layouts/SheboyganPhpTiled.WebLayout

Library://Samples/Sheboygan/Layouts/SheboyganAsp.WebLayout

Library://Samples/Sheboygan/Layouts/SheboyganAspTiled.WebLayout

Library://Samples/Sheboygan/Layouts/SheboyganJsp.WebLayout

Library://Samples/Sheboygan/Layouts/SheboyganJspTiled.WebLayout

6、安裝MapGuide樣本程式

ASP.Net:

下載Mapguide樣本Viewer程式dotnetviewersample。在Mapguide Server上安裝樣本程式dotnetviewersample的步驟如下:

(1)將dotnetviewersample檔案夾拷貝到MapGuide WebServer Extention中的www的檔案夾中,如果裡面沒有bin檔案夾,則從MapGuide WebServer Extention mapviewernet中的bin拷貝進去,如果有則替換;

(2)在IIS服務中開啟mapguide網站,在dotnetviewersample檔案夾上點擊右鍵,選擇屬性,在“目錄”標籤的“應用程式設定”選項中點擊“建立”,點擊“確定”完成dotnetviewersample的配置。

配置好樣本資料和dotnetviewersample樣本程式後,可在瀏覽器中查看該樣本程式的三種效果:

註:需要先安裝DwfViewer軟體才能在Internet Explorer中瀏覽DWF Viewer效果。

DWF Viewer效果:可以瀏覽向量地圖資料,只能在Internet Explorer上運行,URL:

http://localhost/mapguide/dotnetviewersample/dwfviewersample.aspx

AJAX Viewer效果:使用AJAX方式瀏覽地圖資料(非向量),可在Internet Explorer上或Firefox等瀏覽器上運行,URL:

http://localhost/mapguide/dotnetviewersample/ajaxviewersample.aspx

使用分區地圖(tiled map)的AJAX Viewer效果:使用分區地圖和AJAX方式瀏覽地圖資料(非向量),可在Internet Explorer上或Firefox等瀏覽器上運行,URL:

http://localhost/mapguide/dotnetviewersample/ajaxtiledviewersample.aspx

註:在步驟(2)中,如mapviewernet不是應用程式,需要按照步驟(2)的方式將mapviewernet配置為應用程式。

PHP:

(1)下載phpviewersample.zip 地址為https://mapguide.osgeo.org/downloads.html#samples

(2)解壓到 C:/Program Files/MapGuideOpenSource2.0/WebServerExtensions/www

(3)測試:

DWF viewer:http://localhost:8008/mapguide/phpviewersample/dwfviewersample.php

需要安裝 DWF Viewer version 6.5 或更新版本。

Ajax viewer: http://localhost:8008/mapguide/phpviewersample/ajaxviewersample.php

http://localhost:8008/mapguide/phpviewersample/ajaxtiledviewersample.php

7、安裝MapGuide Studio 2008 試用版

MapGuide Studio 是地圖管理工具,使用者可以用Studio進行所見即所得 (WYSIWYG)的便捷管理,對地圖資料進行配置和管理。MapGuide Studio只能安裝在Windows平台。MapGuide Studio不是開來源程式,需要向AutoDesk公司購買。

下載autodeskmapguidestudio2008eval.exe安裝MapGuide Studio。此版本是60天試用版本。

MapGuide Studio和MapGuide Web Studio登入的網站為

http://localhost/mapguide

預設使用者名: Administrator

預設密碼:admin

如果出現版本不相容的問題,則需要打補丁將Autodesk.MapGuide.Studio.Site.dll替換.

8MapGuide Web Studio

MapGuide Web Studio提供了MapGuide Studio的部分功能。MapGuide Web Studio位於MapGuideOpenSource安裝目錄/WebServerExtensions/www/webstudio檔案夾中,URL:http://localhost/mapguide/webstudio/index.html

MapGuide Web Studio登入的網站、使用者名稱、密碼與MapGuide Studio相同。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.