forked from Snck3rs/contao-leaflet-maps
Fix circles.
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user