Check if attached to a map before drawing operations. Fix #14