Support passing events in for map and layers