将ArcGIS API for javascript的离线包部署在Tomcat下

本文详细介绍如何在Linux环境下配置并部署ArcGIS API for JavaScript,包括修改主机名路径及验证安装是否成功的方法。

因工作需要前几天在Linux上部署了ArcGIS API for javascript的离线包,其实这个和在IIS下部署大同小异,就是Copy和改写计算机名称等,详细步骤如下

  1. <apache_tomcat_home>/webapps/arcgis_js_api/library

    Configuration options for normal build:

  2. Open <apache_tomcat_home>\webapps\arcgis_js_api\library\2.3\arcgis\js\esri\esri.js in a text editor.
  3. Search for the text '[HOSTNAME_AND_PATH_TO_JSAPI]', and replace this text with "<myserver>:8080/arcgis_js_api/library/2.3/arcgis/"
  4. Open <apache_tomcat_home>\webapps\arcgis_js_api\library\2.3\arcgis\js\dojo\dojo\dojo.xd.js in a text editor.
  5. Search for the text '[HOSTNAME_AND_PATH_TO_JSAPI]', and replace this text with '<myserver>:8080/arcgis_js_api/library/2.3/arcgis/'
  6. Search for the text '[HOSTNAME_AND_PATH_TO_JSAPI]', and replace this text with '<myserver>:/arcgis_js_api/library/2.3/arcgis/'
  7. Search for the text '[HOSTNAME_AND_PATH_TO_JSAPI]', and replace this text with '<myserver>:/arcgis_js_api/library/2.3/arcgis/'
  8. Open <apache_tomcat_home>\webapps\arcgis_js_api\library\2.3\arcgis\js\dojo\dojo\dojo.xd.js.uncompressed.js in a text editor.
  9. Search for the text '[HOSTNAME_AND_PATH_TO_JSAPI]', and replace this text with '<myserver>:8080/arcgis_js_api/library/2.3/arcgis/'
  10. Search for the text '[HOSTNAME_AND_PATH_TO_JSAPI]', and replace this text with '<myserver>:8080/arcgis_js_api/library/2.3/arcgis/'
  11. Search for the text '[HOSTNAME_AND_PATH_TO_JSAPI]', and replace this text with '<myserver>:8080/arcgis_js_api/library/2.3/arcgis/'

    Configuration options for compact build:

  12. Open <apache_tomcat_home>\webapps\arcgis_js_api\library\2.3\arcgis_compact\js\esri\esri.js in a text editor.
  13. Search for the text '[HOSTNAME_AND_PATH_TO_JSAPI]', and replace this text with "<myserver>:8080/arcgis_js_api/library/2.3/arcgis_compact/"
  14. Open <apache_tomcat_home>\webapps\arcgis_js_api\library\2.3\arcgis_compact\js\dojo\dojo\dojo.xd.js in a text editor.
  15. Search for the text '[HOSTNAME_AND_PATH_TO_JSAPI]', and replace this text with '<myserver>:8080/arcgis_js_api/library/2.3/arcgis_compact/'
  16. Search for the text '[HOSTNAME_AND_PATH_TO_JSAPI]', and replace this text with '<myserver>:8080/arcgis_js_api/library/2.3/arcgis_compact/'
  17. Search for the text '[HOSTNAME_AND_PATH_TO_JSAPI]', and replace this text with '<myserver>:8080/arcgis_js_api/library/2.3/arcgis_compact/'
  18. Open <apache_tomcat_home>\webapps\arcgis_js_api\library\2.3\arcgis_compact\js\dojo\dojo\dojo.xd.js.uncompressed.js in a text editor.
  19. Search for the text '[HOSTNAME_AND_PATH_TO_JSAPI]', and replace this text with '<myserver>:8080/arcgis_js_api/library/2.3/arcgis_compact/'
  20. Search for the text '[HOSTNAME_AND_PATH_TO_JSAPI]', and replace this text with '<myserver>:8080/arcgis_js_api/library/2.3/arcgis_compact/'
  21. Search for the text '[HOSTNAME_AND_PATH_TO_JSAPI]', and replace this text with '<myserver>:8080/arcgis_js_api/library/2.3/arcgis_compact/'
  22. Now you shoudl be able to access the ArcGIS JavaScript. library from your Web server using the following URL:

    http://<myserver>:8080/arcgis_js_api/library/2.3/arcgis/ and http://<myserver>:8080/arcgis_js_api/library/2.3/arcgis_compact/

  23. 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 is http://<myserver>:8399/<instance>/sdk/rest/index.html where myserver is your server name and instance 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>. Replace serverapi.arcgisonline.com with your server domain name.
    • For Java, the parameters to change in rest-config.properties are jsapi.arcgis and jsapi.arcgis.css. Replace serverapi.arcgisonline.com with your server domain name.
  24. Test your install. You can use the following test code to validate your JSAPI library install.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值