toJson method

Map<String, dynamic> toJson()
override

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> json = <String, dynamic>{};

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

  addIfPresent(
      'hillshade-illumination-direction', hillshadeIlluminationDirection);
  addIfPresent('hillshade-illumination-anchor', hillshadeIlluminationAnchor);
  addIfPresent('hillshade-exaggeration', hillshadeExaggeration);
  addIfPresent('hillshade-shadow-color', hillshadeShadowColor);
  addIfPresent('hillshade-highlight-color', hillshadeHighlightColor);
  addIfPresent('hillshade-accent-color', hillshadeAccentColor);
  addIfPresent('visibility', visibility);
  return json;
}