Skip to content

Commit

Permalink
Step 16.9: Add actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamil Kisiela authored and Dotan Simha committed Nov 22, 2016
1 parent 2e5bf8b commit 5241d37
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions imports/ui/components/partyMap/partyMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,31 @@ class PartyMap {
longitude: -73
},
zoom: 8,
events: {}
events: {
click: (mapModel, eventName, originalEventArgs) => {
this.setLocation(originalEventArgs[0].latLng.lat(), originalEventArgs[0].latLng.lng());
$scope.$apply();
}
}
};

this.marker = {
options: {
draggable: true
},
events: {}
events: {
dragend: (marker, eventName, args) => {
this.setLocation(marker.getPosition().lat(), marker.getPosition().lng());
$scope.$apply();
}
}
};
}

setLocation(latitude, longitude) {
this.location = {
latitude,
longitude
};
}
}
Expand Down

0 comments on commit 5241d37

Please sign in to comment.