Skip to content

Instantly share code, notes, and snippets.

@deanmarano
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deanmarano/455e627f2dfbc1474e2f to your computer and use it in GitHub Desktop.
Save deanmarano/455e627f2dfbc1474e2f to your computer and use it in GitHub Desktop.
Before Ember setter
handleLocationChange: function() {
this.removeOldMarkers(this.get(‘currentLocations’));
this.set(‘currentLocations’, this.get(‘locations’);
this.addMarkers(this.get(‘locations’));
}.observes(‘locations’),
removeOldMarkers: function(markers) {
markers.forEach(function(marker) {
// remove markers from Google map
});
}
addMarkers: function(markers) {
markers.forEach(function(marker) {
// add markers to Google map
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment