A simple helper class for making custom implementations with Google Maps for ExpressionEngine easier.
https://objectivehtml.com/google-maps/license
http://objectivehtml.dev/google-maps/examples/jquery
// 'map' is the same as your id parameter in the exp:gmap:init tag
var helper = new GmapHelper('map');
helper.center();
// Alternatively, if you add true to first argument in the center() method,
// you will tell the script to use the default zoom from the initialized map
helper.center(true);
$(function() {
var helper = new GmapHelper('map');
$( "#tabs" ).tabs({
// older versions of jQuery UI will use the show() method instead of activate()
activate: function() {
helper.center();
}
});
});
$(function() {
var helper = new GmapHelper('map');
$('a[data-toggle="tab"]').on('shown', function (e) {
helper.center();
});
});
$(function() {
var helper = new GmapHelper('map');
$('.tabs dd').click(function(e) {
setTimeout(function() {
helper.center();
}, 100);
e.preventDefault();
});
});