Closed (fixed)
Project:
Geofield
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 May 2012 at 15:01 UTC
Updated:
5 Jun 2012 at 14:01 UTC
Subissue of #1469956: [Meta] - Improve Views-powered Geofield proximity searches
query function in geofield_proximity_argument.inc
function query() {
if (!empty($this->argument)) {
$geocoded = geocoder('yahoo', $this->argument);
if ($geocoded) {
$lat = $geocoded->coords[1];
$long = $geocoded->coords[0];
$lat_alias = $this->query->add_field($this->table_alias, $this->definition['field_name'] . '_lat');
$lon_alias = $this->query->add_field($this->table_alias, $this->definition['field_name'] . '_lon');
$this->ensure_my_table();
$field = "$this->table_alias.$this->real_field";
$radius = $this->options['radius']['radius_of_earth'];
$dist = $this->options['radius']['dist'];
$haversine = geofield_haversine($lat, $long, $this->table_alias . '.' . $lat_alias, $this->table_alias . '.' . $lon_alias, $radius);
$this->query->add_where_expression(0, $haversine . ' <= ' . $dist);
}
}
}
Note that $geocoded is hard-coded to accept 'yahoo' as it's geocoder handler.
Comments
Comment #1
phayes commentedYahoo hacked our git repo. Smoking gun.
Comment #2
phayes commentedThis
Should be this:
Comment #3
Brandonian commentedNon-issue, since geofield_proximity is no longer a submodule.