setBitmapDescriptor method

Future<void> setBitmapDescriptor(
  1. String imagePath
)

setBitmapDescriptor method sets the bitmap descriptor for the icon marker on the map. It takes an imagePath parameter and sets the bitmap descriptor from the given image path. The image is converted to bytes and then set as the bitmap descriptor for the icon marker. The method is asynchronous and returns a Future of void.

Implementation

Future<void> setBitmapDescriptor(String imagePath) async {
  final Uint8List dataBytes =
      await getBytesFromAsset(width: 50, path: imagePath);
  _iconMarker = BitmapDescriptor.fromBytes(dataBytes);
}