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.
-
Are you sure you published a cached (fused) map service? Add a screenshot of your REST service description pageVadim– Vadim2012年03月07日 22:59:50 +00:00Commented 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– ChettM2012年03月08日 14:38:03 +00:00Commented Mar 8, 2012 at 14:38
2 Answers 2
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.
-
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– ChettM2012年03月08日 14:38:27 +00:00Commented 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– ChettM2012年03月08日 15:34:42 +00:00Commented 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– Vadim2012年03月08日 15:56:48 +00:00Commented 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 layerStephen Lead– Stephen Lead2012年03月08日 21:55:42 +00:00Commented 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– Chris2012年04月05日 16:11:34 +00:00Commented Apr 5, 2012 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.
-
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 codeChettM– ChettM2012年03月08日 14:34:30 +00:00Commented Mar 8, 2012 at 14:34
Explore related questions
See similar questions with these tags.