addMarker method
Add a marker to the map
Implementation
Future<String?> addMarker({
required OlaLatLng position,
String? markerId,
bool isClickable = true,
double iconRotation = 0.0,
bool isAnimationEnabled = true,
String? snippet,
String? subSnippet,
bool isInfoWindowDismissOnClick = true,
}) async {
try {
final result = await _channel.invokeMethod('addMarker', {
'markerId': markerId ?? DateTime.now().millisecondsSinceEpoch.toString(),
'latitude': position.latitude,
'longitude': position.longitude,
'isClickable': isClickable,
'iconRotation': iconRotation,
'isAnimationEnabled': isAnimationEnabled,
'snippet': snippet,
'subSnippet': subSnippet,
'isInfoWindowDismissOnClick': isInfoWindowDismissOnClick,
});
return result as String?;
} catch (e) {
debugPrint('Error adding marker: $e');
return null;
}
}