ArcGIS_API for Javascript 3.9 tomcat 下部署

ArcGIS_API for Javascript 部署可以部署在IIS下,也可部署在tomcat下。我用的tomcat,在此介绍一下过程:
1.将arcgis_js_api 文件夹放置在tomcat/webapps目录下
2.找到webapps/arcgis_js_api/library/3.9/3.9目录下d init.js文件,搜索出文件中的’[HOSTNAME_AND_PATH_TO_JSAPI]’将其替换为’localhost:8080/arcgis_js_api/library/3.9/3.9/’,
3.找到webapps/arcgis_js_v39_api/arcgis_js_api/library/3.9/3.9/js/dojo/dojo目录下dojo.js,搜索出文件中的’[HOSTNAME_AND_PATH_TO_JSAPI]’将其替换为”localhost:8080/arcgis_js_api/library/3.9/3.9/”。
4.在webapps/arcgis_js_api/library/3.9/3.9下新建一个html文件,将一下代码复制到html中,


<html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title>Simple Maptitle>
        <link rel="stylesheet" type="text/css" href="http:///arcgis_js_api/library/3.9/3.9/js/dojo/dijit/themes/tundra/tundra.css"/>
        <link rel="stylesheet" type="text/css" href="http:///arcgis_js_api/library/3.9/3.9/js/esri/css/esri.css" />
        <script type="text/javascript" src="http:///arcgis_js_api/library/3.9/3.9/init.js">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 accessible 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>

5.在浏览器中访问此页面,如页面如下,表示部署成功
ArcGIS_API for Javascript 3.9 tomcat 下部署_第1张图片

你可能感兴趣的:(ArcGIS_API for Javascript 3.9 tomcat 下部署)