docs: private double adjustScaleBarLength(double length) {
  		long pow = 0;
  		boolean feet = false;
  		if (unitsOfMeasure == UnitsOfMeasure.imperial) {
  			if (length >= GeoConstants.METERS_PER_STATUTE_MILE / 5)
  				length = length / GeoConstants.METERS_PER_STATUTE_MILE;
  			else {
  				length = length * GeoConstants.FEET_PER_METER;
  				feet = true;
  			}
  		} else if (unitsOfMeasure == UnitsOfMeasure.nautical) {
  			if (length >= GeoConstants.METERS_PER_NAUTICAL_MILE / 5)
  				length = length / GeoConstants.METERS_PER_NAUTICAL_MILE;
  			else {
  				length = length * GeoConstants.FEET_PER_METER;
  				feet = true;
  			}
  		}
  
  		while (length >= 10) {
  			pow++;
  			length /= 10;
  		}
  		while (length < 1 && length > 0) {
  			pow--;
  			length *= 10;
  		}
  
  		if (length < 2) {
  			length = 1;
  		} else if (length < 5) {
  			length = 2;
  		} else {
  			length = 5;
  		}
  		if (feet)
  			length = length / GeoConstants.FEET_PER_METER;
  		else if (unitsOfMeasure == UnitsOfMeasure.imperial)
  			length = length * GeoConstants.METERS_PER_STATUTE_MILE;
  		else if (unitsOfMeasure == UnitsOfMeasure.nautical)
  			length = length * GeoConstants.METERS_PER_NAUTICAL_MILE;
  		length *= Math.pow(10, pow);
  		return length;
  	}