---
layout: api
title: "v3.3.1 JavaScript Library: L.LayerGroup"
categories: api
version: v3.3.1
permalink: /api/v3.3.1/l-layergroup/
---
<h2 id="layergroup">LayerGroup</h2>

<p>Used to group several layers and handle them as one. If you add it to the map, any layers added or removed from the group will be added/removed on the map as well. Implements <a href="/mapbox.js/api/v3.3.1/l-ilayer">ILayer</a> interface.</p>

<pre><code class="javascript">L.layerGroup([marker1, marker2])
	.addLayer(polyline)
	