updateMarker method
Update an existing marker Update an existing marker
Implementation
Future<void> updateMarker({
required String markerId,
OlaLatLng? position,
double? iconRotation,
String? iconAnchor,
String? iconPath,
List<double>? iconOffset,
double? iconSize,
String? snippet,
String? subSnippet,
}) async {
try {
final args = <String, dynamic>{'markerId': markerId};
if (position != null) {
args['latitude'] = position.latitude;
args['longitude'] = position.longitude;
}
if (iconRotation != null) {
args['iconRotation'] = iconRotation;
}
if (iconAnchor != null) {
args['iconAnchor'] = iconAnchor;
}
if (iconPath != null) {
args['iconPath'] = iconPath;
}
if (iconOffset != null) {
args['iconOffset'] = iconOffset;
}
if (iconSize != null) {
args['iconSize'] = iconSize;
}
if (snippet != null) {
args['snippet'] = snippet;
}
if (subSnippet != null) {
args['subSnippet'] = subSnippet;
}
await _channel.invokeMethod('updateMarker', args);
} catch (e) {
debugPrint('Error updating marker: $e');
}
}