lib/PostGIS.js
function(err, data){
      if (err) error = err;
      allLayers.push(data);
      if (allLayers.length == totalLayers){
        callback(error, allLayers);
      }
    }
function(err, data){
      if (err) error = err;
      allLayers.push(data);
      if (allLayers.length == totalLayers){
        callback(error, allLayers);
      }
    }
function ( err , data ) { if ( err ) error = err ; allLayers . push ( data ) ; if ( allLayers . length == totalLayers ) { callback ( error , allLayers ) ; } }
closure to check each layer and send back when done
closure to check each layer and send back when done