customUserLocationMarker method

Future customUserLocationMarker(
  1. GlobalKey<State<StatefulWidget>> personIconMarkerKey,
  2. GlobalKey<State<StatefulWidget>> directionIconMarkerKey
)

Implementation

Future customUserLocationMarker(
  GlobalKey<State<StatefulWidget>> personIconMarkerKey,
  GlobalKey<State<StatefulWidget>> directionIconMarkerKey,
) async {
  if (personIconMarkerKey.currentContext != null) {
    final iconPNG = (await capturePng(personIconMarkerKey)).convertToString();
    final size = personIconMarkerKey.toSizeJS();
    interop.setUserLocationIconMarker(mapIdMixin.toJS, iconPNG, size);
  }
  if (directionIconMarkerKey.currentContext != null) {
    final iconPNG =
        (await capturePng(directionIconMarkerKey)).convertToString();
    final size = directionIconMarkerKey.toSizeJS();
    interop.setUserLocationDirectionIconMarker(
      mapIdMixin.toJS,
      iconPNG.toJS,
      size,
    );
  }
}