forked from Snck3rs/contao-leaflet-maps
Rework element id generation.
This commit is contained in:
@@ -68,9 +68,11 @@ class GroupLayerMapper extends AbstractLayerMapper
|
||||
|
||||
if ($collection) {
|
||||
foreach ($collection as $layerModel) {
|
||||
/** @var Layer $layer */
|
||||
$layer = $mapper->handle($layerModel);
|
||||
$definition->addLayer($layer);
|
||||
|
||||
if ($layer instanceof Layer) {
|
||||
$definition->addLayer($layer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,8 +65,12 @@ class ProviderLayerMapper extends AbstractLayerMapper
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function build(Definition $definition, \Model $model, DefinitionMapper $builder, LatLngBounds $bounds = null)
|
||||
{
|
||||
protected function build(
|
||||
Definition $definition,
|
||||
\Model $model,
|
||||
DefinitionMapper $builder,
|
||||
LatLngBounds $bounds = null
|
||||
) {
|
||||
if (!empty($this->providers[$model->tile_provider]['options'])) {
|
||||
$this->applyOptions(
|
||||
$this->providers[$model->tile_provider]['options'],
|
||||
@@ -79,8 +83,12 @@ class ProviderLayerMapper extends AbstractLayerMapper
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function buildConstructArguments(\Model $model, DefinitionMapper $mapper, LatLngBounds $bounds = null)
|
||||
{
|
||||
protected function buildConstructArguments(
|
||||
\Model $model,
|
||||
DefinitionMapper $mapper,
|
||||
LatLngBounds $bounds = null,
|
||||
$elementId = null
|
||||
) {
|
||||
return array(
|
||||
$model->alias ?: ('layer_' . $model->id),
|
||||
$model->tile_provider,
|
||||
|
||||
Reference in New Issue
Block a user