Skip to content

Instantly share code, notes, and snippets.

@knownasilya
Created September 12, 2013 14:33
Show Gist options
  • Save knownasilya/6538459 to your computer and use it in GitHub Desktop.
Save knownasilya/6538459 to your computer and use it in GitHub Desktop.
fire when both properties change
ready: function () {
var content = this.get('content'),
gmap = this.get('map.gmap');
return content && gmap;
}.property('controllers.map.gmap', 'content'),
drawSearchResults: function () {
var self = this,
marker,
content = this.get('content'),
map = this.get('map'),
gmap = map.get('gmap');
content.forEach(function (item, index, enumerable) {
item.setMap(gmap);
self.bindMarker(item);
if (enumerable.length === 1) {
gmap.setCenter(item.getPosition());
map.send('openBuildingByMarker', item);
}
});
}.observes('ready'),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment