Raster Source LayerID exists method

Three different options I could think of. The layerCount would probably be the most informative (letting you distinguish between ambiguous layer due to unspecified datastore or missing layer) although it isn't the cleanest since you'd have to check for it to be equal to 1 but in the other cases, you'd have to check for the ambiguity again or give the same error message for both ambiguous and non-existing layers.