nativeRouteObject

Parameters

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.

  • equals() between a route object parsed with the native route object and one parsed with nativeRouteObject set to false throws IllegalArgumentException instead of returning false. Among native route objects, equals() and hashCode() are based on the route content.

  • 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.