Package 

Class ScaleBarPlugin


  • 
    public class ScaleBarPlugin
    
                        

    Plugin 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 boolean enabled
    • Constructor Summary

      Constructors 
      Constructor Description
      ScaleBarPlugin(MapView mapView, MapLibreMap maplibreMap)
    • Method Summary

      Modifier and Type Method Description
      void setEnabled(boolean enabled) Toggles the scale plugin state.
      ScaleBarWidget create(@NonNull() ScaleBarOptions option) Create a scale bar widget on mapView.
      boolean isEnabled() Returns true if the scale plugin is currently enabled and visible.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ScaleBarPlugin

        ScaleBarPlugin(MapView mapView, MapLibreMap maplibreMap)
    • 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.

      • isEnabled

         boolean isEnabled()

        Returns true if the scale plugin is currently enabled and visible.