UNPKG

405 BJavaScriptView Raw
1'use strict';
2var Promise = require('bluebird');
3var queryStream = require('./queryStream');
4module.exports = query;
5function query(self, bbox) {
6 return new Promise(function (fullfill, reject) {
7 var out = [];
8 queryStream(self, bbox).on('data', function (d){
9 out.push(d);
10 }).on('error', function (e) {
11 reject(e);
12 }).on('end', function () {
13 fullfill(out);
14 });
15 });
16}
\No newline at end of file