customUserLocationMarker method
Future
customUserLocationMarker(
- GlobalKey<
State< personIconMarkerKey,StatefulWidget> > - GlobalKey<
State< directionIconMarkerKeyStatefulWidget> >
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,
);
}
}