mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-12-06 23:08:36 +01:00
Rework element id generation.
This commit is contained in:
@@ -30,20 +30,9 @@ class AbstractVectorMapper extends AbstractTypeMapper
|
||||
*/
|
||||
protected static $modelClass = 'Netzmacht\Contao\Leaflet\Model\VectorModel';
|
||||
|
||||
protected function initialize()
|
||||
{
|
||||
parent::initialize();
|
||||
|
||||
// $this
|
||||
// ->addOptions('stroke', 'weight', 'opacity', 'clickable', 'className')
|
||||
// ->addConditionalOption('color')
|
||||
// ->addConditionalOption('lineCap')
|
||||
// ->addConditionalOption('lineJoin')
|
||||
// ->addConditionalOption('dashArray')
|
||||
// ->addConditionalOptions('fill', array('fill', 'fillColor', 'fillOpacity'))
|
||||
// ;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function build(
|
||||
Definition $definition,
|
||||
\Model $model,
|
||||
|
||||
@@ -40,8 +40,12 @@ class RectangleMapper extends AbstractVectorMapper
|
||||
parent::initialize();
|
||||
}
|
||||
|
||||
protected function buildConstructArguments(\Model $model, DefinitionMapper $mapper, LatLngBounds $bounds = null)
|
||||
{
|
||||
protected function buildConstructArguments(
|
||||
\Model $model,
|
||||
DefinitionMapper $mapper,
|
||||
LatLngBounds $bounds = null,
|
||||
$elementId = null
|
||||
) {
|
||||
$latLngs = array_map(
|
||||
function($latLng) {
|
||||
return LatLng::fromString($latLng);
|
||||
@@ -49,7 +53,7 @@ class RectangleMapper extends AbstractVectorMapper
|
||||
deserialize($model->bounds, true)
|
||||
);
|
||||
|
||||
$arguments = parent::buildConstructArguments($model, $mapper, $bounds);
|
||||
$arguments = parent::buildConstructArguments($model, $mapper, $bounds, $elementId);
|
||||
$arguments[] = new LatLngBounds($latLngs[0], $latLngs[1]);
|
||||
|
||||
return $arguments;
|
||||
|
||||
Reference in New Issue
Block a user