Skip to content

Instantly share code, notes, and snippets.

@knownasilya
Created September 10, 2013 13:07
Show Gist options
  • Save knownasilya/6509141 to your computer and use it in GitHub Desktop.
Save knownasilya/6509141 to your computer and use it in GitHub Desktop.
buildingMarkers: function () {
var results = Ember.ArrayProxy.create({ content: Ember.A([]) }),
buildings = this.get('content');
mapController = this.get('map'),
marker,
bin,
latlng,
building;
for (building in buildings) {
building = buildings[building];
if (building && building.constructor === Ember.Object) {
bin = building.get('bin');
latlng = building.get('latlng');
marker = new google.maps.Marker({
position: new google.maps.LatLng(latlng.lat, latlng.lng),
map: gmap,
animation: google.maps.Animation.DROP,
title: bin,
bin: bin,
source: building.get('source'),
});
this.bindMarkerClick(marker, mapController);
results.pushObject(marker);
}
}
return results;
}.property('content.@each'),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment