mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-11-30 20:13:49 +01:00
Add reference layer.
This commit is contained in:
@@ -57,6 +57,10 @@ class Layer
|
||||
|
||||
$icon = \Image::getHtml($src, $alt, sprintf('title="%s"', strip_tags($alt)));
|
||||
|
||||
if (!empty($this->layers[$row['type']]['label'])) {
|
||||
$label = $this->layers[$row['type']]['label']($row, $label);
|
||||
}
|
||||
|
||||
return $icon . ' ' . $label;
|
||||
}
|
||||
|
||||
@@ -146,6 +150,15 @@ class Layer
|
||||
return $this->generateButton($row, $href, $label, $title, $icon, $attributes);
|
||||
}
|
||||
|
||||
public function getLayers($dataContainer)
|
||||
{
|
||||
$collection = LayerModel::findBy('id !', $dataContainer->id);
|
||||
|
||||
return OptionsBuilder::fromCollection($collection, 'id', 'title')
|
||||
->asTree()
|
||||
->getOptions();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $row
|
||||
* @param $href
|
||||
|
||||
Reference in New Issue
Block a user