AnsweredAssumed Answered

no display my MapServer when i add multi map serviecs (MapServer)

Question asked by sinharcgis on Oct 14, 2014
Latest reply on Oct 17, 2014 by sinharcgis

i have link MapServer(cached)  http://localhost:6080/arcgis/rest/services/NenChung2909  i want add  this MapServer above Esri MapServer, but when i add two MapServer then my MapServer isnot show, Esri MapServer is show. please help me! thank you! This is my code:

 

<!DOCTYPE html>

<html>

  <head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    <!--The viewport meta tag is used to improve the presentation and behavior of the samples

      on iOS devices-->

    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">

    <title>Terrain basemap with custom data</title>

    <link rel="stylesheet" href="http://js.arcgis.com/3.11/dijit/themes/claro/claro.css">

    <link rel="stylesheet" href="http://js.arcgis.com/3.11/esri/css/esri.css">

    <style>

      html, body { height: 100%; width: 100%; margin: 0; padding: 0; }

      #map{padding:0;}

    </style>

 

 

    <script>var dojoConfig = {parseOnLoad: true};</script>

    <script src="http://js.arcgis.com/3.11/"></script>

    <script>

      dojo.require("dijit.layout.BorderContainer");

      dojo.require("dijit.layout.ContentPane");

      dojo.require("esri.map");

     

      var map;

 

 

      function init() {

        map = new esri.Map("map", {

       

        });

        //Add the terrain service to the map. View the ArcGIS Online site for services http://arcgisonline/home/search.html?t=content&f=typekeywords:service   

        var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer");

        map.addLayer(basemap);

       

         var layer = new esri.layers.ArcGISTiledMapServiceLayer("http://localhost/arcgis/rest/services/NenChung2909/NenChungDongNai/MapServer");

          map.addLayer(layer);

 

 

        //add custom services in the middle. This is typically data like demographic data, soils, geology etc.

        //This layer is typically partly opaque so the base layer is visible.

      

      }

 

 

      dojo.ready(init);

    </script>

  </head>

 

  <body class="claro">

    <div data-dojo-type="dijit.layout.BorderContainer"

         data-dojo-props="design:'headline', gutters:false"

         style="width: 100%; height: 100%; margin: 0;">

     

      <div id="map"

           data-dojo-type="dijit.layout.ContentPane"

           data-dojo-props="region:'center'"

           style="overflow:hidden;">

      </div>

 

 

    </div>

  </body>

</html>

 

I see sample of esri add three MapServer this sample worked perfect. Link this sample:

Add a terrain basemap with operational layer | ArcGIS API for JavaScript

Outcomes