kopia lustrzana https://github.com/rastapasta/mapscii
fixed no tilesource defined error when using local mbtiles file
rodzic
1736dac146
commit
ea69053f03
|
@ -45,16 +45,16 @@ class Mapscii {
|
|||
this._initKeyboard();
|
||||
this._initMouse();
|
||||
}
|
||||
this._initTileSource();
|
||||
await this._initTileSource();
|
||||
this._initRenderer();
|
||||
this._draw();
|
||||
this.notify('Welcome to MapSCII! Use your cursors to navigate, a/z to zoom, q to quit.');
|
||||
}
|
||||
|
||||
|
||||
_initTileSource() {
|
||||
async _initTileSource() {
|
||||
this.tileSource = new TileSource();
|
||||
this.tileSource.init(config.source);
|
||||
await this.tileSource.init(config.source);
|
||||
}
|
||||
|
||||
_initKeyboard() {
|
||||
|
|
|
@ -31,7 +31,7 @@ const modes = {
|
|||
};
|
||||
|
||||
class TileSource {
|
||||
init(source) {
|
||||
async init(source) {
|
||||
this.source = source;
|
||||
|
||||
this.cache = {};
|
||||
|
@ -55,7 +55,7 @@ class TileSource {
|
|||
}
|
||||
|
||||
this.mode = modes.MBTiles;
|
||||
this.loadMBTiles(source);
|
||||
await this.loadMBTiles(source);
|
||||
} else {
|
||||
throw new Error('source type isn\'t supported yet');
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue