mirror of
https://github.com/maputnik/editor.git
synced 2026-08-27 07:27:33 +00:00
Support resetting styles
This commit is contained in:
@@ -91,6 +91,16 @@ export class StyleStore {
|
||||
this.mapStyles = loadStoredStyles()
|
||||
}
|
||||
|
||||
// Delete entire style history
|
||||
purge() {
|
||||
for (let i = 0; i < window.localStorage.length; i++) {
|
||||
const key = window.localStorage.key(i)
|
||||
if(key.startsWith(storagePrefix)) {
|
||||
window.localStorage.removeItem(key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Find the last edited style
|
||||
latestStyle() {
|
||||
if(this.mapStyles.length === 0) return emptyStyle
|
||||
|
||||
Reference in New Issue
Block a user