3

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.

If there are any querstions please feel free to ask.

2
  • Are you sure you published a cached (fused) map service? Add a screenshot of your REST service description page
    – Vadim
    Commented Mar 7, 2012 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?
    – ChettM
    Commented Mar 8, 2012 at 14:38

2 Answers 2

3

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 at Creating map cache tiles.

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

6
  • 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?
    – ChettM
    Commented Mar 8, 2012 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.
    – ChettM
    Commented Mar 8, 2012 at 15:34
  • As you work with ESRI stuff you'll find more and more ridiculous things :) Good luck, welcome to the board.
    – Vadim
    Commented Mar 8, 2012 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 Commented Mar 8, 2012 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
    Commented Apr 5, 2012 at 16:11
0

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.

1
  • 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
    – ChettM
    Commented Mar 8, 2012 at 14:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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