keyByPolygonId function

Map<String, Polygon> keyByPolygonId(
  1. Iterable<Polygon> polylines
)

Implementation

Map<String, Polygon> keyByPolygonId(Iterable<Polygon> polylines) {
  // ignore: unnecessary_null_comparison
  if (polylines == null) {
    return <String, Polygon>{};
  }
  return Map<String, Polygon>.fromEntries(polylines.map((Polygon polyline) =>
      MapEntry<String, Polygon>(polyline.id, polyline.clone())));
}