updatePolygon method
Implementation
Future<void> updatePolygon({
required String polygonId,
List<OlaLatLng>? points,
String? color,
String? borderColor,
double? borderWidth,
String? borderLineType,
}) async {
try {
final args = <String, dynamic>{'polygonId': polygonId};
if (points != null) {
args['points'] = points.map((p) => p.toJson()).toList();
}
if (color != null) args['color'] = color;
if (borderColor != null) args['borderColor'] = borderColor;
if (borderWidth != null) args['borderWidth'] = borderWidth;
if (borderLineType != null) args['borderLineType'] = borderLineType;
await _invoke('updatePolygon', args);
} catch (e) {
debugPrint('Error updating polygon: $e');
}
}