Add more front end glory

This commit is contained in:
Brian Miyaji
2014-01-15 17:24:50 +11:00
parent e3a04bc8c9
commit 5bbd3a179f
8 changed files with 276 additions and 111 deletions

View File

@@ -54,4 +54,29 @@
}
});
// Google Maps
function initialize_google_maps() {
$maps = $('.sp-google-map');
$maps.each(function() {
$self = $(this);
address = $self.attr('data-address');
latitude = $self.attr('data-latitude');
longitude = $self.attr('data-longitude');
var ll = new google.maps.LatLng(latitude,longitude);
var mapOptions = {
zoom: 16,
center: ll
};
var map = new google.maps.Map($self[0], mapOptions)
var marker = new google.maps.Marker({
position: ll,
map: map,
animation: google.maps.Animation.DROP,
flat: true,
title: address
});
});
}
google.maps.event.addDomListener(window, "load", initialize_google_maps);
})(jQuery);