level = Math.max(Math.min(level, self.options.maxZoom), self.options.minZoom);