from static method

MapMarkerIconModel? from(
  1. dynamic value
)

Creates a marker icon model from an Ensemble icon payload.

Implementation

static MapMarkerIconModel? from(dynamic value) {
  IconModel? iconModel = Utils.getIcon(value);
  if (iconModel != null && value is Map) {
    return MapMarkerIconModel(iconModel.icon,
        library: iconModel.library,
        size: iconModel.size ?? defaultSize,
        color: iconModel.color,
        iconPadding: Utils.getInt(value["iconPadding"], fallback: 4),
        padding: Utils.getInt(value["padding"], fallback: 4),
        iconBackgroundColor: Utils.getColor(value["iconBackgroundColor"]),
        backgroundColor: Utils.getColor(value["backgroundColor"]));
  }
  return null;
}