Tomcat上部署Arcgis javascript 离线api

1.到Arcgis 网址下载离线Javascript API包,目前使用的是ArcGIS JSAPI 2.6。下载地址http://download.csdn.net/detail/linyoucheng/4695069
2.把API文件(arcgis_js_api)放到tomcat的webapp目录下;
3.修改如下API包中的文件;



(1)打开 <tomcat安装目录>\webapps\arcgis_js_api\library\2.6\arcgis\js\esri\esri.js
查找 '[HOSTNAME_AND_PATH_TO_JSAPI]', 并替换成 "<计算机名称或IP地址>:8080/arcgis_js_api/library/2.6/arcgis/"

(2)打开 <tomcat安装目录>\webapps\arcgis_js_api\library\2.6\arcgis\js\dojo\dojo\dojo.xd.js
查找 '[HOSTNAME_AND_PATH_TO_JSAPI]', 并替换成 '<myserver>:8080/arcgis_js_api/library/2.6/arcgis/'


(3) 打开 <apache_tomcat_home>\webapps\arcgis_js_api\library\2.6\arcgis\js\dojo\dojo\dojo.xd.js.
查找'[HOSTNAME_AND_PATH_TO_JSAPI]', 并替换成 '<myserver>:8080/arcgis_js_api/library/2.6/arcgis/'



(4)打开 <apache_tomcat_home>\webapps\arcgis_js_api\library\2.6\arcgis_compact\js\esri\esri.js
查找 '[HOSTNAME_AND_PATH_TO_JSAPI]', and replace this text with "<myserver>:8080/arcgis_js_api/library/2.6/arcgis_compact/"

(5)打开 <apache_tomcat_home>\webapps\arcgis_js_api\library\2.6\arcgis_compact\js\dojo\dojo\dojo.xd.js .
查找 '[HOSTNAME_AND_PATH_TO_JSAPI]', 并替换成 '<myserver>:8080/arcgis_js_api/library/2.6/arcgis_compact/'


(6)打开 <apache_tomcat_home>\webapps\arcgis_js_api\library\2.6\arcgis_compact\js\dojo\dojo\dojo.xd.js.uncompressed.js
查找 '[HOSTNAME_AND_PATH_TO_JSAPI]', 并替换成'<myserver>:8080/arcgis_js_api/library/2.6/arcgis_compact/'


修改完后,运行tomcat,打开如下地址,测试是否部署成功:
http://<myserver>:8080/arcgis_js_api/library/2.6/arcgis/ 或者 http://<myserver>:8080/arcgis_js_api/library/2.6/arcgis_compact/

猜你喜欢

转载自youchenglin.iteye.com/blog/1618060