Skip to content

Commit

Permalink
#25 add clear API on controller
Browse files Browse the repository at this point in the history
  • Loading branch information
gyuque committed Feb 3, 2014
1 parent bfde122 commit 9666153
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion inner/js/Mobmap2App.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ if (!window.mobmap) { window.mobmap={}; }

// Selection operations
clearSelection: function() {
console.log("CL");
this.selectionController.clear();
},

// -----------------------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions inner/js/model/MMProject.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ if (!window.mobmap) { window.mobmap={}; }
start: start_t,
end: end_t
};
},

forEachLayer: function(proc) {
var len = this.layerList.getCount();
for (var i = 0;i < len;++i) {
proc(i, this.layerList.getLayerAt(i) );
}
}
};

Expand Down
7 changes: 6 additions & 1 deletion inner/js/selection/selection-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ if (!window.mobmap) { window.mobmap={}; }
}

SelectionController.prototype = {

clear: function() {
var prj = this.ownerApp.getCurrentProject();
prj.forEachLayer(function(index, layer){
console.log("ToDo: clear", index)
});
}
};

aGlobal.mobmap.SelectionController = SelectionController;
Expand Down

0 comments on commit 9666153

Please sign in to comment.