LayerGroup Class

class BeastBytes\Yii\Leaflet\Layers\Other\LayerGroup

Represents a group of layers in order to handle them as a single entity

If the layer group is added to the map, any layers added to or removed from the group will also be added/removed on the map

__construct(array $layers = [], array $options = [])

Create a new LayerGroup instance

Parameters:
  • $layers (list<Layer>.) – Layers

  • $options (array<string, mixed>.) – LayerGroup options

Returns:

A new LayerGroup instance

Return type:

LayerGroup

Inherited from Layer

BeastBytes\Yii\Leaflet\Layers\Other\LayerGroup::popup(string $content, array $options = [])

Binds a popup to the layer

Parameters:
  • $content (string) – The popup content

  • $options (array<string, mixed>.) – Popup options

Returns:

A new instance of LayerGroup with the popup

Return type:

LayerGroup

BeastBytes\Yii\Leaflet\Layers\Other\LayerGroup::tooltip(string $content, array $options = [])

Binds a tooltip to the layer

Parameters:
  • $content (string) – The tooltip content

  • $options (array<string, mixed>.) – Tooltip options

Returns:

A new instance of LayerGroup with the tooltip

Return type:

LayerGroup

Inherited from Component

BeastBytes\Yii\Leaflet\Layers\Other\LayerGroup::addToMap(bool $addToMap)

Whether to add the component to the map

By default, a component is added to the map.

Parameters:
  • $addToMap (bool) – Whether the component is added to the map

Returns:

A new instance of LayerGroup with the addToMap parameter set

Return type:

LayerGroup

BeastBytes\Yii\Leaflet\Layers\Other\LayerGroup::getJsVar()

Returns the JavaScript variable name

Returns:

The JavaScript variable name

Return type:

string

BeastBytes\Yii\Leaflet\Layers\Other\LayerGroup::jsVar(string $jsVar)

Set the JavaScript variable name

Parameters:
  • $jsVar (string) – The JavaScript variable name

Returns:

A new instance of LayerGroup with the JavaScript variable name set

Return type:

LayerGroup