Geometry.php in Geocoder 8.2
File
modules/geocoder_geofield/src/Geocoder/Dumper/Geometry.php
View source
<?php
namespace Drupal\geocoder_geofield\Geocoder\Dumper;
use Geocoder\Dumper\Dumper;
use Geocoder\Model\Address;
class Geometry implements Dumper {
private $dumper;
private $geophp;
public function __construct() {
$this->dumper = \Drupal::service('plugin.manager.geocoder.dumper')
->createInstance('geojson');
$this->geophp = \Drupal::service('geofield.geophp');
}
public function dump(Address $address) {
return $this->geophp
->load($this->dumper
->dump($address), 'json');
}
}