Encodes maps into object