Fall back to local style store

And convert tabs to spaces in process
This commit is contained in:
Lukas Martinelli
2016-12-16 14:49:25 +01:00
parent f7fabd1bc8
commit e5c6af3fad
4 changed files with 225 additions and 221 deletions
+6 -7
View File
@@ -1,14 +1,13 @@
import request from 'request'
import style from './style.js'
// Empty style is always used if no style could be restored or fetched
export const emptyStyle = style.ensureMetadataExists(style.fromJSON({
version: 8,
sources: {},
layers: [],
}))
export class ApiStyleStore {
supported(cb) {
request('http://localhost:8000/styles', (error, response, body) => {
cb(error === undefined)
})
}
latestStyle(cb) {
if(this.latestStyleId) {
request('http://localhost:8000/styles/' + this.latestStyleId, (error, response, body) => {