Create a map from an array of similar objects