diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/MapItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/MapItem.php
index 26cdc41..3e21dc1 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/MapItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/MapItem.php
@@ -27,10 +27,9 @@ class MapItem extends FieldItemBase {
    * {@inheritdoc}
    */
   public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
-    $properties['value'] = DataDefinition::create('string')
-      ->setLabel(t('Serialized values'));
-
-    return $properties;
+    // The properties are dynamic and can not be defined statically. However, we
+    // allow setting some definitions on the field definition if they are known.
+    return $field_definition->getSetting('property_definitions') ?: array();
   }
 
   /**
@@ -51,6 +50,15 @@ public static function schema(FieldStorageDefinitionInterface $field_definition)
   /**
    * {@inheritdoc}
    */
+  public function toArray() {
+    // The default implementation of toArray() only returns known properties.
+    // For a map, return everything as the properties are not pre-defined.
+    return $this->getValue();
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function setValue($values, $notify = TRUE) {
     $this->values = array();
     if (!isset($values)) {
