mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-12-02 13:03:43 +01:00
92 lines
1.8 KiB
PHP
92 lines
1.8 KiB
PHP
<?php
|
|
|
|
/**
|
|
* @package dev
|
|
* @author David Molineus <david.molineus@netzmacht.de>
|
|
* @copyright 2015 netzmacht creative David Molineus
|
|
* @license LGPL 3.0
|
|
* @filesource
|
|
*
|
|
*/
|
|
|
|
namespace Netzmacht\Contao\Leaflet\Event;
|
|
|
|
use Netzmacht\LeafletPHP\Definition;
|
|
use Netzmacht\LeafletPHP\Definition\GeoJson\GeoJsonObject;
|
|
use Symfony\Component\EventDispatcher\Event;
|
|
|
|
/**
|
|
* Class ConvertToGeoJsonEvent is emitted when the DefinitionMapper converts a definition to a geo json feature.
|
|
*
|
|
* @package Netzmacht\Contao\Leaflet\Event
|
|
*/
|
|
class ConvertToGeoJsonEvent extends Event
|
|
{
|
|
const NAME = 'leaflet.mapper.convert-to-geojson';
|
|
|
|
/**
|
|
* The definition.
|
|
*
|
|
* @var Definition
|
|
*/
|
|
private $definition;
|
|
|
|
/**
|
|
* The GeoJSON object.
|
|
*
|
|
* @var GeoJsonObject
|
|
*/
|
|
private $geoJson;
|
|
|
|
/**
|
|
* The definition model.
|
|
*
|
|
* @var mixed
|
|
*/
|
|
private $model;
|
|
|
|
/**
|
|
* Construct.
|
|
*
|
|
* @param Definition $definition The definition.
|
|
* @param GeoJsonObject $geoJson The GeoJSON object.
|
|
* @param mixed $model The corresponding model. Usually a \Model but could be everything.
|
|
*/
|
|
public function __construct(Definition $definition, GeoJsonObject $geoJson, $model)
|
|
{
|
|
$this->definition = $definition;
|
|
$this->geoJson = $geoJson;
|
|
$this->model = $model;
|
|
}
|
|
|
|
/**
|
|
* Get the definition.
|
|
*
|
|
* @return Definition
|
|
*/
|
|
public function getDefinition()
|
|
{
|
|
return $this->definition;
|
|
}
|
|
|
|
/**
|
|
* Get the geoJson representation.
|
|
*
|
|
* @return GeoJsonObject
|
|
*/
|
|
public function getGeoJson()
|
|
{
|
|
return $this->geoJson;
|
|
}
|
|
|
|
/**
|
|
* Get the model.
|
|
*
|
|
* @return mixed
|
|
*/
|
|
public function getModel()
|
|
{
|
|
return $this->model;
|
|
}
|
|
}
|