GeoLeaf Core API - v3.0.0
    Preparing search index...
    • Validates a zoom level against a range.

      Defaults to [0, 20], both inclusive. NaN and the infinities are rejected explicitly, so a value that arithmetic produced rather than a user is caught here rather than downstream.

      Parameters

      Returns { valid: boolean; error: string | null }

      { valid, error }; error is null when valid.

      GeoLeafError A ValidationError when out of range and throwOnError is set.

      GeoLeaf.Validators.validateZoom(12);
      // Returns: { valid: true, error: null }

      GeoLeaf.Validators.validateZoom(25);
      // Returns: { valid: false, error: 'Zoom must be between 0 and 20' }

      // Plage personnalisée
      GeoLeaf.Validators.validateZoom(15, { min: 5, max: 18 });
      // Returns: { valid: true, error: null }