Select to view content in your preferred language

Cannot add ArcGISTiledMapServiceLayer on my map

3232
5
02-28-2014 03:45 PM
GyeyoungChoi
Deactivated User
Hi all,

function init() {
        var initExtent = new esri.geometry.Extent({"xmin":1076363,"ymin":3109863,"xmax":1084228,"ymax":3113690,"spatialReference":{"wkid":32139}});
        var popup = new esri.dijit.Popup({
          fillSymbol: new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]), 2), new dojo.Color([255,255,0,0.25]))
        }, dojo.create("div"));
  center = [-90.3378, 39.6177];
  zoom = 14;
        map = new esri.Map("map",{
   basemap: "topo",
   infoWindow:popup,
   center: center,
   zoom: zoom,
   sliderStyle: "large"
        });
        
        dojo.connect(grid, "onRowClick", onRowClickHandler);
  
        var basemap = new esri.layers.ArcGISDynamicMapServiceLayer("http://localhost:6080/arcgis/rest/services/bt/beta_OnlineMap_Topo/MapServer");

  var imageParameters = new esri.layers.ImageParameters();
        imageParameters.layerIds = [0,1,2,3,4,6,8];
        imageParameters.layerOption = esri.layers.ImageParameters.LAYER_OPTION_HIDE;
        Vlayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://localhost:6080/arcgis/rest/services/bt/beta_MapInfo/MapServer", {"imageParameters":imageParameters});
  map.addLayers([basemap,Vlayer]);



where var basemap=
I added
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://localhost:6080/arcgis/rest/services/bt/beta_OnlineMap_Topo/MapServer");


but entire map didn't work

what did I do wrong?

dojo.require("esri.layers.TiledMapServiceLayer");

is in the code as well
0 Kudos
5 Replies
ManishkumarPatel
Deactivated User
Hi all,

function init() {
        var initExtent = new esri.geometry.Extent({"xmin":1076363,"ymin":3109863,"xmax":1084228,"ymax":3113690,"spatialReference":{"wkid":32139}});
        var popup = new esri.dijit.Popup({
          fillSymbol: new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]), 2), new dojo.Color([255,255,0,0.25]))
        }, dojo.create("div"));
        center = [-90.3378, 39.6177];
        zoom = 14;
        map = new esri.Map("map",{
            basemap: "topo",
            infoWindow:popup,
            center: center,
            zoom: zoom,
            sliderStyle: "large"
        });
        
        dojo.connect(grid, "onRowClick", onRowClickHandler);
        
        var basemap = new esri.layers.ArcGISDynamicMapServiceLayer("http://localhost:6080/arcgis/rest/services/bt/beta_OnlineMap_Topo/MapServer");

        var imageParameters = new esri.layers.ImageParameters();
        imageParameters.layerIds = [0,1,2,3,4,6,8];
        imageParameters.layerOption = esri.layers.ImageParameters.LAYER_OPTION_HIDE;
        Vlayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://localhost:6080/arcgis/rest/services/bt/beta_MapInfo/MapServer", {"imageParameters":imageParameters});
        map.addLayers([basemap,Vlayer]);



where var basemap=
I added
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://localhost:6080/arcgis/rest/services/bt/beta_OnlineMap_Topo/MapServer");


but entire map didn't work

what did I do wrong?

dojo.require("esri.layers.TiledMapServiceLayer");

is in the code as well

Hi,

It seems it might be some small error. Have you tried replacing

dojo.require("esri.layers.TiledMapServiceLayer");

with 

dojo.require("esri.layers.ArcGISTiledMapServiceLayer");

Also if possible try to create a jsfiddle so its easier to troubleshoot.

Regards,
Manish
0 Kudos
GyeyoungChoi
Deactivated User
Thanks Manish

I've tried esri.layers.ArcGISTiledMapServiceLayer but didn't work
and I created jsfiddle

http://jsfiddle.net/#&togetherjs=ffG4or9nTV
0 Kudos
JakeSkinner
Esri Esteemed Contributor
I believe the problem is due to the coordinate system of the tiled layer.  A tiled layer won't be able to reproject on the fly similar to a dynamic or feature layer.  I would recommend removing the topo basemap layer, and use your own tiled map service as the basemap.  Try the following:

function init() {
        var initExtent = new esri.geometry.Extent({
            "xmin": 1076363,
            "ymin": 3109863,
            "xmax": 1084228,
            "ymax": 3113690,
            "spatialReference": {
                "wkid": 32139
            }
        });
        esri.config.defaults.map.logoLink = "http://fcor.tamu.edu";

        map = new esri.Map("map");
    
        var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://fcor-aggiemap.tamu.edu:6080/arcgis/rest/services/aggiemap_beta/beta_OnlineMap_Topo/MapServer");
                
        Vlayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://fcor-aggiemap.tamu.edu:6080/arcgis/rest/services/aggiemap_beta/beta_MapInfo/MapServer");
        
        map.addLayers([basemap, Vlayer]);        
    }
0 Kudos
GyeyoungChoi
Deactivated User
Thanks Jake, but I need both tiled map and Esri base map together.
0 Kudos
JakeSkinner
Esri Esteemed Contributor
Hi Gyeyoung,

If you are going to mash-up multiple tiled layers, they should be the same coordinate system.  I would recommend creating another tiled service for 'beta_OnlineMap_Topo' in the coordinate system WGS_1984_Web_Mercator_Auxiliary_Sphere.
0 Kudos