Skip to content

Instantly share code, notes, and snippets.

@jaseflow
Created December 7, 2012 01:08
Show Gist options
  • Save jaseflow/4229905 to your computer and use it in GitHub Desktop.
Save jaseflow/4229905 to your computer and use it in GitHub Desktop.
/*!
* Wotif MapView
* @requires jQuery v1.7.2+
*
* Description
*
* @author ...
*/
!(function($) {
window.Wotif.mapView = window.Wotif.mapView || window.Wotif.BaseModule(function() {
var $el,
$mapCanvas,
map;
return {
init: function() {
$el = $('body');
$mapCanvas = $('.map-canvas');
map = new GMaps({
div: $mapCanvas,
lat: -27.734858,
lng: 153.227302
});
this.attachEvents();
},
attachEvents: function() {
$el.on('click', '.toggle-map', this.events.loadMap);
},
events: {
loadMap: function(e) {
e.preventDefault();
$mapCanvas.show();
}
}
}
}());
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment