本地部署离线ArcGIS JavaScript库
来源:互联网 发布:树叶网络 编辑:程序博客网 时间:2024/04/19 21:47
Installing the ArcGIS API for JavaScript™ Library
The instructions below assume that you are installing the ArcGIS JavaScript API library in the following location on an IIS Web Server, "http://<myserver>/arcgis_js_api/library/2.7/arcgis/" where <myserver> is the domain name of your Web site. After copying files to your Web server, you will need to edit some files to include the URL to the server and directory that you are planning to install to.
For instructions on deploying the library on Linux please go here.
ArcGIS JSAPI 2.7 contains two builds--a normal build and a compact build. The compact build removes the Dojo Dijit dependancy and minimizes the non-essential ArcGIS JSAPI classes. Please see the documentation for more details.
Your directions may differ depending on your server configuration or Web server, but the process is the same.
- Copy
\arcgis_js_api\library
and all its contents from the DVD to your Web server. In this example the files are copied toC:\Inetpub\wwwroot\arcgis_js_api\library
Configuration options for normal build:
- Open
C:\Inetpub\wwwroot\arcgis_js_api\library\2.7\jsapi\js\esri\esri.js
in a text editor. - Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with"<myserver>/arcgis_js_api/library/2.7/jsapi/"
- Open
C:\Inetpub\wwwroot\arcgis_js_api\library\2.7\jsapi\js\dojo\dojo\dojo.xd.js
in a text editor. - Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>/arcgis_js_api/library/2.7/jsapi/'
- Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>/arcgis_js_api/library/2.7/jsapi/'
- Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>/arcgis_js_api/library/2.7/jsapi/'
- Open
C:\Inetpub\wwwroot\arcgis_js_api\library\2.7\jsapi\js\dojo\dojo\dojo.xd.js.uncompressed.js
in a text editor. - Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>/arcgis_js_api/library/2.7/jsapi/'
- Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>/arcgis_js_api/library/2.7/jsapi/'
- Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>/arcgis_js_api/library/2.7/jsapi/'
Configuration options for compact build:
- Open
C:\Inetpub\wwwroot\arcgis_js_api\library\2.7\jsapicompact\js\esri\esri.js
in a text editor. - Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with"<myserver>/arcgis_js_api/library/2.7/jsapicompact/"
- Open
C:\Inetpub\wwwroot\arcgis_js_api\library\2.7\jsapicompact\js\dojo\dojo\dojo.xd.js
in a text editor. - Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>/arcgis_js_api/library/2.7/jsapicompact/'
- Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>/arcgis_js_api/library/2.7/jsapicompact/'
- Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>/arcgis_js_api/library/2.7/jsapicompact/'
- Open
C:\Inetpub\wwwroot\arcgis_js_api\library\2.7\jsapicompact\js\dojo\dojo\dojo.xd.js.uncompressed.js
in a text editor. - Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>/arcgis_js_api/library/2.7/jsapicompact/'
- Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>/arcgis_js_api/library/2.7/jsapicompact/'
- Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>/arcgis_js_api/library/2.7/jsapicompact/'
- Deploy a handler. The JavaScript APIs stream multiple JavaScript files. In order to have one URL that delivers all the JavaScript content you must deploy a handler that simultaneously streams the appropriate files to the browser. Included in the library directory are three handlers that you can use. Use Default.ashx for IIS, index.jsp for a Java Application server (such as Tomcat), or index.php for a php application server. Note that the handlers have changed at version 2.0. If you installed a previous version of the handler you will need to replace this handler with 2.0.
For example, to deploy on IIS you need to modify the default content page to include Default.ashx. Steps include:
- Open IIS Manager.
- Navigate to folder that contains Default.ashx (in this example this is C:\Inetpub\wwwroot\arcgis_js_api\library\2.7\jsapi).
- Open properties dialog (right click, properties).
- Click the Documents Tab.
- Ensure Enable default content page has been clicked.
- Click Add... Button.
- Enter "Default.ashx" and Add.
- Press OK and Exit.
- Access the ArcGIS JavaScript library from your Web server using the following URL:
http://<myserver>/arcgis_js_api/library/2.7/arcgis/
andhttp://<myserver>/arcgis_js_api/library/2.7/jsapicompact/
- Change the ArcGIS Services Directory "View In JavaScript" URL. Instructions are given in "Configuring the REST API" in the ArcGIS Server REST SDK. On Windows, the location is
<Installation Location>\DeveloperKit\Help\REST\index.html
. On UNIX and Linux, the location ishttp://<myserver>:8399/<instance>/sdk/rest/index.html
wheremyserver
is your server name andinstance
is the instance name (arcgis is the default).- Find the "JavaScript API" section for either .NET or Java for more information about parameter values.
- For .NET, the parameters to change in
rest.config
are<ArcGIS>
and<ArcGISCSS>
. Replaceserverapi.arcgisonline.com
with your server domain name. - For Java, the parameters to change in
rest-config.properties
arejsapi.arcgis
andjsapi.arcgis.css
. Replaceserverapi.arcgisonline.com
with your server domain name.
- Test your install. You can use the following test code to validate your JSAPI library install.
Test Code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Simple Map</title> <link rel="stylesheet" type="text/css" href="http://<myserver>/arcgis_js_api/library/2.7/jsapi/js/dojo/dijit/themes/tundra/tundra.css"> <script type="text/javascript" src="http://<myserver>/arcgis_js_api/library/2.7/jsapi/"></script> <script type="text/javascript"> dojo.require("esri.map"); function init() { var myMap = new esri.Map("mapDiv"); //note that if you do not have public Internet access then you will need to point this url to your own locally accesible cached service. var myTiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer"); myMap.addLayer(myTiledMapServiceLayer); } dojo.addOnLoad(init); </script> </head> <body class="tundra"> <div id="mapDiv" style="width:900px; height:600px; border:1px solid #000;"></div> </body></html>
Installing the ArcGIS JavaScript API SDK
The ArcGIS JavaScript API SDK can be copied in its entirety to your Web server directory. This SDK is equivalent to the version found on the ArcGIS Resource Center:http://resources.esri.com/arcgisserver/apis/javascript/arcgis/index.cfm?fa=home
- Copy
\arcgis_js_api\sdk
and all its contents from the DVD to your Web server. In this example the files are copied toC:\Inetpub\wwwroot\arcgis_js_api\sdk
- The start page is "home.htm". If you chose to do so, you can rename this page.
- 本地部署离线ArcGIS JavaScript库
- ArcGIS JavaScript API本地部署离线开发环境
- 部署本地(离线)arcgis server api for javascript
- ArcGIS 10.2 JavaScript API本地部署离线开发环境
- ArcGIS 10.2 JavaScript API本地部署离线开发环境
- ArcGIS Javascript API离线部署
- Arcgis API for Javascript 3.5最新版离线本地部署方法-中文
- ArcGIS API for JavaScript 3.17/4.0离线包本地部署安装
- arcgis api for javascript 离线部署后,加载高德地图 本地加载测试已成功
- ArcGIS 10.2 JavaScript API本地部署离线开发环境 地图空白的问题
- 标记一下 离线部署arcgis javascript api
- ArcGIS Javascript 3.11 离线部署方法
- Tomcat 上部署ArcGis javascript 离线API
- ArcGIS API for JavaScript离线部署
- 离线部署arcgis api for javascript
- 离线部署ArcGIS API for Javascript
- ArcGIS API For Javascript之离线部署
- # 从ArcGIS API For Javascirp4.0本地离线部署
- 每天一点正则表达式积累(五)
- yum 升级PHP的方法
- linux 驱动开发 自动创建节点的问题
- 内存数据库T-tree索引
- FFMPEG解码H264拼帧简解
- 本地部署离线ArcGIS JavaScript库
- Linux内核信号处理机制介绍
- inputStream转outputStream
- Vim命令
- 谁能帮我看看错在哪里 A+B for matrices
- HDOJ 1753
- 表格行拖动
- vim
- 任意2对数组比较