API 4.9, LayerList + TileLayer bug?

265
2
Jump to solution
12-04-2018 05:57 AM
DavideLimosani
Occasional Contributor II

Hello everyone,

give a look at this sample:

API 4.8 

It just adds a Tile layer to a LayerList widget (with api 4.8) and everything looks fine.

If you switch to 4.9 (API 4.9)  you can see a totally different behaviour. It looks like that the tile layer becomes a group layer and every single sub layer is added as a layer. I don't think this is the intended behaviour.

Is it a bug?

Thanks,

Davide

0 Kudos
1 Solution

Accepted Solutions
UndralBatsukh
Esri Regular Contributor

Hi there, 

It is an expected behavior at 4.9. TileLayer.sublayers property was added at 4.9. So you have to set the TileLayer.listMode to hide-children to not show the sublayers information as shown below:

var layer = new TileLayer({
  url: "https://sit5.sistemigis.it/sit/rest/services/Demo/DemoCache/MapServer",
  title: "Tile layer",
  listMode: "hide-children"
});
‍‍‍‍‍

View solution in original post

2 Replies
UndralBatsukh
Esri Regular Contributor

Hi there, 

It is an expected behavior at 4.9. TileLayer.sublayers property was added at 4.9. So you have to set the TileLayer.listMode to hide-children to not show the sublayers information as shown below:

var layer = new TileLayer({
  url: "https://sit5.sistemigis.it/sit/rest/services/Demo/DemoCache/MapServer",
  title: "Tile layer",
  listMode: "hide-children"
});
‍‍‍‍‍
MattDriscoll
Esri Contributor

Hey Davide Limosani, there actually is a bug here but the workaround Undral Batsukh provided is a good one! thanks for letting us know about the issue.

-Matt