Select to view content in your preferred language

3D, SceneView with our ArcGISTiledLayer

3465
6
Jump to solution
12-10-2015 12:40 PM
LanceCrumbliss
Frequent Contributor

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
      });
  
    });
0 Kudos
1 Solution

Accepted Solutions
BjornSvensson
Esri Regular Contributor

Correct, 512x512 is not supported.  See http://doc.arcgis.com/en/arcgis-online/create-maps/choose-global-local-scene.htm#ESRI_SECTION3_85508....

  • 256x256 pixel tiles
  • The scale levels must increase or decrease by a power of two

View solution in original post

6 Replies
LanceCrumbliss
Frequent Contributor

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.

0 Kudos
BjornSvensson
Esri Regular Contributor

Correct, 512x512 is not supported.  See http://doc.arcgis.com/en/arcgis-online/create-maps/choose-global-local-scene.htm#ESRI_SECTION3_85508....

  • 256x256 pixel tiles
  • The scale levels must increase or decrease by a power of two
LanceCrumbliss
Frequent Contributor

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?

0 Kudos
BjornSvensson
Esri Regular Contributor

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?

0 Kudos
LanceCrumbliss
Frequent Contributor

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

0 Kudos
Cotter
by
Emerging Contributor

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 ;

0 Kudos