fix for center
This commit is contained in:
@@ -42,7 +42,10 @@ function MBTiles(uri, callback) {
|
||||
if (err) return callback(err);
|
||||
else if (!exists) mbtiles.setup(this);
|
||||
else this(null);
|
||||
}, callback);
|
||||
}, function(err) {
|
||||
if (err) callback(err);
|
||||
callback(null, mbtiles);
|
||||
});
|
||||
};
|
||||
|
||||
// Finds all mbtiles file in the filepath and returns their tilesource URI.
|
||||
@@ -482,8 +485,8 @@ MBTiles.prototype.getInfo = function(callback) {
|
||||
info.minzoom = parseInt(info.minzoom, 10);
|
||||
info.maxzoom = parseInt(info.maxzoom, 10);
|
||||
info.bounds = _((info.bounds || '').split(',')).map(parseFloat);
|
||||
info.center = _((info.center || '').split(',')).map(parseFloat);
|
||||
if (!info.center) info.center = [
|
||||
if (info.center) info.center = _((info.center).split(',')).map(parseFloat);
|
||||
if (!info.center || info.center.length !== 3) info.center = [
|
||||
(info.bounds[2] - info.bounds[0]) / 2 + info.bounds[0],
|
||||
(info.bounds[3] - info.bounds[1]) / 2 + info.bounds[1],
|
||||
(range <= 1) ? info.maxzoom : Math.floor(range * 0.5) + info.minzoom
|
||||
|
||||
Reference in New Issue
Block a user