Merge pull request #59 from rastapasta/mapbox-mbtiles

The NPM package mbtiles got deprecated in favour of @mapbox/mbtiles
pull/68/head^2
Christian Paul 2019-03-24 18:27:56 -07:00 zatwierdzone przez GitHub
commit ff75d2de50
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 15 dodań i 3 usunięć

Wyświetl plik

@ -16,10 +16,10 @@ const config = require('./config');
// https://github.com/mapbox/node-mbtiles has native build dependencies (sqlite3)
// To maximize MapSCIIs compatibility, MBTiles support must be manually added via
// $> npm install -g mbtiles
// $> npm install -g @mapbox/mbtiles
let MBTiles = null;
try {
MBTiles = require('mbtiles');
MBTiles = require('@mapbox/mbtiles');
} catch (err) {void 0;}
const modes = {
@ -49,7 +49,7 @@ class TileSource {
} else if (this.source.endsWith('.mbtiles')) {
if (!MBTiles) {
throw new Error('MBTiles support must be installed with following command: \'npm install -g mbtiles\'');
throw new Error('MBTiles support must be installed with following command: \'npm install -g @mapbox/mbtiles\'');
}
this.mode = modes.MBTiles;

Wyświetl plik

@ -0,0 +1,12 @@
'use strict';
const TileSource = require('./TileSource');
describe('TileSource', () => {
describe('with a HTTP source', () => {
test('sets the mode to 3', async () => {
const tileSource = new TileSource();
await tileSource.init('http://mapscii.me/');
tileSource.mode = 3;
});
});
});