updatePolygon method
Update polygon properties
Implementation
Future<void> updatePolygon({
required String polygonId,
List<OlaLatLng>? points,
String? color,
}) async {
try {
final args = <String, dynamic>{'polygonId': polygonId};
if (points != null) {
args['points'] = points.map((p) => {'latitude': p.latitude, 'longitude': p.longitude}).toList();
}
if (color != null) {
args['color'] = color;
}
await _channel.invokeMethod('updatePolygon', args);
} catch (e) {
debugPrint('Error updating polygon: $e');
}
}