async getMaxZoom()

in src/tms_service.ts [398:417]


  async getMaxZoom(format = 'vector'): Promise<number | undefined> {
    switch (format) {
      case 'vector': {
        const { sources } = (await this._getVectorStyleJsonInlined()) || { sources: {} };
        return Math.max(
          ...Object.values(sources)
            .map((s) => {
              return s && s instanceof Object && 'maxzoom' in s ? s['maxzoom'] : null;
            })
            .filter((maxzoom): maxzoom is number => Number.isFinite(maxzoom))
        );
      }
      case 'raster': {
        const { maxzoom } = (await this._getRasterStyleJson()) || {};
        return maxzoom;
      }
      default:
        return;
    }
  }