addLine method
Adds a line to the map, configured using the specified custom options.
Change listeners are notified once the line has been added on the platform side.
The returned Future completes with the added line once listeners have
been notified.
An Exception is thrown if the LineManager is not initialized (style not loaded yet).
Implementation
Future<Line> addLine(LineOptions options, [Map? data]) async {
_ensureManagerInitialized(lineManager);
final effectiveOptions = LineOptions.defaultOptions.copyWith(options);
final line = Line(getRandomString(), effectiveOptions, data);
await lineManager?.add(line);
if (!isDisposed) notifyListeners();
return line;
}