public function SearchApiLocationMapViewsHandlerFilter::query in Search API Location 7.2
Add this filter to the query.
Overrides SearchApiViewsHandlerFilter::query
File
- search_api_location_map/
views/ handler_filter_location.inc, line 87 - Provides the views handler for location fields
Class
- SearchApiLocationMapViewsHandlerFilter
- @file Provides the views handler for location fields
Code
public function query() {
$field = str_replace(":", "_", $this->real_field);
if (isset($this->view->exposed_input[$field]['radius'])) {
$spatial = array();
$spatial['lat'] = $this->view->exposed_input[$field]['lat'];
$spatial['lng'] = $this->view->exposed_input[$field]['lng'];
$spatial['radius'] = $this->view->exposed_input[$field]['radius'];
$spatial['radius_measure'] = $this->options['radius_measure'];
$spatial['field'] = $this->real_field;
$this->query
->setOption('spatial', $spatial);
}
}