public static void setMapScaleBar ( MapView mapView , DistanceUnitAdapter primaryDistanceUnitAdapter , DistanceUnitAdapter secondaryDistanceUnitAdapter ) { if ( null == primaryDistanceUnitAdapter && null == secondaryDistanceUnitAdapter ) { mapView . setMapScaleBar ( null ) ; } else { MapScaleBar scaleBar = mapView . getMapScaleBar ( ) ; if ( scaleBar == null ) { scaleBar = new DefaultMapScaleBar ( mapView . getModel ( ) . mapViewPosition , mapView . getModel ( ) . mapViewDimension , AndroidGraphicFactory . INSTANCE , mapView . getModel ( ) . displayModel ) ; mapView . setMapScaleBar ( scaleBar ) ; } if ( scaleBar instanceof DefaultMapScaleBar ) { if ( null != secondaryDistanceUnitAdapter ) { ( ( DefaultMapScaleBar ) scaleBar ) . setScaleBarMode ( DefaultMapScaleBar . ScaleBarMode . BOTH ) ; ( ( DefaultMapScaleBar ) scaleBar ) . setSecondaryDistanceUnitAdapter ( secondaryDistanceUnitAdapter ) ; } else { ( ( DefaultMapScaleBar ) scaleBar ) . setScaleBarMode ( DefaultMapScaleBar . ScaleBarMode . SINGLE ) ; } } scaleBar . setDistanceUnitAdapter ( primaryDistanceUnitAdapter ) ; } }
Sets the scale bar on a map view with implicit arguments . If no distance unit adapters are supplied there will be no scalebar with only a primary adapter supplied the mode will be single with two adapters supplied the mode will be dual .