mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-12-06 14:58:42 +01:00
Switch to PSR-4.
This commit is contained in:
56
src/Mapper/Vector/MultiPolygonMapper.php
Normal file
56
src/Mapper/Vector/MultiPolygonMapper.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @copyright 2014-2016 netzmacht David Molineus
|
||||
* @license LGPL 3.0
|
||||
* @filesource
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Mapper\Vector;
|
||||
|
||||
use Netzmacht\Contao\Leaflet\Filter\Filter;
|
||||
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
|
||||
use Netzmacht\LeafletPHP\Definition;
|
||||
use Netzmacht\LeafletPHP\Definition\Vector\Polygon;
|
||||
|
||||
/**
|
||||
* Class MultiPolygonMapper maps the multi polygon database model to its definition.
|
||||
*
|
||||
* @package Netzmacht\Contao\Leaflet\Mapper\Vector
|
||||
*/
|
||||
class MultiPolygonMapper extends MultiPolylineMapper
|
||||
{
|
||||
/**
|
||||
* Class of the definition being created.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $definitionClass = 'Netzmacht\LeafletPHP\Definition\Vector\Polygon';
|
||||
|
||||
/**
|
||||
* Layer type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $type = 'multiPolygon';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function build(
|
||||
Definition $definition,
|
||||
\Model $model,
|
||||
DefinitionMapper $mapper,
|
||||
Filter $filter = null,
|
||||
Definition $parent = null
|
||||
) {
|
||||
parent::build($definition, $model, $mapper, $filter);
|
||||
|
||||
if ($definition instanceof Polygon) {
|
||||
$this->createLatLngs($definition, $model);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user