# toMap method - PolygonUpdates class - amap_map library - Dart API
API docs for the toMap method from the PolygonUpdates class, for the Dart programming language.

# toMap method

Map <String, dynamic> toMap ()

转换成可以序列化的map

## Implementation

    Map<String, dynamic> toMap() {
      final Map<String, dynamic> updateMap = <String, dynamic>{};

      void addIfNonNull(String fieldName, dynamic value) {
        if (value != null) {
          updateMap[fieldName] = value;
        }
      }

      addIfNonNull('polygonsToAdd', serializeOverlaySet(polygonsToAdd));
      addIfNonNull('polygonsToChange', serializeOverlaySet(polygonsToChange));
      addIfNonNull('polygonIdsToRemove', polygonIdsToRemove.toList());

      return updateMap;
    }