function runListFeatures(callback) {
  var rect = new messages.Rectangle();
  var lo = new messages.Point();
  lo.setLatitude(400000000);
  lo.setLongitude(-750000000);
  rect.setLo(lo);
  var hi = new messages.Point();
  hi.setLatitude(420000000);
  hi.setLongitude(-730000000);
  rect.setHi(hi);
  console.log('Looking for features between 40, -75 and 42, -73');
  var call = client.listFeatures(rect);
  call.on('data', function(feature) {
      console.log('Found feature called "' + feature.getName() + '" at ' +
          feature.getLocation().getLatitude()/COORD_FACTOR + ', ' +
          feature.getLocation().getLongitude()/COORD_FACTOR);
  });
  call.on('end', callback);
}
function runListFeatures(callback) {
  var rect = new messages.Rectangle();
  var lo = new messages.Point();
  lo.setLatitude(400000000);
  lo.setLongitude(-750000000);
  rect.setLo(lo);
  var hi = new messages.Point();
  hi.setLatitude(420000000);
  hi.setLongitude(-730000000);
  rect.setHi(hi);
  console.log('Looking for features between 40, -75 and 42, -73');
  var call = client.listFeatures(rect);
  call.on('data', function(feature) {
      console.log('Found feature called "' + feature.getName() + '" at ' +
          feature.getLocation().getLatitude()/COORD_FACTOR + ', ' +
          feature.getLocation().getLongitude()/COORD_FACTOR);
  });
  call.on('end', callback);
}
function runListFeatures ( callback ) { var rect = new messages . Rectangle ( ) ; var lo = new messages . Point ( ) ; lo . setLatitude ( 400000000 ) ; lo . setLongitude ( - 750000000 ) ; rect . setLo ( lo ) ; var hi = new messages . Point ( ) ; hi . setLatitude ( 420000000 ) ; hi . setLongitude ( - 730000000 ) ; rect . setHi ( hi ) ; console . log ( 'Looking for features between 40, -75 and 42, -73' ) ; var call = client . listFeatures ( rect ) ; call . on ( 'data' , function ( feature ) { console . log ( 'Found feature called "' + feature . getName ( ) + '" at ' + feature . getLocation ( ) . getLatitude ( ) / COORD_FACTOR + ', ' + feature . getLocation ( ) . getLongitude ( ) / COORD_FACTOR ) ; } ) ; call . on ( 'end' , callback ) ; }
Run the listFeatures demo. Calls listFeatures with a rectangle containing all
of the features in the pre-generated database. Prints each response as it
comes in.
@param {function} callback Called when this demo is complete
Run the listFeatures demo . Calls listFeatures with a rectangle containing all of the features in the pre - generated database . Prints each response as it comes in .
List features in the cluster