Index: sites/all/modules/drupal.org/gmap/gmap_plugin_style_gmap.inc
===================================================================
--- sites/all/modules/drupal.org/gmap/gmap_plugin_style_gmap.inc	(revision 14836)
+++ sites/all/modules/drupal.org/gmap/gmap_plugin_style_gmap.inc	(working copy)
@@ -39,6 +39,9 @@
     $options['center_on_nodearg'] = array('default' => 0);
     $options['center_on_nodearg_arg'] = array('default' => '');
 
+    $options['center_on_proximityfilter'] = array('default' => 0);
+    $options['center_on_proximityfilter_rel'] = array('default' => '');
+
     $options['highlight_nodearg'] = array('default' => 0);
     $options['highlight_nodearg_arg'] = array('default' => '');
     $options['highlight_nodearg_color'] = array('default' => '#FF0000');
@@ -157,6 +160,14 @@
       if ($this->options['center_on_nodearg'] && $nodehandler = $this->view->display_handler->get_handler('argument', $this->options['center_on_nodearg_arg'])) {
         $center_nid = $nodehandler->get_value();
       }
+      if ($this->options['center_on_proximityfilter'] && $this->options['datasource'] == 'location' && module_exists('location')) {
+        $coords = location_views_proximity_get_reference_location($this->view, array(
+          'origin' => 'tied',
+          'relationship' => $this->options['center_on_proximityfilter_rel'])
+        );
+        $center_lat = $coords['latitude'];
+        $center_lon = $coords['longitude'];
+      }
       if ($this->options['highlight_nodearg'] && $nodehandler = $this->view->display_handler->get_handler('argument', $this->options['highlight_nodearg_arg'])) {
         $highlight_nid = $nodehandler->get_value();
       }
@@ -404,6 +415,54 @@
       '#dependency' => array('edit-style-options-center-on-nodearg' => array(TRUE)),
     );
 
+    if (module_exists('location')) {
+      $form['center_on_proximityfilter'] = array(
+        '#type' => 'checkbox',
+        '#title' => t('Center on proximity filter'),
+        '#default_value' => $this->options['center_on_proximityfilter'],
+        '#description' => t('Note: The view must contain a "Location: Distance / Proximity" filter'),
+      );
+
+      // A whole bunch of code to figure out what relationships are valid for
+      // this item.
+      $relationships = $this->display->handler->get_option('relationships');
+      $relationship_options = array();
+
+      foreach ($relationships as $relationship) {
+        $relationship_handler = views_get_handler($relationship['table'], $relationship['field'], 'relationship');
+
+        // If this relationship is valid for this type, add it to the list.
+        $data = views_fetch_data($relationship['table']);
+        $base = $data[$relationship['field']]['relationship']['base'];
+        if ($base == 'location') {
+          $relationship_handler->init($view, $relationship);
+          $relationship_options[$relationship['id']] = $relationship_handler->label();
+        }
+      }
+
+      if (!empty($relationship_options)) {
+        $relationship_options = array_merge(array('none' => t('Do not use a relationship')), $relationship_options);
+        $rel = empty($this->options['relationship']) ? 'none' : $this->options['relationship'];
+        if (empty($relationship_options[$rel])) {
+          // Pick the first relationship.
+          $rel = key($relationship_options);
+        }
+
+        $form['center_on_proximityfilter_rel'] = array(
+          '#type' => 'select',
+          '#title' => t('Relationship'),
+          '#options' => $relationship_options,
+          '#default_value' => $rel,
+        );
+      }
+      else {
+        $form['center_on_proximityfilter_rel'] = array(
+          '#type' => 'value',
+          '#value' => 'none',
+        );
+      }
+    }
+
     $form['highlight_nodearg'] = array(
       '#type' => 'checkbox',
       '#title' => t('Highlight marker for node argument'),
