createWorldImagery.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import defaultValue from "../Core/defaultValue.js";
  2. import IonImageryProvider from "./IonImageryProvider.js";
  3. import IonWorldImageryStyle from "./IonWorldImageryStyle.js";
  4. /**
  5. * Creates an {@link IonImageryProvider} instance for ion's default global base imagery layer, currently Bing Maps.
  6. *
  7. * @function
  8. *
  9. * @param {Object} [options] Object with the following properties:
  10. * @param {IonWorldImageryStyle} [options.style=IonWorldImageryStyle] The style of base imagery, only AERIAL, AERIAL_WITH_LABELS, and ROAD are currently supported.
  11. * @returns {IonImageryProvider}
  12. *
  13. * @see Ion
  14. *
  15. * @example
  16. * // Create Cesium World Terrain with default settings
  17. * const viewer = new Cesium.Viewer('cesiumContainer', {
  18. * imageryProvider : Cesium.createWorldImagery();
  19. * });
  20. *
  21. * @example
  22. * // Create Cesium World Terrain with water and normals.
  23. * const viewer = new Cesium.Viewer('cesiumContainer', {
  24. * imageryProvider : Cesium.createWorldImagery({
  25. * style: Cesium.IonWorldImageryStyle.AERIAL_WITH_LABELS
  26. * })
  27. * });
  28. *
  29. */
  30. function createWorldImagery(options) {
  31. options = defaultValue(options, defaultValue.EMPTY_OBJECT);
  32. const style = defaultValue(options.style, IonWorldImageryStyle.AERIAL);
  33. return new IonImageryProvider({
  34. assetId: style,
  35. });
  36. }
  37. export default createWorldImagery;