mirror of
https://github.com/maputnik/editor.git
synced 2026-01-02 03:20:01 +00:00
Allow style export
This commit is contained in:
@@ -8,7 +8,7 @@ import Fixed from 'rebass/dist/Fixed'
|
|||||||
|
|
||||||
import { Map } from './map.jsx'
|
import { Map } from './map.jsx'
|
||||||
import {Toolbar} from './toolbar.jsx'
|
import {Toolbar} from './toolbar.jsx'
|
||||||
import { StyleManager } from './style.js'
|
import style from './style.js'
|
||||||
import { loadDefaultStyle, SettingsStore, StyleStore } from './stylestore.js'
|
import { loadDefaultStyle, SettingsStore, StyleStore } from './stylestore.js'
|
||||||
import { WorkspaceDrawer } from './workspace.jsx'
|
import { WorkspaceDrawer } from './workspace.jsx'
|
||||||
|
|
||||||
@@ -47,8 +47,8 @@ export default class App extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onStyleDownload() {
|
onStyleDownload() {
|
||||||
const mapStyle = JSON.stringify(this.state.currentStyle.toJSON(), null, 4)
|
const mapStyle = style.toJSON(this.state.currentStyle)
|
||||||
const blob = new Blob([mapStyle], {type: "application/json;charset=utf-8"});
|
const blob = new Blob([JSON.stringify(mapStyle, null, 4)], {type: "application/json;charset=utf-8"});
|
||||||
saveAs(blob, mapStyle.id + ".json");
|
saveAs(blob, mapStyle.id + ".json");
|
||||||
this.onStyleSave()
|
this.onStyleSave()
|
||||||
}
|
}
|
||||||
@@ -116,3 +116,4 @@ export default class App extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user