? 818638-google-maps-api-v3-compat.patch
Index: gmap.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/gmap/gmap.install,v
retrieving revision 1.5.2.1
diff -u -p -r1.5.2.1 gmap.install
--- gmap.install	10 Jan 2010 02:11:02 -0000	1.5.2.1
+++ gmap.install	11 Oct 2010 18:56:51 -0000
@@ -19,8 +19,6 @@ function gmap_uninstall() {
   variable_del('gmap_markerfiles');
   variable_del('gmap_node_markers');
   variable_del('gmap_private_markerfile');
-
-  variable_del('googlemap_api_key');
 }
 
 /**
@@ -100,3 +98,20 @@ function gmap_update_5003() {
   drupal_set_message(t('Border Padding on marker managers is now defaulting to the recommended 256 pixels, rather than 0 pixels. You may wish to change your marker manager settings on the <a href="@url">GMap settings page</a> to match.', array('@url' => url('admin/settings/gmap'))));
   return $ret;
 }
+
+/**
+ * Mini-update -- Micro control type no longer exists, convert to Small if set
+ */
+function gmap_update_6000() {
+  $ret = array();
+
+  $d = variable_get('gmap_default', array());
+  
+  if ($d['controltype'] === 'Micro') {
+    $d['controltype'] = 'Small';
+  }
+  
+  variable_set('gmap_default', $d);
+  
+  return $ret;
+}
\ No newline at end of file
Index: gmap.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/gmap/gmap.module,v
retrieving revision 1.104.2.6
diff -u -p -r1.104.2.6 gmap.module
--- gmap.module	8 Jun 2010 17:40:59 -0000	1.104.2.6
+++ gmap.module	11 Oct 2010 18:56:52 -0000
@@ -18,7 +18,7 @@
  * See http://groups.google.com/group/Google-Maps-API/web/api-version-changes
  * for details on using other version numbers.
  */
-define('GMAP_API_VERSION', '2.115');
+define('GMAP_API_VERSION', '3.2');
 
 /**
  * Get the defaults for a gmap.
@@ -320,13 +320,12 @@ function _gmap_doheader() {
 drupal_add_js($gmap_path . '/js/poly.js');
 
   global $language;
+  $file = 'api/js';
   $query = array(
-    'file' => 'api',
     'v' => variable_get('gmap_api_version', GMAP_API_VERSION),
-    'key' => gmap_get_key(),
-    'hl' => $language->language,
+    'sensor' => 'false',
   );
-  drupal_set_html_head('<script src="'. check_url(url('http://maps.google.com/maps', array('query' => $query))) .'" type="text/javascript"></script>');
+  drupal_set_html_head('<script src="'. check_url(url('http://maps.google.com/maps/' . $file, array('query' => $query))) .'" type="text/javascript"></script>');
 
   $gmap_initialized = TRUE;
 }
@@ -863,12 +862,6 @@ function theme_gmap_align($element) {
  * Gmap element theme hook
  */
 function theme_gmap($element) {
-  // Usability: Prevent js errors on first visit to settings page, etc.
-  // Of course it will still error if the *wrong* key is on file.
-  if (gmap_get_key() == '') {
-    return t('Unable to render map: Google Maps API key is missing.');
-  }
-
   // Track the mapids we've used already.
   static $mapids = array();
 
@@ -1193,57 +1186,6 @@ function gmap_simple_map($latitude, $lon
 }
 
 /**
- * Implementation of hook_keys_service(). (from the keys api)
- */
-function gmap_keys_service() {
-  // @@@ Remove after everyone has upgraded.
-  if (module_exists('keys_api')) {
-    return array(
-      'gmap' => array(
-        'name' => t('Gmap'),
-        'description' => t('Google Maps API Key'),
-      ),
-    );
-  }
-  elseif (module_exists('keys')) {
-    // @greenSkin:
-    // What is your reasoning behind predefining this?
-    // I'll avoid overriding you for now, but this seems rather arbitrary.
-    // Reference: http://drupal.org/cvs?commit=310498
-
-    // Probe keys to determine if it is defining our key for us.
-    $test = array();
-    if (function_exists('keys_keys_service')) {
-      $test = keys_keys_service();
-    }
-    if (!isset($test['google_maps'])) {
-      // Be forward compatible with future versions of keys api
-      // that no longer define it.
-      return array(
-        'google_maps' => array(
-          'name' => t('Google Maps'),
-          'description' => t('Google Maps API Key'),
-        ),
-      );
-    }
-  }
-}
-
-/**
- * Retrieve the Google Maps key that is in use for the site.
- */
-function gmap_get_key() {
-  $key = variable_get('googlemap_api_key', '');
-  if (module_exists('keys_api')) {
-    $key = keys_api_get_key('gmap', $_SERVER['HTTP_HOST']);
-  }
-  elseif (module_exists('keys')) {
-    $key = keys_get_key('google_maps');
-  }
-  return $key;
-}
-
-/**
  * Implementation of hook_views_plugins().
  */
 function gmap_views_plugins() {
Index: gmap_settings_ui.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/gmap/gmap_settings_ui.inc,v
retrieving revision 1.12.2.6
diff -u -p -r1.12.2.6 gmap_settings_ui.inc
--- gmap_settings_ui.inc	15 Sep 2010 23:40:50 -0000	1.12.2.6
+++ gmap_settings_ui.inc	11 Oct 2010 18:56:52 -0000
@@ -10,7 +10,6 @@ function gmap_admin_settings(&$form_stat
   // Reset the icondata cache.
   gmap_get_icondata(TRUE);
 
-  //note the same google api key variable name as in the googlemap module is used
   //note the name of the variable for center of the map is latlong although the format is actually longitude, latitude
 
   $form['initialization'] = array(
@@ -18,25 +17,6 @@ function gmap_admin_settings(&$form_stat
     '#title' => t('Google Map Initialize'),
   );
 
-  if (!module_exists('keys_api') && !module_exists('keys')) {
-    $form['initialization']['googlemap_api_key'] = array(
-      '#type' => 'textfield',
-      '#default_value' => variable_get('googlemap_api_key', ''),
-      '#size' => 50,
-      '#maxlength' => 255,
-    );
-  }
-  else {
-    $form['initialization']['googlemap_api_key'] = array(
-      '#type' => 'item',
-      '#title' => t('Google Maps API Key'),
-      '#value' => t('Managed by <a href="@url">Keys</a>.', array('@url' => url('admin/settings/keys'))),
-    );
-  }
-
-  $form['initialization']['googlemap_api_key']['#title'] = t('Google Maps API Key');
-  $form['initialization']['googlemap_api_key']['#description'] = t('Your personal Googlemaps API key.  You must get this for each separate website at <a href="http://code.google.com/apis/maps/signup.html">Google Map API website</a>.');
-
   if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) != FILE_DOWNLOADS_PUBLIC) {
     $form['initialization']['gmap_private_markerfile'] = array(
       '#type' => 'textfield',
@@ -157,7 +137,7 @@ function gmap_admin_settings(&$form_stat
   $form['gmap_default']['controltype'] = array(
     '#type' => 'select',
     '#title' => t('Default control type'),
-    '#options' => array('None' => t('None'), 'Micro' => t('Micro'), 'Small' => t('Small'), 'Large' => t('Large')),
+    '#options' => array('None' => t('None'), 'Small' => t('Small'), 'Large' => t('Large')),
     '#default_value' => $defaults['controltype'],
   );
   gmap_widget_setup($form['gmap_default']['controltype'], 'controltype', 'settings_default_map');
@@ -167,9 +147,9 @@ function gmap_admin_settings(&$form_stat
     '#title' => t('Map Type Control'),
     '#options' => array(
       'none' => t('None'),
-      'standard' => t('Standard (GMapTypeControl)'),
-      'hier' => t('Hierarchical (GHierarchicalMapTypeControl)'),
-      'menu' => t('Dropdown (GMenuMapTypeControl)'),
+      'standard' => t('Standard (google.maps.MapTypeControlStyle.DEFAULT)'),
+      'horiz' => t('Horizontal bar (google.maps.MapTypeControlStyle.HORIZONTAL_BAR)'),
+      'menu' => t('Dropdown (google.maps.MapTypeControlStyle.DROPDOWN_MENU)'),
     ),
     '#default_value' => $defaults['mtc'],
   );
Index: js/gmap.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/gmap/js/gmap.js,v
retrieving revision 1.16.2.1
diff -u -p -r1.16.2.1 gmap.js
--- js/gmap.js	8 Apr 2010 13:40:19 -0000	1.16.2.1
+++ js/gmap.js	11 Oct 2010 18:56:52 -0000
@@ -195,26 +195,14 @@ Drupal.gmap.addHandler('gmap', function 
 
   var _ib = {};
 
-
   // Respond to incoming zooms
   _ib.zoom = obj.bind("zoom", function () {
     obj.map.setZoom(obj.vars.zoom);
   });
-
+  
   // Respond to incoming moves
   _ib.move = obj.bind("move", function () {
-    obj.map.panTo(new GLatLng(obj.vars.latitude, obj.vars.longitude));
-  });
-
-  // Respond to incoming map type changes
-  _ib.mtc = obj.bind("maptypechange", function () {
-    var i;
-    for (i = 0; i < obj.opts.mapTypeNames.length; i++) {
-      if (obj.opts.mapTypeNames[i] === obj.vars.maptype) {
-        obj.map.setMapType(obj.opts.mapTypes[i]);
-        break;
-      }
-    }
+    obj.map.panTo(new google.maps.LatLng(obj.vars.latitude, obj.vars.longitude));
   });
 
   // Respond to incoming width changes.
@@ -234,87 +222,126 @@ Drupal.gmap.addHandler('gmap', function 
 
   // Respond to incoming control type changes.
   _ib.ctc = obj.bind("controltypechange", function () {
-    if (obj.currentcontrol) {
-      obj.map.removeControl(obj.currentcontrol);
-    }
     if (obj.vars.controltype === 'Micro') {
-      obj.map.addControl(obj.currentcontrol = new GSmallZoomControl());
+      obj.map.setOptions({navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL}});
     }
     else if (obj.vars.controltype === 'Small') {
-      obj.map.addControl(obj.currentcontrol = new GSmallMapControl());
+      obj.map.setOptions({navigationControlOptions: {style: google.maps.NavigationControlStyle.ZOOM_PAN}});
     }
     else if (obj.vars.controltype === 'Large') {
-      obj.map.addControl(obj.currentcontrol = new GLargeMapControl());
+      obj.map.setOptions({navigationControlOptions: {style: google.maps.NavigationControlStyle.DEFAULT}});
     }
   });
   // Send out outgoing control type changes.
   // N/A
 
   obj.bind("bootstrap_options", function () {
-    // Bootup options.
-    var opts = {}; // Object literal GMapOptions
+    // // Bootup options.
+    var opts = {}; // Object literal google.maps.MapOptions
     obj.opts = opts;
+    
+    // Disable default UI for custom options
+    opts.disableDefaultUI = true;
+    
+    // Set draggable property
+    if (obj.vars.behavior.nodrag) {
+      opts.draggable = false;
+    }
+    else if (obj.vars.behavior.nokeyboard) {
+      opts.keyboardShortcuts = false;
+    }
 
-    // Null out the enabled types.
-    opts.mapTypes = [];
-    opts.mapTypeNames = [];
+    // Set default map type (set to road map if nothing selected)
+    switch (obj.vars.maptype) {
+      case 'Hybrid':
+        opts.mapTypeId = google.maps.MapTypeId.HYBRID;
+        break;
+      case 'Physical':
+        opts.mapTypeId = google.maps.MapTypeId.TERRAIN;
+        break;
+      case 'Satellite':
+        opts.mapTypeId = google.maps.MapTypeId.SATELLITE;
+        break;
+      case 'Map':
+      default:
+        opts.mapTypeId = google.maps.MapTypeId.ROADMAP;
+        break;
+    }
 
-    // Load google map types.
+    // Null out the enabled types.
+    opts.mapTypeIds = [];
+    
     if (obj.vars.baselayers.Map) {
-      opts.mapTypes.push(G_NORMAL_MAP);
-      opts.mapTypeNames.push('Map');
-    }
-    if (obj.vars.baselayers.Satellite) {
-      opts.mapTypes.push(G_SATELLITE_MAP);
-      opts.mapTypeNames.push('Satellite');
+      opts.mapTypeIds.push(google.maps.MapTypeId.ROADMAP);
     }
     if (obj.vars.baselayers.Hybrid) {
-      opts.mapTypes.push(G_HYBRID_MAP);
-      opts.mapTypeNames.push('Hybrid');
+      opts.mapTypeIds.push(google.maps.MapTypeId.HYBRID);
     }
     if (obj.vars.baselayers.Physical) {
-      opts.mapTypes.push(G_PHYSICAL_MAP);
-      opts.mapTypeNames.push('Physical');
+      opts.mapTypeIds.push(google.maps.MapTypeId.TERRAIN);
     }
-
-  });
-
-  obj.bind("boot", function () {
-    obj.map = new GMap2(elem, obj.opts);
-  });
-
-  obj.bind("init", function () {
-    var map = obj.map;
-
+    if (obj.vars.baselayers.Satellite) {
+      opts.mapTypeIds.push(google.maps.MapTypeId.SATELLITE);
+    }
+    
     // Map type control
+    opts.mapTypeControl = true;
+    opts.mapTypeControlOptions = {};
     if (obj.vars.mtc === 'standard') {
-      map.addControl(new GMapTypeControl());
+      opts.mapTypeControlOptions.style = google.maps.MapTypeControlStyle.DEFAULT;
     }
-    else if (obj.vars.mtc === 'hier') {
-      map.addControl(new GHierarchicalMapTypeControl());
+    else if (obj.vars.mtc === 'horiz') {
+      opts.mapTypeControlOptions.style = google.maps.MapTypeControlStyle.HORIZONTAL_BAR;
     }
     else if (obj.vars.mtc === 'menu') {
-      map.addControl(new GMenuMapTypeControl());
+      opts.mapTypeControlOptions.style = google.maps.MapTypeControlStyle.DROPDOWN_MENU;
     }
-
-    if (obj.vars.behavior.overview) {
-      map.addControl(new GOverviewMapControl());
+    
+    // Navigation control type
+    if (obj.vars.controltype !== 'None') {
+      opts.navigationControl = true;
     }
-    if (obj.vars.behavior.googlebar) {
-      map.enableGoogleBar();
+    if (obj.vars.controltype === 'Small') {
+      opts.navigationControlOptions = {style: google.maps.NavigationControlStyle.SMALL};
     }
-    if (obj.vars.behavior.scale) {
-      map.addControl(new GScaleControl());
+    else if (obj.vars.controltype === 'Large') {
+      opts.navigationControlOptions = {style: google.maps.NavigationControlStyle.ZOOM_PAN};
     }
-    if (obj.vars.behavior.nodrag) {
-      map.disableDragging();
+    
+    // Set scale control visibility
+    opts.scaleControl = obj.vars.behavior.scale;
+
+    // Scroll wheel control
+    if (obj.vars.behavior.nomousezoom) {
+      opts.scrollwheel = false;
     }
-    else if (!obj.vars.behavior.nokeyboard) {
-      obj._kbdhandler = new GKeyboardHandler(map);
+
+    // Disable double-click zoom
+    if (obj.vars.behavior.nocontzoom) {
+      opts.disableDoubleClickZoom = true;
     }
+
+  });
+
+  obj.bind("boot", function () {
+    obj.map = new google.maps.Map(elem, obj.opts);
+    console.log(obj.map);
+  });
+
+  obj.bind("init", function () {
+    var map = obj.map;
+
+    // Not implemented in API v3
+    // if (obj.vars.behavior.overview) {
+    //   map.addControl(new GOverviewMapControl());
+    // }
+    // if (obj.vars.behavior.googlebar) {
+    //   map.enableGoogleBar();
+    // }
+
     if (obj.vars.extent) {
       var c = obj.vars.extent;
-      var extent = new GLatLngBounds(new GLatLng(c[0][0], c[0][1]), new GLatLng(c[1][0], c[1][1]));
+      var extent = new google.maps.LatLngBounds(new google.maps.LatLng(c[0][0], c[0][1]), new google.maps.LatLng(c[1][0], c[1][1]));
       obj.vars.latitude = extent.getCenter().lat();
       obj.vars.longitude = extent.getCenter().lng();
       obj.vars.zoom = map.getBoundsZoomLevel(extent);
@@ -326,39 +353,32 @@ Drupal.gmap.addHandler('gmap', function 
       setTimeout(function () {
         var r = function () {
           map.checkResize();
-          map.setCenter(new GLatLng(obj.vars.latitude, obj.vars.longitude), obj.vars.zoom);
+          map.setCenter(new google.maps.LatLng(obj.vars.latitude, obj.vars.longitude), obj.vars.zoom);
         };
         $(elem).parents('fieldset.collapsible').children('legend').children('a').click(r);
         // Would be nice, but doesn't work.
         //$(elem).parents('fieldset.collapsible').children('.fieldset-wrapper').scroll(r);
       }, 0);
     }
-    map.setCenter(new GLatLng(obj.vars.latitude, obj.vars.longitude), obj.vars.zoom);
-
-    if (!obj.vars.nocontzoom) {
-      map.enableDoubleClickZoom();
-      map.enableContinuousZoom();
-    }
-    if (!obj.vars.behavior.nomousezoom) {
-      map.enableScrollWheelZoom();
-    }
+    map.setCenter(new google.maps.LatLng(obj.vars.latitude, obj.vars.longitude));
+    map.setZoom(obj.vars.zoom);
 
     // Send out outgoing zooms
-    GEvent.addListener(map, "zoomend", function (oldzoom, newzoom) {
+    google.maps.event.addListener(map, "zoomend", function (oldzoom, newzoom) {
       obj.vars.zoom = newzoom;
       obj.change("zoom", _ib.zoom);
     });
-
+    
     // Send out outgoing moves
-    GEvent.addListener(map, "moveend", function () {
+    google.maps.event.addListener(map, "moveend", function () {
       var coord = map.getCenter();
       obj.vars.latitude = coord.lat();
       obj.vars.longitude = coord.lng();
       obj.change("move", _ib.move);
     });
-
+    
     // Send out outgoing map type changes.
-    GEvent.addListener(map, "maptypechanged", function () {
+    google.maps.event.addListener(map, "maptypechanged", function () {
       // If the map isn't ready yet, ignore it.
       if (obj.ready) {
         var type = map.getCurrentMapType();
@@ -379,159 +399,159 @@ Drupal.gmap.addHandler('gmap', function 
 //            Zoom widget             //
 ////////////////////////////////////////
 Drupal.gmap.addHandler('zoom', function (elem) {
-  var obj = this;
-  // Respond to incoming zooms
-  var binding = obj.bind("zoom", function () {
-    elem.value = obj.vars.zoom;
-  });
-  // Send out outgoing zooms
-  $(elem).change(function () {
-    obj.vars.zoom = parseInt(elem.value, 10);
-    obj.change("zoom", binding);
-  });
+  // var obj = this;
+  // // Respond to incoming zooms
+  // var binding = obj.bind("zoom", function () {
+  //   elem.value = obj.vars.zoom;
+  // });
+  // // Send out outgoing zooms
+  // $(elem).change(function () {
+  //   obj.vars.zoom = parseInt(elem.value, 10);
+  //   obj.change("zoom", binding);
+  // });
 });
 
 ////////////////////////////////////////
 //          Latitude widget           //
 ////////////////////////////////////////
 Drupal.gmap.addHandler('latitude', function (elem) {
-  var obj = this;
-  // Respond to incoming movements.
-  var binding = obj.bind("move", function () {
-    elem.value = '' + obj.vars.latitude;
-  });
-  // Send out outgoing movements.
-  $(elem).change(function () {
-    obj.vars.latitude = Number(this.value);
-    obj.change("move", binding);
-  });
+  // var obj = this;
+  // // Respond to incoming movements.
+  // var binding = obj.bind("move", function () {
+  //   elem.value = '' + obj.vars.latitude;
+  // });
+  // // Send out outgoing movements.
+  // $(elem).change(function () {
+  //   obj.vars.latitude = Number(this.value);
+  //   obj.change("move", binding);
+  // });
 });
 
 ////////////////////////////////////////
 //         Longitude widget           //
 ////////////////////////////////////////
 Drupal.gmap.addHandler('longitude', function (elem) {
-  var obj = this;
-  // Respond to incoming movements.
-  var binding = obj.bind("move", function () {
-    elem.value = '' + obj.vars.longitude;
-  });
-  // Send out outgoing movements.
-  $(elem).change(function () {
-    obj.vars.longitude = Number(this.value);
-    obj.change("move", binding);
-  });
+  // var obj = this;
+  // // Respond to incoming movements.
+  // var binding = obj.bind("move", function () {
+  //   elem.value = '' + obj.vars.longitude;
+  // });
+  // // Send out outgoing movements.
+  // $(elem).change(function () {
+  //   obj.vars.longitude = Number(this.value);
+  //   obj.change("move", binding);
+  // });
 });
 
 ////////////////////////////////////////
 //          Latlon widget             //
 ////////////////////////////////////////
 Drupal.gmap.addHandler('latlon', function (elem) {
-  var obj = this;
-  // Respond to incoming movements.
-  var binding = obj.bind("move", function () {
-    elem.value = '' + obj.vars.latitude + ',' + obj.vars.longitude;
-  });
-  // Send out outgoing movements.
-  $(elem).change(function () {
-    var t = this.value.split(',');
-    obj.vars.latitude = Number(t[0]);
-    obj.vars.longitude = Number(t[1]);
-    obj.change("move", binding);
-  });
+  // var obj = this;
+  // // Respond to incoming movements.
+  // var binding = obj.bind("move", function () {
+  //   elem.value = '' + obj.vars.latitude + ',' + obj.vars.longitude;
+  // });
+  // // Send out outgoing movements.
+  // $(elem).change(function () {
+  //   var t = this.value.split(',');
+  //   obj.vars.latitude = Number(t[0]);
+  //   obj.vars.longitude = Number(t[1]);
+  //   obj.change("move", binding);
+  // });
 });
 
 ////////////////////////////////////////
 //          Maptype widget            //
 ////////////////////////////////////////
-Drupal.gmap.addHandler('maptype', function (elem) {
-  var obj = this;
-  // Respond to incoming movements.
-  var binding = obj.bind("maptypechange", function () {
-    elem.value = obj.vars.maptype;
-  });
-  // Send out outgoing movements.
-  $(elem).change(function () {
-    obj.vars.maptype = elem.value;
-    obj.change("maptypechange", binding);
-  });
-});
-
-(function () { // BEGIN CLOSURE
-  var re = /([0-9.]+)\s*(em|ex|px|in|cm|mm|pt|pc|%)/;
-  var normalize = function (str) {
-    var ar;
-    if ((ar = re.exec(str.toLowerCase()))) {
-      return ar[1] + ar[2];
-    }
-    return null;
-  };
-  ////////////////////////////////////////
-  //           Width widget             //
-  ////////////////////////////////////////
-  Drupal.gmap.addHandler('width', function (elem) {
-    var obj = this;
-    // Respond to incoming width changes.
-    var binding = obj.bind("widthchange", function (w) {
-      elem.value = normalize(w);
-    });
-    // Send out outgoing width changes.
-    $(elem).change(function () {
-      var n;
-      if ((n = normalize(elem.value))) {
-        elem.value = n;
-        obj.change('widthchange', binding, n);
-      }
-    });
-    obj.bind('init', function () {
-      $(elem).change();
-    });
-  });
-
-  ////////////////////////////////////////
-  //           Height widget            //
-  ////////////////////////////////////////
-  Drupal.gmap.addHandler('height', function (elem) {
-    var obj = this;
-    // Respond to incoming height changes.
-    var binding = obj.bind("heightchange", function (h) {
-      elem.value = normalize(h);
-    });
-    // Send out outgoing height changes.
-    $(elem).change(function () {
-      var n;
-      if ((n = normalize(elem.value))) {
-        elem.value = n;
-        obj.change('heightchange', binding, n);
-      }
-    });
-    obj.bind('init', function () {
-      $(elem).change();
-    });
-  });
-
-})(); // END CLOSURE
+// Drupal.gmap.addHandler('maptype', function (elem) {
+//   // var obj = this;
+//   // // Respond to incoming movements.
+//   // var binding = obj.bind("maptypechange", function () {
+//   //   elem.value = obj.vars.maptype;
+//   // });
+//   // // Send out outgoing movements.
+//   // $(elem).change(function () {
+//   //   obj.vars.maptype = elem.value;
+//   //   obj.change("maptypechange", binding);
+//   // });
+// });
+// 
+// (function () { // BEGIN CLOSURE
+//   var re = /([0-9.]+)\s*(em|ex|px|in|cm|mm|pt|pc|%)/;
+//   var normalize = function (str) {
+//     var ar;
+//     if ((ar = re.exec(str.toLowerCase()))) {
+//       return ar[1] + ar[2];
+//     }
+//     return null;
+//   };
+//   ////////////////////////////////////////
+//   //           Width widget             //
+//   ////////////////////////////////////////
+//   Drupal.gmap.addHandler('width', function (elem) {
+//     var obj = this;
+//     // Respond to incoming width changes.
+//     var binding = obj.bind("widthchange", function (w) {
+//       elem.value = normalize(w);
+//     });
+//     // Send out outgoing width changes.
+//     $(elem).change(function () {
+//       var n;
+//       if ((n = normalize(elem.value))) {
+//         elem.value = n;
+//         obj.change('widthchange', binding, n);
+//       }
+//     });
+//     obj.bind('init', function () {
+//       $(elem).change();
+//     });
+//   });
+// 
+//   ////////////////////////////////////////
+//   //           Height widget            //
+//   ////////////////////////////////////////
+//   Drupal.gmap.addHandler('height', function (elem) {
+//     var obj = this;
+//     // Respond to incoming height changes.
+//     var binding = obj.bind("heightchange", function (h) {
+//       elem.value = normalize(h);
+//     });
+//     // Send out outgoing height changes.
+//     $(elem).change(function () {
+//       var n;
+//       if ((n = normalize(elem.value))) {
+//         elem.value = n;
+//         obj.change('heightchange', binding, n);
+//       }
+//     });
+//     obj.bind('init', function () {
+//       $(elem).change();
+//     });
+//   });
+// 
+// })(); // END CLOSURE
 
 ////////////////////////////////////////
 //        Control type widget         //
 ////////////////////////////////////////
-Drupal.gmap.addHandler('controltype', function (elem) {
-  var obj = this;
-  // Respond to incoming height changes.
-  var binding = obj.bind("controltypechange", function () {
-    elem.value = obj.vars.controltype;
-  });
-  // Send out outgoing height changes.
-  $(elem).change(function () {
-    obj.vars.controltype = elem.value;
-    obj.change("controltypechange", binding);
-  });
-});
-
-// Map cleanup.
-if (Drupal.jsEnabled) {
-  $(document).unload(GUnload);
-}
+// Drupal.gmap.addHandler('controltype', function (elem) {
+//   var obj = this;
+//   // Respond to incoming height changes.
+//   var binding = obj.bind("controltypechange", function () {
+//     elem.value = obj.vars.controltype;
+//   });
+//   // Send out outgoing height changes.
+//   $(elem).change(function () {
+//     obj.vars.controltype = elem.value;
+//     obj.change("controltypechange", binding);
+//   });
+// });
+// 
+// // Map cleanup.
+// if (Drupal.jsEnabled) {
+//   $(document).unload(GUnload);
+// }
 
 Drupal.behaviors.GMap = function (context) {
   if (Drupal.settings && Drupal.settings['gmap_remap_widgets']) {
