changePolyline method

  1. @override
Future<void> changePolyline(
  1. String shapeId,
  2. WebShapePoint point,
  3. String styleId
)
override

Implementation

@override
Future<void> changePolyline(
    String shapeId, WebShapePoint point, String styleId) async {
  final style = manager._polylineStyles[styleId]![0];
  final bodyOptions = _webPolyline[shapeId]!.option;
  final strokeOptions = _webPolyline[shapeId]!.strokeOption;

  strokeOptions?.strokeColor = _getColorCode(style.strokeColor);
  bodyOptions.strokeColor = _getColorCode(style.color);
  strokeOptions?.strokeWeight = style.lineWidth * .5 + style.strokeWidth * .5;
  bodyOptions.strokeWeight = style.lineWidth * .5;

  _webPolyline[shapeId]!.element.setOptions(bodyOptions);
  _webPolyline[shapeId]!.strokeElement?.setOptions(strokeOptions!);
  _webPolyline[shapeId]!.option = bodyOptions;
  _webPolyline[shapeId]!.strokeOption = strokeOptions;
}