Updating API to 4.16 breaks TileLayer

346
5
07-15-2020 06:35 AM
GregoryBologna
Occasional Contributor

Is there change documentation for version 4.16 that might help me understand why upgrading from 4.15 requires esri/layers/ImageryTileLayer instead of esri/layers/TileLayer ?

// TileLayer produces the error "Failed to create view for layer..."

var tlay = new TileLayer({
   url: layerUrl,
   title: year
});

// changing to ImageryTileLayer solves the issue.

var tlay = new ImageryTileLayer({
   url: layerUrl,
   title: year
});

0 Kudos
5 Replies
Noah-Sager
Esri Regular Contributor

At 4.16, the TileImageryLayer was removed and replaced by ImageryTileLayer. This should not affect TileLayer, which is a different class.

Release notes for 4.16 | ArcGIS API for JavaScript 4.16 

Here is a hosted sample that uses TileLayer in a 3D SceneView:

ArcGIS API for JavaScript Sandbox 

If TileLayer is not working for you, can you share a repro case on something like Codepen?

0 Kudos
GregoryBologna
Occasional Contributor

I can switch to ImageryTileLayer, but using TileLayer in 4.16 definetly does not work. One of the errors it returns is "use ImageryTileLayer to open a tiled image service"

This is one tile layer here.

https://www.mymanatee.org/gisimg/rest/services/1940/AERIAL_1940_BW/ImageServer

TileLayer yields type:"tile"

ImageryTileLayer yields type:"imagery-tile"

0 Kudos
Noah-Sager
Esri Regular Contributor

Thanks for the additional information. We are investigating and will reply back to this thread when we have something to share.

0 Kudos
Noah-Sager
Esri Regular Contributor

Hi Gregory Bologna‌, we have an update to share. The TileLayer was never intended to work with a cached image service. So it was more of an issue that it used to work, as opposed to how it does not work now. We updated the Release Notes to make this more clear:

Use ImageryTileLayer class to add a cached image service to your map instead of TileLayer.

Reference: updated ImageryLayer updates in Release Notes

0 Kudos
UndralBatsukh
Esri Regular Contributor

Hi there, 

It is stated in the document that TileLayer only works with cached map services. With the implementation of ImageryTileLayer we refactored the code for TileLayer as well. This change is noted in the Imagery Layer updates section in Release Notes

-Undral