toJson method
Implementation
@override
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
void addIfPresent(String fieldName, dynamic value) {
if (value != null) {
json[fieldName] = value;
}
}
addIfPresent('heatmap-radius', heatmapRadius);
addIfPresent('heatmap-weight', heatmapWeight);
addIfPresent('heatmap-intensity', heatmapIntensity);
addIfPresent('heatmap-color', heatmapColor);
addIfPresent('heatmap-opacity', heatmapOpacity);
addIfPresent('visibility', visibility);
return json;
}