Class NavigationMapRoute.Builder
-
- All Implemented Interfaces:
public class NavigationMapRoute.BuilderThe Builder of NavigationMapRoute.
-
-
Constructor Summary
Constructors Constructor Description NavigationMapRoute.Builder(MapView mapView, TrimbleMapsMap trimbleMapsMap, LifecycleOwner lifecycleOwner)Instantiates a new Builder. NavigationMapRoute.Builder(MapSurface mapSurface, TrimbleMapsMap trimbleMapsMap, LifecycleOwner lifecycleOwner)
-
Method Summary
Modifier and Type Method Description NavigationMapRoute.BuilderwithTrimbleMapsNavigation(@Nullable() TrimbleMapsNavigation navigation)An instance of the TrimbleMapsNavigation object. NavigationMapRoute.BuilderwithVanishRouteLineEnabled(boolean enabled)NavigationMapRoute.BuilderwithStyle(@StyleRes() int styleRes)Style resource with custom route colors, scale, etc. NavigationMapRoute.BuilderwithBelowLayer(@Nullable() String belowLayer)BelowLayer optionally pass in a layer id to place the route line below NavigationMapRoute.BuilderwithRouteStyleDescriptors(List<RouteStyleDescriptor> routeStyleDescriptors)RouteStyleDescriptors can be used for programmatically styling the route lines. NavigationMapRoute.BuilderwithVanishingRouteLineUpdateIntervalNano(long vanishingRouteLineUpdateIntervalNano)Set minimum update interval (in nanoseconds) of the vanishing point when enabled. NavigationMapRoute.BuilderwithRouteClickPadding(float padding)Indicates the size of the bounding box used to determine which route line was clicked. NavigationMapRoute.BuilderwithRouteLineInitializedCallback(@Nullable() MapRouteLineInitializedCallback routeLineInitializedCallback)Indicate that the route line layer has been added to the current style NavigationMapRoute.BuilderwithSourceMaxZoom(int sourceMaxZoom)Maximum zoom level at which to route line tiles are created and over-zoomed otherwise (higher means greater detail at high zoom levels). NavigationMapRoute.BuilderwithSourceTolerance(float sourceTolerance)Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance) for the GeoJsonSources created to display the route line. NavigationMapRoutebuild()Build an instance of NavigationMapRoute
-
-
-
Constructor Detail
-
NavigationMapRoute.Builder
NavigationMapRoute.Builder(MapView mapView, TrimbleMapsMap trimbleMapsMap, LifecycleOwner lifecycleOwner)
Instantiates a new Builder.- Parameters:
mapView- the MapView to apply the route totrimbleMapsMap- the TrimbleMapsMap to apply route withlifecycleOwner- provides lifecycle for the component
-
NavigationMapRoute.Builder
NavigationMapRoute.Builder(MapSurface mapSurface, TrimbleMapsMap trimbleMapsMap, LifecycleOwner lifecycleOwner)
-
-
Method Detail
-
withTrimbleMapsNavigation
@NonNull() NavigationMapRoute.Builder withTrimbleMapsNavigation(@Nullable() TrimbleMapsNavigation navigation)
An instance of the TrimbleMapsNavigation object. Default is null that means your route won't consider rerouting during a navigation session.
-
withVanishRouteLineEnabled
@NonNull() NavigationMapRoute.Builder withVanishRouteLineEnabled(boolean enabled)
- Parameters:
enabled- determines if the route line should vanish behind the puck during navigation.
-
withStyle
@NonNull() NavigationMapRoute.Builder withStyle(@StyleRes() int styleRes)
Style resource with custom route colors, scale, etc. Default value is R.style.NavigationMapRoute
-
withBelowLayer
@NonNull() NavigationMapRoute.Builder withBelowLayer(@Nullable() String belowLayer)
BelowLayer optionally pass in a layer id to place the route line below
-
withRouteStyleDescriptors
@NonNull() NavigationMapRoute.Builder withRouteStyleDescriptors(List<RouteStyleDescriptor> routeStyleDescriptors)
RouteStyleDescriptors can be used for programmatically styling the route lines.
-
withVanishingRouteLineUpdateIntervalNano
@NonNull() NavigationMapRoute.Builder withVanishingRouteLineUpdateIntervalNano(long vanishingRouteLineUpdateIntervalNano)
Set minimum update interval (in nanoseconds) of the vanishing point when enabled.
Defaults to DEFAULT_VANISHING_POINT_MIN_UPDATE_INTERVAL_NANO. Decreasing this number will improve the smoothness of updates but impact the performance.
-
withRouteClickPadding
@NonNull() NavigationMapRoute.Builder withRouteClickPadding(float padding)
Indicates the size of the bounding box used to determine which route line was clicked. Upon a map click an attempt will be made to find a route line intersecting the bounding box. This is used to select alternative route lines on the map. Larger values result in a larger bounding box requiring less accuracy on the part of the user. You should use the device's screen density in determining what value to use here rather than a single value for all devices.
- Parameters:
padding- value in pixels
-
withRouteLineInitializedCallback
@NonNull() NavigationMapRoute.Builder withRouteLineInitializedCallback(@Nullable() MapRouteLineInitializedCallback routeLineInitializedCallback)
Indicate that the route line layer has been added to the current style
-
withSourceMaxZoom
@NonNull() NavigationMapRoute.Builder withSourceMaxZoom(int sourceMaxZoom)
Maximum zoom level at which to route line tiles are created and over-zoomed otherwise (higher means greater detail at high zoom levels). Defaults to 16.
-
withSourceTolerance
@NonNull() NavigationMapRoute.Builder withSourceTolerance(float sourceTolerance)
Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance) for the GeoJsonSources created to display the route line. Defaults to 0.375.
-
build
@NonNull() NavigationMapRoute build()
Build an instance of NavigationMapRoute
-
-