save/get data from map field type
You should not create your content type programmatically, if there's no special reason. Take a look at any intro like this https://www.youtube.com/watch?v=Nfu6nckjuno - then create a content type and fields with the excellent admin UI.

Serialization to DB is done by the Drupal core.