from static method

GeoBounds<GeoPoint> from(
  1. Iterable<num> coords, {
  2. int? offset,
  3. int? length,
})

With coords containing min and max sets of lon, lat and optional elev.

There should be either 4 or 6 items on coords.

Implementation

static GeoBounds from(
  Iterable<num> coords, {
  int? offset,
  int? length,
}) {
  CoordinateFactory.checkCoords(4, coords, offset: offset, length: length);
  final start = offset ?? 0;
  final len = length ?? coords.length;
  return len >= 6
      ? GeoBounds.bboxLonLatElev(
          coords.elementAt(start + 0).toDouble(),
          coords.elementAt(start + 1).toDouble(),
          coords.elementAt(start + 2).toDouble(),
          coords.elementAt(start + 3).toDouble(),
          coords.elementAt(start + 4).toDouble(),
          coords.elementAt(start + 5).toDouble(),
        )
      : GeoBounds.bboxLonLat(
          coords.elementAt(start + 0).toDouble(),
          coords.elementAt(start + 1).toDouble(),
          coords.elementAt(start + 2).toDouble(),
          coords.elementAt(start + 3).toDouble(),
        );
}