getLineLatLngs method

List<LatLng> getLineLatLngs(
  1. Line line
)

Retrieves the current position of the line. This may be different from the value of line.options.geometry if the line is draggable. In that case this method provides the line's actual position, and line.options.geometry the last programmatically set position. An Exception is thrown if the Line has no geometry set.

Implementation

List<LatLng> getLineLatLngs(Line line) {
  if (line.options.geometry == null) {
    throw ArgumentError(
      "Line geometry is null. Cannot determine position.",
    );
  }

  return line.options.geometry!;
}