Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am currently trying to show a map that has been tiled. I am using version 10 of the arcgis server, and version 2.5 of the javascript api, the odd thing i am running into is that the map will not show when using the constructor "arcGISTiledMapServiceLayer" but it will show when I'm using the alternate constructor "arcGisDynamicMapServiceLayer". Here Is a very simple code snippet i'm using to test out my functionality

dojo.require("esri.map");
dojo.require("esri.tasks.geometry");
var map = null;
var gsvc = null;
var pt = null;

function initialize() {
  map = new esri.Map("map");

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

  alert(map.toString());    

  map.addLayer(layer);

}


dojo.addOnLoad(initialize);

As you all have no doubt realized, this example code is using arcgisonline.com instead of my actual service that I'm running.

There is one more very important piece of information, this code above, works it shows the map but the same code with my url doesn't leading me to believe something is wrong with my server setup, but I am fairly new to arcgis so I'm not leaving any stones unturned, thx in advanced yall. If there are any querstions please feel free.

share|improve this question
    
Are you sure you published a cached (fused) map service? Add a screenshot of your REST service description page –  Vadim Mar 7 '12 at 22:59
    
I didn't cache a "fused" map service I did a "multi-layer" one because I need the functionality of being able to turn things on and off. is there a different javascript function to use for this? or have I miss understood the meaning of these types? –  Warped Mar 8 '12 at 14:38

2 Answers 2

up vote 2 down vote accepted

See the details for the sample Esri service at that URL, which contains the line:

Single Fused Map Cache: true

Verify that your own service also contains this line - chances are that it doesn't. In that case you need to build a cache using the instructions here.

You'll then be able to display your data as a tiled layer.

share|improve this answer
    
I didn't cache a "fused" map service I did a "multi-layer" one because I need the functionality of being able to turn things on and off. is there a different javascript function to use for this? or have I miss understood the meaning of these types? –  Warped Mar 8 '12 at 14:38
    
This is indeed the answer so I have worked my services around and every thing that needs to be hidden is brought in dynamically now, I appreciate the help. I think it's a little rediculous that i can't use the multilayer option for this. –  Warped Mar 8 '12 at 15:34
    
As you work with ESRI stuff you'll find more and more ridiculous things :) Good luck, welcome to the board. –  Vadim Mar 8 '12 at 15:56
    
@Warped it comes down to the fundamental difference between cached (pre-compiled) and dynamic layers. If you want to pre-compile the map for faster display, the trade-off is a loss of flexibility. If you need the flexibility to switch layers on/off at will, you can do this with a Dynamic of Featuer layer –  Stephen Lead Mar 8 '12 at 21:55
    
Strangely, I have a fused map that is exhibiting this same behavior (dynamic constructor works but tiled does not). It does behave like a tiled layer though. –  Chris Apr 5 '12 at 16:11

http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer uses an old tiling scheme based on WGS 1984. ESRI recommends you use WorldStreetMap instead:

http://server.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer

which uses Web Mercator Auxiliary Sphere.

share|improve this answer
    
That is not the map I'm using to cache, I explained in the information above I used a different map when I posted that code –  Warped Mar 8 '12 at 14:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.