GeoProximityField.php in Geolocation Field 8.3
File
modules/geolocation_geometry/src/Plugin/views/field/GeoProximityField.php
View source
<?php
namespace Drupal\geolocation_geometry\Plugin\views\field;
use Drupal\geolocation\Plugin\views\field\ProximityField;
use Drupal\geolocation_geometry\GeometryProximityTrait;
class GeoProximityField extends ProximityField {
use GeometryProximityTrait;
public function query() {
$query = $this->query;
$center = $this
->getCenter();
if (empty($center)) {
return;
}
$expression = self::getGeometryProximityQueryFragment($this
->ensureMyTable(), $this->realField, $center['lat'], $center['lng']);
$this->field_alias = $query
->addField(NULL, $expression, substr($this
->placeholder(), 1));
}
}