Skip to content

Instantly share code, notes, and snippets.

@Matheus-de-Souza
Created September 16, 2016 12:41
Show Gist options
  • Save Matheus-de-Souza/833fb9e10139c3db1f01f6d1942bb621 to your computer and use it in GitHub Desktop.
Save Matheus-de-Souza/833fb9e10139c3db1f01f6d1942bb621 to your computer and use it in GitHub Desktop.
for (var i = 0; i < this.legend.layerInfos.length; i++)
{
var sNomeDiv = "";
var sMensagem = "";
if (this.legend.layerInfos[i].layer.visible)
{
sNomeDiv = this.legend.id + "_" + this.legend.layerInfos[i].layer.id;
if (this.legend.layerInfos[i].layer.description == "" ||
this.legend.layerInfos[i].layer.description == "undefined" ||
this.legend.layerInfos[i].layer.description == "null")
{
sMensagem = "Nenhuma informação cadastrada para a camada " + this.legend.layerInfos[i].title;
}
else
{
sMensagem = this.legend.layerInfos[i].layer.description;
}
setarMensagemAlert (sMensagem,sNomeDiv);
}
}
function setarMensagemAlert (sMensagem, sNomeDiv) {
dojo.connect
(
dojo.byId(sNomeDiv),
'onclick',
function()
{
alert(sMensagem + " --> " + sNomeDiv);
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment