toText method

  1. @override
String toText({
  1. String delimiter = ',',
  2. int? decimals,
  3. bool compactNums = true,
  4. bool swapXY = false,
})
override

Returns coordinate values as a string separated by delimiter.

Use decimals to set a number of decimals (not applied if no decimals).

If compactNums is true, any ".0" postfixes of number without fraction digits are stripped.

Set swapXY to true to print y (or latitude) before x (or longitude).

A sample with default parameters (for a 2D bounding box): 10.1,10.1,20.2,20.2

Implementation

@override
String toText({
  String delimiter = ',',
  int? decimals,
  bool compactNums = true,
  bool swapXY = false,
}) {
  final buf = StringBuffer();
  Box.writeValues(
    this,
    buf,
    delimiter: delimiter,
    decimals: decimals,
    compactNums: compactNums,
    swapXY: swapXY,
  );
  return buf.toString();
}