Jesus Loves GRASS

Technical blog about GRASS/GIS,open source geoinformatics and MAPSERVER.

Friday, April 20, 2007

Layer's HTML

The HTML that generate the Legend is in member createLayerHTML of the Kalegend.

After the HTML for the query control I added the following if (a bit similar to the query one


if (this.showDownloadControl) {
td = document.createElement('td');
td.width = '14';
if (oLayer.isDownload()) {
a = document.createElement('a');
a.href ='javascript:OWS_request(\"'+oLayer.name+'\",\"'+oLayer.ows_service+'\")';
img = document.createElement( 'img' );
img.width = '14';
img.height = '14';
img.src = 'images/download_ok.png';
img.border='0';
img.id=oLayer.name;
img.alt = "OWS download request";
img.title = "OWS download request";
a.appendChild(img);
td = document.createElement( 'td' );
td.appendChild(a);

} else {
img = document.createElement( 'img' );
img.width = '14';
img.height = '14';
img.src = 'images/download_no.png';
img.oLayer = oLayer;
img.id=oLayer.name;
img.alt = "OWS not available";
img.title = "OWS not available";
td = document.createElement( 'td' );
td.appendChild(img);
}
td.width = '16';
tr.appendChild(td);
}

This code will simpely check if the layer can/can't be downloaded and give the specific icon

0 Comments:

Post a Comment

<< Home