Created
January 21, 2013 00:18
-
-
Save ifnull/4582766 to your computer and use it in GitHub Desktop.
Drupal Google Maps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GMap Functional Overrides | |
if(Drupal.gmap !== undefined) { | |
// Set boot options | |
Drupal.gmap.addHandler('gmap', function (elem) { | |
var obj = this; | |
obj.bind("boot", function () { | |
obj.map.setOptions({ | |
styles: styles, | |
mapTypeControl: false, | |
scrollwheel: false | |
}); | |
}); | |
}); | |
} | |
// Resize fix when toolbar opens | |
$(window).bind('draweropen', function() { | |
var id = $('#tools .view-partners-map .gmap').attr('id').split('-')[1], | |
map = Drupal.gmap.getMap(id).map, | |
center = new google.maps.LatLng(12.513311582758096,-69.97476239648438); | |
google.maps.event.trigger(map, 'resize'); | |
map.setZoom(11); | |
map.setCenter(center); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment