Tomcat上部署Arcgis javascript 离线api

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


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

(2)打开[color=green]\webapps\arcgis_js_api\library\2.6\arcgis\js\dojo\dojo\dojo.xd.js[/color],
查找 '[HOSTNAME_AND_PATH_TO_JSAPI]', 并替换成 ':8080/arcgis_js_api/library/2.6/arcgis/'


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


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

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


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


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

你可能感兴趣的:(Tomcat上部署Arcgis javascript 离线api)