Merge pull request #49 from mapbox/multi-index

Query from `map` table with more than one index.
This commit is contained in:
Will White
2014-12-13 11:25:39 -05:00

View File

@@ -33,7 +33,7 @@ ZXYStream.prototype._read = function() {
if (!stream.table) {
return this.source._db.get("select count(1) as count from sqlite_master where type = 'index' and tbl_name = 'map';", function(err, row) {
if (err) return stream.emit('error', err);
stream.table = row.count === 1 ? 'map' : 'tiles';
stream.table = row.count >= 1 ? 'map' : 'tiles';
return stream._read();
});
}