nativeRouteObject

Defines whether to use native route object.

This is an early preview feature. When this option is enabled, some functionality is disabled or not fully supported:

  • Traffic override is not supported. Navigator instantiation throws an exception when both nativeRouteObject and TrafficOverrideOptions.isEnabled are set to true.

  • Subtypes of DirectionsJsonObject (for example, com.mapbox.api.directions.v5.models.DirectionsResponse) do not support the toBuilder() function.

  • The contract of equals() / hashCode() is not met for subtypes of DirectionsJsonObject.

  • Route refresh is not supported.

  • A route parsed using the native route object may not fully match the same route parsed with nativeRouteObject set to false. In particular, coordinates returned by polyline-decoding APIs (such as com.mapbox.navigation.base.utils.DecodeUtils.completeGeometryToPoints) can differ in the trailing digits due to small algorithmic differences between the C++ and Java polyline decoders. The two values describe the same point on the road to well under a millimeter, but are not guaranteed to be bit-identical; use an epsilon-based comparison rather than exact Double equality.

See the NRO compatibility guide for the full list of considerations before enabling this option.