setIconMarker method

  1. @override
Future<void> setIconMarker(
  1. GeoPoint point,
  2. MarkerIcon markerIcon
)

setIconMarker this method change marker icon , marker should be already exist in the map or it will throw exception that marker not exist

point : (geoPoint) geoPoint that want to change Icon

markerIcon : (MarkerIcon) the new icon marker that will replace old icon

Implementation

@override
Future<void> setIconMarker(GeoPoint point, MarkerIcon markerIcon) async {
  osmWebFlutterState.widget.dynamicMarkerWidgetNotifier.value = markerIcon;
  await Future.delayed(duration, () async {
    final icon = await capturePng(osmWebFlutterState.dynamicMarkerKey!);
    final jsP = point.toGeoJS();
    await interop.modifyMarker(mapIdMixin, jsP, icon.convertToString());
  });
}