diff --git a/views/views_geojson.views.inc b/views/views_geojson.views.inc
index f3f06b8..3a8d1ef 100644
--- a/views/views_geojson.views.inc
+++ b/views/views_geojson.views.inc
@@ -76,5 +76,23 @@ function views_geojson_views_data() {
     ),
   );
 
+  if (module_exists('search_api')) {
+    $entity_types = entity_get_info();
+    foreach (search_api_index_load_multiple(FALSE) as $index) {
+      // Fill in base data.
+      $key = 'search_api_index_' . $index->machine_name;
+      $table = &$data[$key];
+      $type_info = search_api_get_item_type_info($index->item_type);
+      $data[$key]['bbox_argument'] = array(
+        'group' => t('Custom'),
+        'real field'  => 'bbox_argument',
+        'title' => t('Bounding box'),
+        'help' => t('Filter locations within a bounding box.'),
+        'argument' => array(
+          'handler' => 'views_geojson_bbox_argument'
+        ),
+      );
+    }
+  };
   return $data;
 }
\ No newline at end of file
diff --git a/views/views_geojson_bbox_argument.inc b/views/views_geojson_bbox_argument.inc
index 6e3c1f9..c4e0343 100644
--- a/views/views_geojson_bbox_argument.inc
+++ b/views/views_geojson_bbox_argument.inc
@@ -157,14 +157,14 @@ class views_geojson_bbox_argument extends views_handler_argument {
     if ($right - $left < 360) {
       $group = $this->query->set_where_group('AND');
       if ($left > -180) {
-        $this->query->add_where($group, "$lon_field_table.$lon_field_name", $left, '>=');
+        $this->filter($group, "$lon_field_table.$lon_field_name", $left, '>=');
       } else {
         $this->query->set_where_group('OR', $group);
         $left = -1 * ($left % 180);
-        $this->query->add_where($group, "$lon_field_table.$lon_field_name", array($left, 0), 'BETWEEN');
+        $this->filter($group, "$lon_field_table.$lon_field_name", array($left, 0), 'BETWEEN');
       }
       if ($right < 180) {
-        $this->query->add_where($group, "$lon_field_table.$lon_field_name", $right, '<=');
+        $this->filter($group, "$lon_field_table.$lon_field_name", $right, '<=');
       } else {
         $this->query->set_where_group('OR', $group);
         $right = -1 * ($right % 180);
@@ -175,7 +175,17 @@ class views_geojson_bbox_argument extends views_handler_argument {
     $bottom = $bbox['bottom'];
     $top = $bbox['top'];
     $group = $this->query->set_where_group('AND');
-    $this->query->add_where($group, "$lat_field_table.$lat_field_name", $bottom, '>=');
-    $this->query->add_where($group, "$lat_field_table.$lat_field_name", $top, '<=');
+    $this->filter($group, "$lat_field_table.$lat_field_name", $bottom, '>=');
+    $this->filter($group, "$lat_field_table.$lat_field_name", $top, '<=');
   }
-}
\ No newline at end of file
+
+  function filter($group, $field, $value = NULL, $operator = NULL) {
+    if (!$this->view->display_handler->use_group_by()) {
+      $this->query->add_where($group, $field, $value, $operator);
+    }
+    else {
+      $this->query->add_having($group, $field, $value, $operator);
+    }
+  }
+}
+
