canvasLayer = {
const context = DOM.context2d(mapWidth, mapHeight);
path.context(context);
context.translate(margin, margin);
const canvas = context.canvas;
canvas.style.position = 'absolute';
canvas.style.top = '0';
canvas.style.left = '0';
function render() {
context.clearRect(0, 0, mapWidth, mapHeight);
context.lineJoin = 'round';
context.lineCap = 'round';
context.beginPath();
path(shapes);
context.lineWidth = 0.5;
context.fillStyle = '#eeeeee';
context.fill();
context.strokeStyle = '#aaaaaa';
context.stroke();
context.closePath();
context.beginPath();
path(state);
context.lineWidth = 0.75;
context.strokeStyle = '#222222';
context.stroke();
context.closePath();
}
render();
return canvas;
}