maputnik/src/style.js

28 lines
423 B
JavaScript
Raw Normal View History

2016-09-08 21:42:18 +02:00
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);
}
}