updatePoints method

void updatePoints(
  1. Key key,
  2. List<LatLng> newPoints, {
  3. bool merge = false,
})

Implementation

void updatePoints(Key key, List<LatLng> newPoints, {bool merge = false}) {
  final old = findByKey(key);
  if (old == null) {
    debugPrint(
        'Warning: Attempted to update points of non-existent polyline with key: $key');
    return;
  }

  final newPolyline = old.copyWith(points: List.of(newPoints));
  update(key, newPolyline, merge: merge);

  _options.onSpatialUpdate?.call(newPolyline, old);
}