-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathfloorplan-editor-sample.html
More file actions
64 lines (62 loc) · 2.14 KB
/
floorplan-editor-sample.html
File metadata and controls
64 lines (62 loc) · 2.14 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<html>
<head>
<title>HTML5 Floorplan Editor Sample</title>
<script type="text/javascript" src="lib/hammer.js"></script>
<script type="text/javascript" src="src/floorplan-canvas.js"></script>
<script type="text/javascript" src="src/floorplan-shapes.js"></script>
<script type="text/javascript" src="src/floorplan-editor.js"></script>
</head>
<body>
<h1>HTML5 Floorplan Editor</h1>
<p>Please edit the floorplan below. Drag to pan, pinch to zoom.</p>
<canvas id="floorplan-editor" width="640" height="480"></canvas>
<script type="text/javascript">
var floorplanEditor = new FloorplanEditor({
canvasId: "floorplan-editor",
shapes: [
{
id: "vr",
type: "vaulted-room",
center: {x: 5*12, y: 7*12},
size: {length: 14*12, width: 10*12},
rotation: -90,
label: "Great Room"
},
{
id: "cr",
type: "cathedral-room",
center: {x: 36*12, y: 6*12},
size: {length: 12*12, width: 10*12},
label: "Shed"
},
{
id: "rr",
type: "rect-room",
center: {x: 20.5*12, y: 3*12},
size: {length: 7*12, width: 6*12},
label: "Bathroom"
},
{
id: "lr",
type: "l-shaped-room",
center: {x: 17*12, y: 7*12},
size: {length: 14*12, width: 14*12},
cornerSize: {length: 7*12, width: 6*12},
label: "Master Bedroom"
}
]
});
// var zoom = 1.0;
// var offset = {x: 0, y: 0};
// var zoomAndTranslate = function() {
// zoom *= 1.01;
// offset.x += 1.5;
// offset.y += 1.5;
// floorplanEditor.setZoom(zoom);
// floorplanEditor.setOffset(offset);
// setTimeout(zoomAndTranslate, 100);
// }
// setTimeout(zoomAndTranslate, 100);
</script>
</body>
</html>