getLayer function

Gets a layer definition