hello.
I defining a new graphicslayer which has listmode property value as "hide". And this graphicslayer doesn't show in layerlistwidget (this is what i want)
var myg = new graphicsLayer({
listMode: "hide";
})
mymap.add(myg);
new sketchView
var s = new SketchViewModel({
view: mySceneView,
layer: myg,
});
when i run this code an Untitled Layer is being visible on layerlist.
This layer is not myg. Another new layer.
Tuba,
I see what you are talking about and the only way to fix this I have found is with this work around (lines 18 - 24):
view.when(function() {
var layerList = new LayerList({
view: view
});
// Add widget to the top right corner of the view
view.ui.add(layerList, "bottom-right");
// create a new sketch view model
var sketchViewModel = new SketchViewModel({
view: view,
layer: tempGraphicsLayer,
pointSymbol: pointSymbol,
polylineSymbol: polylineSymbol,
polygonSymbol: polygonSymbol
});
setTimeout(function(){
layerList.operationalItems.items.map(function(item){
if(!item.layer.title && item.layer.type === "graphics"){
item.layer.listMode = "hide";
}
});
}, 200);
You really need to log a bug with esri tech support on this.
Hi there,
We will address this issue in our future release. Thank you pointing it out.
I am having the same issue. I have attached a snippet. I do not know why there is a untitled layer as I have done weeks of debugging and it doesnt work.
I figured a workaround with this. I had to hit a private member and use it's hide setting.