Fix circles.

This commit is contained in:
David Molineus
2016-10-05 13:35:04 +02:00
parent 1bb9fb4d7a
commit 7d3c053bd1
3 changed files with 4 additions and 4 deletions

View File

@@ -12,6 +12,7 @@
namespace Netzmacht\Contao\Leaflet\Mapper; namespace Netzmacht\Contao\Leaflet\Mapper;
use Netzmacht\LeafletPHP\Definition; use Netzmacht\LeafletPHP\Definition;
use Netzmacht\LeafletPHP\Definition\HasOptions;
/** /**
* Class OptionsBuilder handles the option mapping between the database model and the definition. * Class OptionsBuilder handles the option mapping between the database model and the definition.
@@ -236,7 +237,7 @@ class OptionsBuilder
if (method_exists($definition, $setter)) { if (method_exists($definition, $setter)) {
$definition->$setter($value); $definition->$setter($value);
} else { } elseif ($definition instanceOf HasOptions) {
$definition->setOption($option, $value); $definition->setOption($option, $value);
} }
} }

View File

@@ -14,6 +14,7 @@ namespace Netzmacht\Contao\Leaflet\Mapper\Vector;
use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Filter\Filter;
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
use Netzmacht\LeafletPHP\Definition; use Netzmacht\LeafletPHP\Definition;
use Netzmacht\LeafletPHP\Definition\Vector\CircleMarker;
use Netzmacht\LeafletPHP\Value\LatLng; use Netzmacht\LeafletPHP\Value\LatLng;
use Netzmacht\LeafletPHP\Definition\Vector\Circle; use Netzmacht\LeafletPHP\Definition\Vector\Circle;
@@ -60,7 +61,7 @@ class CircleMapper extends AbstractVectorMapper
) { ) {
parent::build($definition, $model, $mapper, $filter); parent::build($definition, $model, $mapper, $filter);
if ($definition instanceof Circle) { if ($definition instanceof CircleMarker) {
$definition->setLatLng(LatLng::fromString($model->coordinates)); $definition->setLatLng(LatLng::fromString($model->coordinates));
} }
} }

View File

@@ -11,8 +11,6 @@
namespace Netzmacht\Contao\Leaflet\Mapper\Vector; namespace Netzmacht\Contao\Leaflet\Mapper\Vector;
use Netzmacht\LeafletPHP\Definition;
/** /**
* Class CircleMarkerMapper maps the database model to the circle marker definition. * Class CircleMarkerMapper maps the database model to the circle marker definition.
* *