-
public class ScaleBarPluginPlugin class that shows a scale bar on MapView and changes the scale corresponding to the MapView's scale.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanenabled
-
Constructor Summary
Constructors Constructor Description ScaleBarPlugin(MapView mapView, MapLibreMap maplibreMap)
-
Method Summary
Modifier and Type Method Description voidsetEnabled(boolean enabled)Toggles the scale plugin state. ScaleBarWidgetcreate(@NonNull() ScaleBarOptions option)Create a scale bar widget on mapView. booleanisEnabled()Returns true if the scale plugin is currently enabled and visible. -
-
Method Detail
-
setEnabled
@UiThread() void setEnabled(boolean enabled)
Toggles the scale plugin state.
If the scale plugin wasn enabled, a org.maplibre.android.maps.MapLibreMap.OnCameraMoveListener will be added to the MapView to listen to scale change events to update the state of this plugin. If theplugin was disabled the org.maplibre.android.maps.MapLibreMap.OnCameraMoveListener will be removed from the map.
-
create
ScaleBarWidget create(@NonNull() ScaleBarOptions option)
Create a scale bar widget on mapView.
- Parameters:
option- The scale bar widget options that used to build scale bar widget.
-
isEnabled
boolean isEnabled()
Returns true if the scale plugin is currently enabled and visible.
-
-
-
-