newFrom method

  1. @override
GeoPoint2m newFrom(
  1. Iterable<num> coords, {
  2. int? offset,
  3. int? length,
})
override

Creates a new point instance of a type compatible with this object.

Values for a new point are given by coords containing num values (that is double or int). By default 0 is used as an offset and length of coords as length specifying values. If both offset and length parameters are given, then those are specifying a segment of values from coords to be used for setting values on a new point.

When newFrom is implemented by the Point class itself or it's descentants then a returned instance must be of the type with same coordinate value members as this object has.

Implementation

@override
GeoPoint2m newFrom(Iterable<num> coords, {int? offset, int? length}) {
  CoordinateFactory.checkCoords(3, coords, offset: offset, length: length);
  return GeoPoint2m.from(coords, offset: offset);
}