Skip to content

Commit

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

setStartPos: function(lat, lng) {

this.startPos.lat = lat;
this.startPos.lng = lng;
},

setEndPos: function(lat, lng) {

this.endPos.lat = lat;
this.endPos.lng = lng;
},

getStartPos: function() {
return this.startPos;
},

getEndPos: function() {
return this.endPos;
}
};

Expand Down
10 changes: 7 additions & 3 deletions inner/js/ui/map-pane.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ if (!window.mobmap) { window.mobmap={}; }

var PMODE_DEFAULT = 0;
var PMODE_DRAG_SEL = 1;

var SEL_FEEDBACK_RECT = 0;

function MapPane(containerElement) {
this.gmap = null;
Expand Down Expand Up @@ -236,7 +238,9 @@ if (!window.mobmap) { window.mobmap={}; }
},

selDidUpdateSession: function(selController, selSession) {
console.log("U", selSession);
if (selSession.isRectangleFeedbackRecommended()) {
this.updateSelectionFeedback(SEL_FEEDBACK_RECT, selSession.getStartPos(), selSession.getEndPos());
}
},

// Selection feedback views = = =
Expand All @@ -252,8 +256,8 @@ if (!window.mobmap) { window.mobmap={}; }
});
},

updateSelectionFeedback: function() {

updateSelectionFeedback: function(feedbackType, location1, location2) {
console.log("U", feedbackType);
},

// Utility functions
Expand Down

0 comments on commit eb459aa

Please sign in to comment.