code: public int getResolutionIndex(double resolution) {
  		double maximumResolution = getMaximumResolution();
  		if (resolution >= maximumResolution) {
  			return 0;
  		}
  		double minimumResolution = getMinimumResolution();
  		if (resolution <= minimumResolution) {
  			return resolutions.size() - 1;
  		}
  
  		for (int i = 0; i < resolutions.size(); i++) {
  			double upper = resolutions.get(i);
  			double lower = resolutions.get(i + 1);
  			if (resolution < upper && resolution >= lower) {
  				if (Math.abs(upper - resolution) >= Math.abs(lower - resolution)) {
  					return i + 1;
  				} else {
  					return i;
  				}
  			}
  		}
  		return 0;
  	}
docs: Get the index for the fixed resolution that is closest to the provided resolution.
  
  @param resolution The resolution to request the closest fixed resolution level for.
  @return Returns the fixed resolution level index.