Hi - Am doing some R&D and have the SampleWorldCities coming from ArcGIS Enterprise - https://arcgis.cloud.eaglegis.co.nz/portal/home/webmap/viewer.html?webmap=f16c88ffa42a425e9e26ee932a3193d4
Using JS API 3.27, I need to toggle off the sub layers, for example "World".
I am able to get all of the layer ID's from -
map<SPAN class="punctuation token">.</SPAN>_layers<SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
If I then call -
layer <SPAN class="operator token">=</SPAN> map<SPAN class="punctuation token">.</SPAN><SPAN class="token function">getLayer</SPAN><SPAN class="punctuation token">(</SPAN>layersToSet<SPAN class="punctuation token">[</SPAN>i<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">.</SPAN>layerID<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
layer<SPAN class="punctuation token">.</SPAN><SPAN class="token function">hide</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN></SPAN>
The map does not toggle this layer off in the WebMap but the properties show that it has.
Am I missing something? Or is there another way of handling this with using ArcGIS Server services with within WebMap?
Thanks