I'm programmatically creating legend dijits. Map is loaded. Layer(s) loaded. The error occurs towards the end of _createLegend() method when it's try to set the _msg element innerHTML to NLS_noLegend string saying the _msg element is null. However, if I wrap in a 1 millisecond setTimeout it works fine. Why is this?
Hi Ben,
Would you be able to post the code you are working with?
Jake Skinner it's a templated widget. I thought it might be a slight delay using put, but using an attach point as srcNodeRef has same behavior.
initLegend: function () {
this.legend = new Legend({
map: appModel.get('map'),
layerInfos: [{
layer: this.layerInfo.layer,
title: this.layerInfo.layerToggleOptions.title || 'Layer Title'
}]
}, put(this.legendNode, 'div.layerControlLegendWidget'));
this.legend.startup();
}