Select to view content in your preferred language

How to show the sublayer of tileLayer

575
2
Jump to solution
12-26-2023 02:00 AM
AbramhumHsu
Emerging Contributor

I meet a problem when using tileLayer. 

I got this error message:[esri.views.LayerViewFactory] Failed to create view for layer 'Layer, id:18ca58dcb5d-layer-1' of type 'tile'. 

and in mapserver description page, I see these infos:

AbramhumHsu_0-1703584814649.png

 

is this mean I should get the map data from sublayer, and further more, how to make it, thanks a lot.

0 Kudos
1 Solution

Accepted Solutions
Noah-Sager
Esri Regular Contributor

Hi @AbramhumHsu, can you share your code? Here is an example of using a TileLayer from a MapServer URL:
https://codepen.io/noash/pen/PoLqqNv?editors=1000

View solution in original post

2 Replies
Noah-Sager
Esri Regular Contributor

Hi @AbramhumHsu, can you share your code? Here is an example of using a TileLayer from a MapServer URL:
https://codepen.io/noash/pen/PoLqqNv?editors=1000

AbramhumHsu
Emerging Contributor

This is great, I use the codes as the document description, but it invalid.

1.
let serviceSublayers = newBasemap.createServiceSublayers();
newBasemap.sublayers = serviceSublayers;
2.
let result = newBasemap.sublayers;
let newBasemap2 = newBasemap.findSublayerById(1);

newBasemap is built via tileLayer, it seems tileLayer is not used for sublayers, thanks.
  




0 Kudos