requestDirections method

void requestDirections({
  1. String? poiFromIdentifier,
  2. String? poiToIdentifier,
  3. AccessibilityMode? accessibilityMode,
})

Starts directions from an origin POI to a destination POI. If poiFromIdentifier is not specified and the user's position is available, it will be set as the origin automatically. You can optionally specify the desired AccessibilityMode to calculate the route.

Note: If MapView is not being used, consider using SitumSdk.requestDirections instead.

Implementation

void requestDirections({
  String? poiFromIdentifier,
  String? poiToIdentifier,
  AccessibilityMode? accessibilityMode,
}) async {
  dynamic message = {};
  if (poiFromIdentifier != null) {
    message["navigationFrom"] = "'$poiFromIdentifier'";
  }
  if (poiToIdentifier != null) {
    message["navigationTo"] = "'$poiToIdentifier'";
  }
  if (accessibilityMode != null) {
    message["routeType"] = "'${accessibilityMode.name}'";
  }
  _sendMessage(WV_MESSAGE_DIRECTIONS_START, message);
}