Select to view content in your preferred language

Message Alert!

1989
10
Jump to solution
02-23-2018 02:07 PM
James_001
Frequent Contributor

Hi fellows,

I was trying to add message alert in one of my custom widget to get the features count for two features layers together but somehow it only does for one layer. What is the best way to fix this? I will appreciate any help!

This is the block of code 

on.once(this.map, 'update-end', lang.hitch(this, function () {
var aa = this.layerInfosObj.getLayerInfoById('Mylayer_1 || Mylayer_2');
if (aa.layerObject.graphics.length === 0) {
this._showMessage("No features found");
}
else {
var a1 = aa.layerObject.graphics.length;
this._showMessage(a1 + " Feature(s) found");
}
}));

Tags (1)
0 Kudos
10 Replies
James_001
Frequent Contributor

Thanks Ken,

You are right!

0 Kudos