updateMarker method

Future<void> updateMarker({
  1. required String markerId,
  2. OlaLatLng? position,
  3. double? iconRotation,
  4. String? iconAnchor,
  5. String? iconPath,
  6. List<double>? iconOffset,
  7. double? iconSize,
  8. String? snippet,
  9. String? subSnippet,
})

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');
  }
}