Jesus Loves GRASS

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

Sunday, April 15, 2007

Let there be KaLEGEND

To start the KaLegend object has its options defined in the myOnload() function of the StartUp.js (which is located in the /tools/kaAqua path....)

I defined the option of download like the other properties:

legendOptions.download = typeof gbLegendDownloadControl != 'undefined' ? gbLegendDownloadControl : true;

the gbLegendDownloadControl is not necessary, it is just here to look good :)

jumping to the kaLengend constructor in the kaLegend.js, It was added a new property:

this.showDownloadControl=true;

and some codelines lower:

this.showDownloadControl = typeof options.download != 'undefined' ? options.download : true;

the standard options is to show the controls unless otherwise defined in the options.download

Labels: , , ,

Fetching Metadata

THe metadata contained in the MAP file is fetched at init.php and based on the programming already there:

$download = "false";
if ($oLayer->getMetaData ("download") !="") {
if(strcasecmp($oLayer->getMetaData("download"), "true") == 0)
$download = "true";
}

This will get the metadata from dowload in the MAP file and pass the value to the $download variable of PHP, as default the $download is false

Then the $download is integrated in the layer as another property:

$szLayers .= "map.addLayer(new _layer( { ".
"name:'".$groupName."',".
"visible:".$status.",".
"opacity:".$opacity.",".
"imageformat:'".$imageformat."',".
"queryable:".$szQueryable.",".
"download:".$download.",".
"tileSource:'".$tileSource."',".
"redrawInterval:".$redrawInterval.",".
"refreshInterval:".$refreshInterval.",".
"scales: new Array('".implode("','",$groupScaleVis)."')}));";

The line in bold was added to the properties of the layer

Labels: , ,