arcgis for js 4.5 部署到tomcat报错

1.已经将arcgis js放在tomcat目录下...apache-tomcat-7.0.57\webapps\arcgis\arcgis_js_v45_api\arcgis_js_api\library\4.5\dojo
 
2.dojo.js也修改如下:
baseUrl:"http://localhost:8080/arcgis/a ... ot%3B
 
3.jsp引进css和js
<link rel="stylesheet" href="http://localhost:8080/arcgis/a ... ot%3B />
<link rel="stylesheet" href="http://localhost:8080/arcgis/a ... ot%3B />
<script src="http://localhost:8080/arcgis/a ... jo.js"></script>
 
4.访问arcgis server的地图
<script>
      var myMap, view;
      require([
        "esri/Basemap",
        "esri/layers/TileLayer",
        "esri/Map",
        "esri/views/MapView",
        "dojo/domReady!"
      ], function (Basemap, TileLayer, Map, MapView){
        // --------------------------------------------------------------------
        // If you do not have public Internet access then use the Basemap class
        // and point this URL to your own locally accessible cached service.
        //
        // Otherwise you can just use one of the named hosted ArcGIS services.
        // --------------------------------------------------------------------
        var layer = new TileLayer({
          url: "http://172.21.241.165:6080/arc ... ot%3B
        });
        var customBasemap = new Basemap({
          baseLayers: [layer],
          title: "Custom Basemap",
          id: "myBasemap"
        });
        myMap = new Map({
          basemap: customBasemap
        });
        view = new MapView({
          center: [-111.87, 40.57], // long, lat
          container: "viewDiv",
          map: myMap,
          zoom: 6
        });
      });
    </script>
 
5.执行结果报错:

QQ截图20171008110632.jpg

 
 
 
已邀请:

Anyway

赞同来自:

感觉地图是调用成功了,
因为左上角有加减的操作杆,以及右下角有"powered by Esri"字样出现。
但不知道为什么会报Uncaught TypeError: Cannot read property 'pause' of null错误。
小弟初学,有大神帮忙看下原因吗?万分感谢!!

GIS晴天 - webgis爱好者

赞同来自:

你肯定部署错了,我刚部署了是可以用的,我部署的IIS服务器
只需将[HOSTNAME_AND_PATH_TO_JSAPI]替换为
localhost/arcgis_js_v45_api/arcgis_js_api/library/4.5/
 
 
注意要将https改为http否则是不可以的,结果如图:
 
22.PNG

经过测试,可以正常运行,希望能帮到你!


 
 

mushroom

赞同来自:

init.js改了吗?我们这刚部署的,没有问题啊

bafam

赞同来自:

请问楼主解决了么
 

要回复问题请先登录注册