diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-08-17 16:27:40 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-08-17 17:25:28 -0400 |
| commit | 3c36de54b57422f34c367934fdf62873b881fa20 (patch) | |
| tree | 19d39fdae8d0372a2c0c682de4b09f69d72045a1 /public/assets/javascripts/ui/blueprint/BlueprintView.js | |
| parent | 599b43df07f092b35d25e7adac11db3c3b3d9c76 (diff) | |
integrate ortho3 stuff into blueprint views
Diffstat (limited to 'public/assets/javascripts/ui/blueprint/BlueprintView.js')
| -rw-r--r-- | public/assets/javascripts/ui/blueprint/BlueprintView.js | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/public/assets/javascripts/ui/blueprint/BlueprintView.js b/public/assets/javascripts/ui/blueprint/BlueprintView.js index 0a06fda..cf627d9 100644 --- a/public/assets/javascripts/ui/blueprint/BlueprintView.js +++ b/public/assets/javascripts/ui/blueprint/BlueprintView.js @@ -9,17 +9,20 @@ var BlueprintView = View.extend({ initialize: function(){ // this.info = new BuilderInfo ({ parent: this }) -// this.toolbar = new BuilderToolbar ({ parent: this }) // this.settings = new BuilderSettings ({ parent: this }) // this.colorControl = new ColorControl ({ parent: this }) // this.cursor = new HelpCursor({ parent: this }) - this.blueprintUpload = new BlueprintUpload ({ parent: this }) - this.blueprintScaler = new BlueprintScaler ({ parent: this }) + this.map = this.buildMap() + this.editor = new BlueprintEditor ({ parent: this }) + this.toolbar = new BlueprintToolbar ({ parent: this }) + this.uploader = new BlueprintUploader ({ parent: this }) + this.scaler = new BlueprintScaler ({ parent: this }) }, load: function(name){ if (! name || name == "new") { // this.ready({ isNew: true, _id: "new", name: "" }) + this.uploader.load() return } @@ -28,6 +31,26 @@ var BlueprintView = View.extend({ $.get(this.action + name, this.ready.bind(this)) }, + buildMap: function(){ + // i forget if this has to be global + map = new Map ({ + type: "ortho", + el: document.querySelector("#orthographic"), + width: window.innerWidth/2, + height: window.innerHeight, + zoom: -2, + zoom_min: -6.2, + zoom_max: 1, + }) + map.ui.add_tool("arrow", new ArrowTool) + map.ui.add_tool("polyline", new PolylineTool) + map.ui.add_tool("ortho-polyline", new OrthoPolylineTool) + map.ui.add_tool("eraser", new EraserTool) + map.ui.add_tool("position", new PositionTool) + map.ui.placing = false + return map + }, + ready: function(data){ // this.settings.load(data) // this.info.load(data) @@ -37,6 +60,7 @@ var BlueprintView = View.extend({ }, useFloorplan: function(media){ + this.editor.loadFloorplan(media) }, pickWall: function(wall, pos){ |
