ifnull
1/21/2013 - 12:18 AM

Drupal Google Maps

Drupal Google Maps

  // 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);
  });