Class ScaleBarPlugin
java.lang.Object
com.trimblemaps.mapsdk.plugins.scalebar.ScaleBarPlugin
Plugin class that shows a scale bar on MapView and changes the scale corresponding to the MapView's scale.
-
Constructor Summary
ConstructorsConstructorDescriptionScaleBarPlugin(com.trimblemaps.mapsdk.maps.MapView mapView, com.trimblemaps.mapsdk.maps.TrimbleMapsMap map) -
Method Summary
Modifier and TypeMethodDescriptioncreate(ScaleBarOptions option) Create a scale bar widget on mapView.booleanReturns true if the scale plugin is currently enabled and visible.voidsetEnabled(boolean enabled) Toggles the scale plugin state.
-
Constructor Details
-
ScaleBarPlugin
public ScaleBarPlugin(@NonNull com.trimblemaps.mapsdk.maps.MapView mapView, @NonNull com.trimblemaps.mapsdk.maps.TrimbleMapsMap map)
-
-
Method Details
-
create
Create a scale bar widget on mapView.- Parameters:
option- The scale bar widget options that used to build scale bar widget.- Returns:
- The created ScaleBarWidget instance.
-
isEnabled
public boolean isEnabled()Returns true if the scale plugin is currently enabled and visible.- Returns:
- true if enabled, false otherwise
-
setEnabled
@UiThread public void setEnabled(boolean enabled) Toggles the scale plugin state.If the scale plugin wasn enabled, a
TrimbleMapsMap.OnCameraMoveListenerwill be added to theMapViewto listen to scale change events to update the state of this plugin. If the plugin was disabled theTrimbleMapsMap.OnCameraMoveListenerwill be removed from the map.
-