arcgis server for js加载栅格地图服务地图无法显示问题

arcgis server for js开发ArcGISTiledMapServiceLayer加载矢量地图服务和栅格地图服务导致栅格地图无法显示问题

问题陈述

1.在项目开发地图中一直使用的是ArcGISTiledMapServiceLayer加载发布的固定比例尺切片按需加载地图的服务模式,项目需要加载卫星地图,随后下载landset8切片后处理下做出卫星地图,卫星地图也发布的固定比例尺切片按需加载地图的服务模式,在加载中发现只有矢量地图出现,卫星(栅格)地图并未出现

问题代码


<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>arcgis卫星影像地图加载title>
    <link rel="stylesheet" type="text/css" href="http://localhost:8087/arcgis_js_api/library/3.22/3.22/esri/css/esri.css" />
    <script src="http://localhost:8087/arcgis_js_api/library/3.22/3.22/init.js">script>
    <script src="../js/jquery-1.3.1.js">script>
    <style>
        html, body, #map {
            width:   100%;
            height:  100%;
            margin:  0;
            padding: 0;
        }
    style>
    <script>
        require([
            "dojo/dom-construct",
            "esri/layers/ArcGISTiledMapServiceLayer",
            "esri/map",
            "esri/geometry/Extent",
            "esri/SpatialReference",
            "esri/layers/ArcGISDynamicMapServiceLayer",
            "dojo/domReady!"
        ], function(
            domConstruct, 
            ArcGISTiledMapServiceLayer, Map,Extent,SpatialReference,
            ArcGISDynamicMapServiceLayer
        ) {
      
            var map = new Map("map", {
                extent: new Extent({                "xmin":126.08797131337525,"ymin":41.88483304829672,"xmax":130.05572254059723,"ymax":47.20292839632739,"spatialReference":{
     "wkid":4326}})
            });
            var shpTiledMapServiceLayer= new ArcGISTiledMapServiceLayer("http://localhost:6080/arcgis/rest/services/矢量地图/MapServer");
            var salliteTiledMapServiceLaye = new ArcGISTiledMapServiceLayer("http://localhost:6080/arcgis/rest/services/卫星地图/MapServer");
            map.addLayer(shpTiledMapServiceLayer);
                 map.addLayer(salliteTiledMapServiceLaye);
            })
    script>
head>
<body>
<div id="map" style="height:90%;border:1px solid #000;">div>
body>

发现问题

1.ArcGISTiledMapServiceLayer的矢量地图和卫星地图无法同事加载进一个map中无法显示卫星地图,并且没有报错;

问题解决

1.使用ArcGISDynamicMapServiceLayer加载卫星地图即可两个都显示

解决代码


<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>arcgis卫星影像地图加载title>
    <link rel="stylesheet" type="text/css" href="http://localhost:8087/arcgis_js_api/library/3.22/3.22/esri/css/esri.css" />
    <script src="http://localhost:8087/arcgis_js_api/library/3.22/3.22/init.js">script>
    <script src="../js/jquery-1.3.1.js">script>
    <style>
        html, body, #map {
            width:   100%;
            height:  100%;
            margin:  0;
            padding: 0;
        }
    style>
    <script>
        require([
            "dojo/dom-construct",
            "esri/layers/ArcGISTiledMapServiceLayer",
            "esri/map",
            "esri/geometry/Extent",
            "esri/SpatialReference",
            "esri/layers/ArcGISDynamicMapServiceLayer",
            "dojo/domReady!"
        ], function(
            domConstruct, 
            ArcGISTiledMapServiceLayer, Map,Extent,SpatialReference,
            ArcGISDynamicMapServiceLayer
        ) {
      
            var map = new Map("map", {
                extent: new Extent({                "xmin":126.08797131337525,"ymin":41.88483304829672,"xmax":130.05572254059723,"ymax":47.20292839632739,"spatialReference":{
     "wkid":4326}})
            });
            var shpTiledMapServiceLayer= new ArcGISTiledMapServiceLayer("http://localhost:6080/arcgis/rest/services/矢量地图/MapServer");
            var satelliDynamicMapServiceLaye = new ArcGISDynamicMapServiceLayer("http://localhost:6080/arcgis/rest/services/卫星地图/MapServer");
            map.addLayer(shpTiledMapServiceLayer);
            map.addLayer(satelliDynamicMapServiceLaye);
            });
    script>
head>
<body>
<div id="map" style="height:90%;border:1px solid #000;">div>
body>

问题探讨

为啥会出现这个问题,暂时不知道原因,有知道的大佬望指教

你可能感兴趣的:(arcgis,arcgis,卫星地图,arcgis卫星地图不显示)