getLayers function

Gets a list of layer definitions