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 = _webPolylineOption[shapeId]!;
  final strokeOptions = _webPolylineStrokeOption[shapeId];

  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]?.setOptions(bodyOptions);
  _webPolylineStroke[shapeId]?.setOptions(strokeOptions!);
  _webPolylineOption[shapeId] = bodyOptions;
  _webPolylineStrokeOption[shapeId] = strokeOptions;
}