summaryrefslogtreecommitdiff
path: root/src/main.js
blob: 5158cf3c2c009e1ae2cb2c6db6256dadee122d47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import h from './Util/DomUtil.js';
import { Transform, Canvas } from './Map/Canvas.js';
import { Node, Shape, Point, Path, Polygon, Text } from './Map/Shapes.js';
import { LayerData, LayerView, LayerController } from './Map/Layer.js';
import DraggableWindow from './Draggable/Draggable.js';

const canvas = new Canvas('root');
const transform = new Transform();

const shapes = [
	new Point(new Node(30, 30)),
	new Path([
		new Node(100, 100),
		new Node(100, 200),
		new Node(150, 250),
	]),
	new Polygon([
		new Node(200, 100),
		new Node(200, 200),
		new Node(300, 200),
	]),
	new Text(new Node(10, 100), 'hello, world!'),
];

canvas.render(transform, shapes);


const win = new DraggableWindow('Layers');
const layerView = new LayerView(win.div);
const layerData = new LayerData();
const layerController = new LayerController(layerData, layerView);