Searches for a layer with the given name, passes it to the optional callback function (if provided), and returns it. This will search both polygon and marker layers at once.

Parameters:

Returns: A promise that resolves to layer (object): The layer matching name, or null if no layer matches name.

Code Sample