mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2025-01-02 22:28:10 +01:00
28 lines
423 B
JavaScript
28 lines
423 B
JavaScript
|
import React from 'react';
|
||
|
|
||
|
export class StyleCommand {
|
||
|
do(map) {
|
||
|
throw new TypeError("Do not implemented");
|
||
|
}
|
||
|
undo(map) {
|
||
|
throw new TypeError("Undo not implemented");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export class StyleEditor {
|
||
|
constructor(map, style) {
|
||
|
this.map = map;
|
||
|
this.style = style;
|
||
|
this.history = [];
|
||
|
}
|
||
|
|
||
|
layers() {
|
||
|
return this.style.layers;
|
||
|
}
|
||
|
|
||
|
execute(command) {
|
||
|
this.history.push(command);
|
||
|
command.do(this.map);
|
||
|
}
|
||
|
}
|