You are here

class Geometry in Geocoder 8.3

Same name in this branch
  1. 8.3 modules/geocoder_geofield/src/Geocoder/Dumper/Geometry.php \Drupal\geocoder_geofield\Geocoder\Dumper\Geometry
  2. 8.3 modules/geocoder_geofield/src/Plugin/Geocoder/Dumper/Geometry.php \Drupal\geocoder_geofield\Plugin\Geocoder\Dumper\Geometry
Same name and namespace in other branches
  1. 8.2 modules/geocoder_geofield/src/Geocoder/Dumper/Geometry.php \Drupal\geocoder_geofield\Geocoder\Dumper\Geometry

Dumper.

Hierarchy

  • class \Drupal\geocoder_geofield\Geocoder\Dumper\Geometry implements \Geocoder\Dumper\Dumper

Expanded class hierarchy of Geometry

File

modules/geocoder_geofield/src/Geocoder/Dumper/Geometry.php, line 13

Namespace

Drupal\geocoder_geofield\Geocoder\Dumper
View source
class Geometry implements Dumper {

  /**
   * Dumper.
   *
   * @var \Geocoder\Dumper\Dumper
   */
  private $dumper;

  /**
   * Geophp interface.
   *
   * @var \Drupal\geofield\GeoPHP\GeoPHPInterface
   */
  private $geophp;

  /**
   * {@inheritdoc}
   */
  public function __construct() {
    $this->dumper = \Drupal::service('plugin.manager.geocoder.dumper')
      ->createInstance('geojson');
    $this->geophp = \Drupal::service('geofield.geophp');
  }

  /**
   * {@inheritdoc}
   */
  public function dump(Location $location) {
    return $this->geophp
      ->load($this->dumper
      ->dump($location), 'json');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Geometry::$dumper private property Dumper. 1
Geometry::$geophp private property Geophp interface. 1
Geometry::dump public function 1
Geometry::__construct public function