Class RoutePlugin

java.lang.Object
com.trimblemaps.mapsdk.plugins.route.RoutePlugin

@UiThread public final class RoutePlugin extends Object
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 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 to
      trimbleMapsMap - 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 to
      trimbleMapsMap - the TrimbleMapsMap to apply route plugin with
      belowLayer - 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 to
      trimbleMapsMap - the TrimbleMapsMap to apply route plugin with
      belowLayer - the layer id where you'd like the route to display below
      stopStartIconDrawable - 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 stops
      stopIconTextColor - 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

      public void updateReadablesTable(HashMap<Integer,String[]> readablesTable)
    • addRoute

      public void addRoute(Route route)
    • onMapClick

      public List<com.trimblemaps.geojson.Feature> onMapClick(com.trimblemaps.mapsdk.geometry.LatLng latLng)
    • onMapClick

      public List<com.trimblemaps.geojson.Feature> onMapClick(android.graphics.PointF screenPoint)
    • getClusterChildren

      public List<com.trimblemaps.geojson.Feature> getClusterChildren(com.trimblemaps.geojson.Feature feature)
    • getClusterChildren

      public List<com.trimblemaps.geojson.Feature> getClusterChildren(List<com.trimblemaps.geojson.Feature> features)
    • addRouteSelectedListener

      public void addRouteSelectedListener(RouteSelectedListener routeSelectedListener)
    • frameRoute

      public void frameRoute(String id)
    • frameRoute

      public void frameRoute(String id, int padding)
    • 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

      public void frameRoutes(String[] ids)
    • frameRoutes

      public void frameRoutes(String[] ids, int padding)
    • frameRoutes

      public void frameRoutes(String[] ids, int paddingLeft, int paddingTop, int paddingRight, int paddingBottom)
    • clearRoutes

      public void clearRoutes()
    • removeBubble

      public void removeBubble()
    • removeRoute

      public void removeRoute(String id)
    • getRoute

      public Route getRoute(String id)
    • 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