Skip to content

MVTDataProvider typescript definition in the NPM package doesn't matches javascript sourcecode #13611

Description

@creative-mode-world

What happened?

Image - MVTDataProvider typescript definition:
/**
 * A Mapbox Vector Tiles (MVT) data provider. Loads .mvt or .pbf tiles, converting tiles
 * dynamically (at runtime) into 3D Tiles.
 *
 * <div class="notice">
 * This object is normally not instantiated directly, use {@link MVTDataProvider.fromUrl}.
 * </div>
 */
export class MVTDataProvider {
    /**
     * Creates an MVTDataProvider from the specified URL template and options.
     * @param url - URL template, containing {z}, {x}, and {y} placeholders.
     * @param [options] - Provider options.
     * @param [options.minZoom = 0] - Minimum zoom level represented in the generated tileset.
     * @param [options.maxZoom = 14] - Maximum zoom level represented in the generated tileset.
     * @param [options.extent] - Optional geographic extent in radians to constrain the generated tile tree.
     * @param [options.featureIdProperty] - MVT property name to use as feature ID.
     */
    static fromUrl(url: Resource | string, options?: {
        minZoom?: number;
        maxZoom?: number;
        extent?: Rectangle;
        featureIdProperty?: string;
    }): void;
}
Image
  • MVTDataProvider source code:
class MVTDataProvider extends UrlTemplate3DTilesDataProvider {
  /**
   * Creates an MVTDataProvider from the specified URL template and options.
   *
   * @param {Resource|string} url URL template, containing {z}, {x}, and {y} placeholders.
   * @param {object} [options] Provider options.
   * @param {number} [options.minZoom=0] Minimum zoom level represented in the generated tileset.
   * @param {number} [options.maxZoom=14] Maximum zoom level represented in the generated tileset.
   * @param {Rectangle} [options.extent] Optional geographic extent in radians to constrain the generated tile tree.
   * @param {string} [options.featureIdProperty] MVT property name to use as feature ID.
   */
  static async fromUrl(url, options) {
    return /** @type {Promise<MVTDataProvider>} */ (
      super.fromUrl(url, options)
    );
  }

The prototype function of source code returns Promise object but typescript definition returns void.

Reproduction steps

No response

Sandcastle example

No response

Environment

Browser: chrome
CesiumJS Version: 1.143.0
Operating System: windows

AI acknowledgment

  • I used AI to generate this issue report.
  • (If the above is checked) I have reviewed the AI-generated content before submitting.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions