Like Oren suggested, if you are loading from a configuration of some sort, can't you specify it there?
If not that way, look at the info of the map service using esri/requesthttp://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer?f=pjsonCheck if singleFusedMapCache is true or if it has a tileInfo property.
I forgot that although they are tiled does not mean it's a fused cache so you can still disabled layers.
Can't test at moment, but I seem to remember serving tiled data as dynamic provided a grainy looking map and serving dynamic as tiled loaded the data in weird tiles that didn't line up correctly.
This project might be helpful to what you are trying to do.https://github.com/WSDOT-GIS/LayerFactory
if (response.singleFusedMapCache) { // Create a tile map service layer. require(["esri/layers/agstiled"], function () { var layer; layer = new esri.layers.ArcGISTiledMapServiceLayer(url, layerOptions); self._triggerLayerCreate(layer);
Thanks!I looked at the layer factory there and it seems to look at the singleFusedMapCache to determine if it is a dynamic or tiled map service: if (response.singleFusedMapCache) { // Create a tile map service layer. require(["esri/layers/agstiled"], function () { var layer; layer = new esri.layers.ArcGISTiledMapServiceLayer(url, layerOptions); self._triggerLayerCreate(layer); /Mathias
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.