def getClosestZoom(self, resolution, unit='meters'):
        """
        Return the closest zoom level for a given resolution
        Parameters:
            resolution -- max. resolution
            unit -- unit for output (default='meters')
        """
        lo, hi = self._getZoomLevelRange(resolution, unit)
        if lo == 0:
            return lo
        if hi == len(self.RESOLUTIONS):
            return hi - 1
        before = self.RESOLUTIONS[lo - 1]
        if abs(self.RESOLUTIONS[lo] - resolution) < abs(before - resolution):
            return lo
        return lo - 1