forked from Snck3rs/contao-leaflet-maps
Allow to select sub layers in the control.
This commit is contained in:
@@ -81,16 +81,11 @@ class ControlCallbacks extends Callbacks
|
|||||||
*/
|
*/
|
||||||
public function getLayers()
|
public function getLayers()
|
||||||
{
|
{
|
||||||
$options = array();
|
$collection = LayerModel::findAll();
|
||||||
$collection = LayerModel::findBy('pid', '0', array('order' => 'title'));
|
|
||||||
|
|
||||||
if ($collection) {
|
return OptionsBuilder::fromCollection($collection, 'title')
|
||||||
foreach ($collection as $model) {
|
->asTree()
|
||||||
$options[$model->id] = $model->title;
|
->getOptions();
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $options;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user