SDK JS
    Preparing search index...
    • Resolve a tileset source — a Cesium ion asset id (number) or a direct tileset.json URL (string) — into the fetched tileset JSON plus the auth + base URL to reuse for every subsequent request. The entry point for feeding an engine.

      Parameters

      • idOrUrl: string | number

        A Cesium ion asset id (number) or an absolute tileset.json URL (string).

      • Optionaltoken: string

        Access token: the Cesium ion token (required for an asset id), or the Bearer token retried on a 401/403 for a secured URL. Omit for fully public URLs.

      Returns Promise<ResolvedSource>

      A ResolvedSource with the parsed JSON, base URL, reusable auth, detected TilesetVendor, and any propagated query params.

      Public-first: a URL is fetched with no auth and only retried with token on a 401/403; a Google ?key= is moved to the X-Goog-Api-Key header. A Cesium ion asset id always hits the ion endpoint (which needs a token) and follows its url + temporary accessToken (or, for external assets like Google, the embedded tileset URL).

      Error if the tileset/endpoint fetch is non-OK (HTTP status in the message; with a hint that an access token is needed on a 401/403 without one), if a Cesium ion asset id is given without a token, or if the ion endpoint omits the tileset URL.

      // Direct, public URL:
      const src = await resolveSource('https://tile.googleapis.com/v1/3dtiles/root.json?key=API_KEY');
      // Cesium ion asset (needs a token):
      const src = await resolveSource(2275207, ionAccessToken);
      const engine = new Tiles3DMeshEngine(src.json, src.baseUrl, anchor, decoder, callbacks, {
      requestInit: src.requestInit, queryParams: src.queryParams,
      });