The API Reference state that one can modify the layer name displayed in the legend by specifying a title in layerInfos.
However when I do so in ArcGIS API for JavaScript Sandbox I don't see any change :
var legend = new Legend({
view: view,
layerInfos: [{
layer: featureLayer,
title: "My new title"
}]
});
Solved! Go to Solution.
Change the Feature Layer name after loading and before initializing the legend:
featureLayer.title = "My Title";
Change the Feature Layer name after loading and before initializing the legend:
featureLayer.title = "My Title";
Indeed featureLayer.then(featureLayer.title = "My Title"); works like a charm.
Thanks !