iconFromAssets static method
return an icon from the assets.
Implementation
static Future<MapImageIcon> iconFromAssets(
{required String path,
Point? anchor,
Point? labelOrigin,
Point? origin,
Size? size,
Size? scaledSize}) async{
final String format=path.split('.').last;
final file=await rootBundle.load(path);
var b64=base64Encode(Uint8ClampedList.view(file.buffer));
b64='data:image/$format;base64,$b64';
return MapImageIcon.fromUrl(
url: b64,
anchor: anchor,
labelOrigin: labelOrigin,
origin: origin,
size: size,
scaledSize: scaledSize,
);
}