Class RoutePlugin
java.lang.Object
com.trimblemaps.mapsdk.plugins.route.RoutePlugin
The Route Plugin allows you to add Trimble MAPS Routes to the Maps SDK for Android.
Initialize this plugin in the OnMapReadyCallback.onMapReady(TrimbleMapsMap) and provide a valid instance of MapView and TrimbleMapsMap.
Use setVisibility(boolean) to switch state of this plugin to enable or disabled. Use isVisible() to validate if the plugin is active or not.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRoutePlugin(com.trimblemaps.mapsdk.maps.MapView mapView, com.trimblemaps.mapsdk.maps.TrimbleMapsMap trimbleMapsMap) Create a route plugin.RoutePlugin(com.trimblemaps.mapsdk.maps.MapView mapView, com.trimblemaps.mapsdk.maps.TrimbleMapsMap trimbleMapsMap, String belowLayer) Create a route plugin.RoutePlugin(com.trimblemaps.mapsdk.maps.MapView mapView, com.trimblemaps.mapsdk.maps.TrimbleMapsMap trimbleMapsMap, String belowLayer, android.graphics.drawable.Drawable stopStartIconDrawable, android.graphics.drawable.Drawable stopEndIconDrawable, android.graphics.drawable.Drawable stopIconDrawable, int stopIconTextColor) Create a route plugin. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddRouteSelectedListener(RouteSelectedListener routeSelectedListener) voidvoidframeRoute(String id) voidframeRoute(String id, int padding) voidframeRoute(String id, int paddingLeft, int paddingTop, int paddingRight, int paddingBottom) voidvoidframeRoutes(int padding) voidframeRoutes(int paddingLeft, int paddingTop, int paddingRight, int paddingBottom) voidframeRoutes(String[] ids) voidframeRoutes(String[] ids, int padding) voidframeRoutes(String[] ids, int paddingLeft, int paddingTop, int paddingRight, int paddingBottom) List<com.trimblemaps.geojson.Feature> getClusterChildren(com.trimblemaps.geojson.Feature feature) List<com.trimblemaps.geojson.Feature> getClusterChildren(List<com.trimblemaps.geojson.Feature> features) booleanbooleanbooleanbooleanReturns true if the route plugin is currently enabled.List<com.trimblemaps.geojson.Feature> onMapClick(android.graphics.PointF screenPoint) List<com.trimblemaps.geojson.Feature> onMapClick(com.trimblemaps.mapsdk.geometry.LatLng latLng) voidvoidremoveRoute(String id) voidsetClusteringEnabled(boolean enable) voidsetNightMode(boolean isNightMode) voidsetShowRouteBubble(boolean show) voidsetVisibility(boolean visible) Toggles the visibility of the route layers.voidupdateReadablesTable(HashMap<Integer, String[]> readablesTable)
-
Field Details
-
DEFAULT_STOP_ICON_TEXT_COLOR
@ColorInt public static final int DEFAULT_STOP_ICON_TEXT_COLOR- See Also:
-
-
Constructor Details
-
RoutePlugin
public RoutePlugin(@NonNull com.trimblemaps.mapsdk.maps.MapView mapView, @NonNull com.trimblemaps.mapsdk.maps.TrimbleMapsMap trimbleMapsMap) Create a route plugin.- Parameters:
mapView- the MapView to apply the route plugin totrimbleMapsMap- the TrimbleMapsMap to apply route plugin with
-
RoutePlugin
public RoutePlugin(@NonNull com.trimblemaps.mapsdk.maps.MapView mapView, @NonNull com.trimblemaps.mapsdk.maps.TrimbleMapsMap trimbleMapsMap, @Nullable String belowLayer) Create a route plugin.- Parameters:
mapView- the MapView to apply the route plugin totrimbleMapsMap- the TrimbleMapsMap to apply route plugin withbelowLayer- the layer id where you'd like the route to display below
-
RoutePlugin
public RoutePlugin(@NonNull com.trimblemaps.mapsdk.maps.MapView mapView, @NonNull com.trimblemaps.mapsdk.maps.TrimbleMapsMap trimbleMapsMap, @Nullable String belowLayer, @Nullable android.graphics.drawable.Drawable stopStartIconDrawable, @Nullable android.graphics.drawable.Drawable stopEndIconDrawable, @Nullable android.graphics.drawable.Drawable stopIconDrawable, @ColorInt int stopIconTextColor) Create a route plugin.- Parameters:
mapView- the MapView to apply the route plugin totrimbleMapsMap- the TrimbleMapsMap to apply route plugin withbelowLayer- the layer id where you'd like the route to display belowstopStartIconDrawable- custom Drawable to use for the first stop (origin)stopEndIconDrawable- custom Drawable to use for the last stop (destination)stopIconDrawable- custom Drawable to use for the intermediate stopsstopIconTextColor- custom color to use for the stop numbers on the intermediate stop icons
-
-
Method Details
-
setClusteringEnabled
public void setClusteringEnabled(boolean enable) -
getClusteringEnabled
public boolean getClusteringEnabled() -
setShowRouteBubble
public void setShowRouteBubble(boolean show) -
getShowRouteBubble
public boolean getShowRouteBubble() -
setNightMode
public void setNightMode(boolean isNightMode) -
getNightMode
public boolean getNightMode() -
updateReadablesTable
-
addRoute
-
onMapClick
public List<com.trimblemaps.geojson.Feature> onMapClick(com.trimblemaps.mapsdk.geometry.LatLng latLng) -
onMapClick
-
getClusterChildren
public List<com.trimblemaps.geojson.Feature> getClusterChildren(com.trimblemaps.geojson.Feature feature) -
getClusterChildren
-
addRouteSelectedListener
-
frameRoute
-
frameRoute
-
frameRoute
public void frameRoute(String id, int paddingLeft, int paddingTop, int paddingRight, int paddingBottom) -
frameRoutes
public void frameRoutes() -
frameRoutes
public void frameRoutes(int padding) -
frameRoutes
public void frameRoutes(int paddingLeft, int paddingTop, int paddingRight, int paddingBottom) -
frameRoutes
-
frameRoutes
-
frameRoutes
public void frameRoutes(String[] ids, int paddingLeft, int paddingTop, int paddingRight, int paddingBottom) -
clearRoutes
public void clearRoutes() -
removeBubble
public void removeBubble() -
removeRoute
-
getRoute
-
isVisible
public boolean isVisible()Returns true if the route plugin is currently enabled.- Returns:
- true if enabled, false otherwise
-
setVisibility
public void setVisibility(boolean visible) Toggles the visibility of the route layers.- Parameters:
visible- true for visible, false for none
-