Skip to content

Instantly share code, notes, and snippets.

@knownasilya
Created September 19, 2013 15:31
Show Gist options
  • Save knownasilya/6625257 to your computer and use it in GitHub Desktop.
Save knownasilya/6625257 to your computer and use it in GitHub Desktop.
Google maps
App.MapView = Ember.View.extend({
templateName: 'map',
mapOptions: null,
init: function () {
this._super();
// Enable new gmaps ui
this.set('mapOptions', App.Config.mapOptions);
google.maps.visualRefresh = true;
},
didInsertElement: function () {
var $gmap = this.$().find('#gmap'),
mapOptions = this.get('mapOptions'),
gmap;
gmap = new google.maps.Map($gmap.get(0), mapOptions);
this.setProperties({
'controller.gmap': gmap,
'controller.view': this
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment