toOuterPointsCoordsList method

List<LatLng>? toOuterPointsCoordsList()

Retourne une liste de tous les points extérieurs des polygones. Retourne null si la géométrie n'est pas un polygone ou un multi-polygone.

Implementation

List<LatLng>? toOuterPointsCoordsList() {
  if (geom.type.toLowerCase() == 'polygon' || geom.type.toLowerCase() == 'multipolygon') {
    final List<LatLng> points = [];
    for (final polygon in geom.polygons ?? <GeomPolygon>[]) {
      points.addAll(polygon.outerPoints);
    }
    return points.isEmpty ? null : points;
  }
  return null;
}