diff --git a/CHANGES.md b/CHANGES.md index d88ad1932e84..6ace4fc81e5f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,7 @@ - Improved `MaterialProperty` JSDoc and TypeScript type definitions, which were missing the ability to take primitive types in addition to Property instances in their constructor. [#8904](https://github.com/CesiumGS/cesium/pull/8904) - Fixed `EllipsoidGeodesic` JSDoc and TypeScript type definitions which incorrectly listed `result` as required. [#8904](https://github.com/CesiumGS/cesium/pull/8904) - Fixed a bug with handling of PixelFormat's flipY. [#8893](https://github.com/CesiumGS/cesium/pull/8893) +- Fixed JSDoc and TypeScript for `buildModuleUrl`, which was accidentally excluded from the official CesiumJS API. - Fixed JSDoc and TypeScript type definitions for all `ImageryProvider` types, which were missing `defaultNightAlpha` and `defaultDayAlpha` properties. [#8908](https://github.com/CesiumGS/cesium/pull/8908) - Fixed JSDoc and TypeScript type definitions for `EllipsoidTangentPlane.fromPoints`, which takes an array of `Cartesian3`, not a single instance. [#8928](https://github.com/CesiumGS/cesium/pull/8928) - Fixed JSDoc and TypeScript type definitions for `EntityCollection.getById` and `CompositeEntityCollection.getById`, which can both return undefined. [#8928](https://github.com/CesiumGS/cesium/pull/8928) diff --git a/Source/Core/buildModuleUrl.js b/Source/Core/buildModuleUrl.js index b79c07069ca8..2991ddc057ce 100644 --- a/Source/Core/buildModuleUrl.js +++ b/Source/Core/buildModuleUrl.js @@ -90,13 +90,20 @@ function buildModuleUrlFromBaseUrl(moduleID) { var implementation; /** - * Given a non-relative moduleID, returns an absolute URL to the file represented by that module ID, - * using, in order of preference, require.toUrl, the value of a global CESIUM_BASE_URL, or - * the base URL of the Cesium.js script. + * Given a relative URL under the Cesium base URL, returns an absolute URL. + * @function * - * @private + * @param {String} relativeUrl The relative path. + * + * @example + * var viewer = new Cesium.Viewer("cesiumContainer", { + * imageryProvider: new Cesium.TileMapServiceImageryProvider({ + * url: Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"), + * }), + * baseLayerPicker: false, + * }); */ -function buildModuleUrl(moduleID) { +function buildModuleUrl(relativeUrl) { if (!defined(implementation)) { //select implementation if ( @@ -111,7 +118,7 @@ function buildModuleUrl(moduleID) { } } - var url = implementation(moduleID); + var url = implementation(relativeUrl); return url; }