toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> json = <String, dynamic>{};
  if (image != null) {
    json['image'] = image;
  }
  json['polylineInnerColor'] = polylineInnerColor.toRgba();
  json['polylineOuterColor'] = polylineOuterColor.toRgba();
  json['polygonFillColor'] = polygonFillColor.toRgba();
  json['labelTextColor'] = labelTextColor.toRgba();
  json['polylineInnerSize'] = polylineInnerSize;
  json['polylineOuterSize'] = polylineOuterSize;
  json['labelTextSize'] = labelTextSize;
  json['imageSize'] = imageSize;
  int labelingModePacked = 0;
  for (final MarkerLabelingMode mode in labelingMode) {
    labelingModePacked |= mode.id;
  }
  json['labelingMode'] = labelingModePacked;
  if (imagePointer != null) {
    json['imagePointer'] = imagePointer;
  }
  if (imagePointerSize != null) {
    json['imagePointerSize'] = imagePointerSize;
  }
  json['hashCode'] = image.hashCode ^
      polylineInnerColor.hashCode ^
      polylineOuterColor.hashCode ^
      polygonFillColor.hashCode ^
      labelTextColor.hashCode ^
      polylineInnerSize.hashCode ^
      polylineOuterSize.hashCode ^
      labelTextSize.hashCode ^
      imageSize.hashCode ^
      labelingMode.hashCode ^
      imagePointer.hashCode ^
      imagePointerSize.hashCode;
  return json;
}