public function encodeControlLayers(Layers $layers, Encoder $encoder)
    {
        return sprintf(
            '%s = L.control.layers(%s, %s, %s);',
            $encoder->encodeReference($layers),
            $this->encodeLayersInformation($layers->getBaseLayers(), $encoder),
            $this->encodeLayersInformation($layers->getOverlays(), $encoder),
            $encoder->encodeValue($layers->getOptions())
        );
    }