Skip to content

Commit

Permalink
#25 notify session update
Browse files Browse the repository at this point in the history
  • Loading branch information
gyuque committed Feb 20, 2014
1 parent 6711ab5 commit 8531d05
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
15 changes: 12 additions & 3 deletions inner/js/selection/selection-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,18 @@ if (!window.mobmap) { window.mobmap={}; }
},

putSessionFirstPoint: function(lat, lng) {
console.log(lat, lng)
var s = this.currentSelectionSession;
if (s && s.setStartPos) {
s.setStartPos(lat, lng);
}
},

putSessionDraggingPoint: function(lat, lng) {
console.log("D", lat, lng)
var s = this.currentSelectionSession;
if (s && s.setEndPos) {
s.setEndPos(lat, lng);
this.fireAfterSessionStateUpdate(s);
}
},

commitDraggingSelection: function() {
Expand All @@ -75,6 +82,7 @@ if (!window.mobmap) { window.mobmap={}; }
fireNewSession: function() { this.callResponders('selWillStartNewSession'); },
fireAfterDisposeSession: function() { this.callResponders('selDidDisposeSession'); },
fireAfterNewSession: function() { this.callResponders('selDidStartNewSession'); },
fireAfterSessionStateUpdate: function(s) { this.callResponders('selDidUpdateSession',s); },

callResponders: function(methodName, arg1, arg2) {
var required = SelectionControllerResponderMethodList[methodName] || false;
Expand All @@ -101,7 +109,8 @@ if (!window.mobmap) { window.mobmap={}; }
selWillDisposeCurrentSession : false,
selWillStartNewSession : false,
selDidDisposeSession : false,
selDidStartNewSession : false
selDidStartNewSession : false,
selDidUpdateSession : false
};

aGlobal.mobmap.SelectionController = SelectionController;
Expand Down
4 changes: 4 additions & 0 deletions inner/js/selection/selection-session.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ if (!window.mobmap) { window.mobmap={}; }
return true;
},

isRectangleFeedbackRecommended: function() {
return true;
},

// - - - - - - - - - -

setStartPos: function(lat, lng) {
Expand Down
4 changes: 4 additions & 0 deletions inner/js/ui/map-pane.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ if (!window.mobmap) { window.mobmap={}; }
this.leaveSpecialPointingMode();
},

selDidUpdateSession: function(selController, selSession) {
console.log("U", selSession);
},

// Selection feedback views = = =

setupSelectionPolygon: function() {
Expand Down

0 comments on commit 8531d05

Please sign in to comment.