Hello,
We have an ArcGISTiledLayer in WebMercator. When testing, I cannot get it to appear in the SceneView. The simple code is below. Am I missing something simple?
Also, I cannot find a sample showing how to use a custom tiled layer with the new API beta. Can someone direct me?
require([ "esri/Map", "esri/layers/ArcGISTiledLayer", "esri/views/SceneView", "dojo/domReady!" ], function(Map, ArcGISTiledLayer, SceneView) { var map = new Map({ basemap: "satellite" }); var cppjLayer = new ArcGISTiledLayer({ url: "http://<our-arcgis-server>/arcgis/rest/services/CPPJ/CPPJ_2014Imagery/MapServer", id: "2014Aerials" }); map.add(cppjLayer); var view = new SceneView({ container: "viewDiv", map: map }); });
Solved! Go to Solution.
Correct, 512x512 is not supported. See http://doc.arcgis.com/en/arcgis-online/create-maps/choose-global-local-scene.htm#ESRI_SECTION3_85508....
In looking at it, the only thing I can see about the MapService that may be non-standard is that the tiles are 512x512. We have another that is 256x256 that works. Is 512x512 not supported? We have a lot of cached MapServices using that tile size.
Correct, 512x512 is not supported. See http://doc.arcgis.com/en/arcgis-online/create-maps/choose-global-local-scene.htm#ESRI_SECTION3_85508....
Good to know. Never would have thought to look in the ArcGIS Online docs instead of the JavaScript docs
On a related note, are there any samples showing how to use a custom tiled layer with the new Javascript API?
The JSAPI doc will have this info in the next update
When you ask about "custom tiled layer" are you looking for something like https://developers.arcgis.com/javascript/beta/sample-code/layers-webtiled-2d/index.html?
I speaking more to extending TiledMapServiceLayer for accessing tiles from a folder relative to the host page instead of from a MapService. We have done this before using previous APIs.
While not the exact same scenario, this 3.x example is what I'm talking about, although I am of course looking for a 4.x beta example.
Creating a custom tiled layer type | ArcGIS API for JavaScript
The following should do the trick:
var myTileLayer = new ArcGISTiledLayer({
url:tiledMapServiceURL
});
var mybaseLayersCollection = new Collection();
mybaseLayersCollection .addItem(myTileLayer );
var myBaseMap = new Basemap({
baseLayers: mybaseLayersCollection ,
title: "My Basemap",
id: "myBaseMap"
});
map.basemap = myBaseMap ;