Check for events before attaching 'ready' listener in map#addLayer.