createWorldImagery.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import defaultValue from "../Core/defaultValue.js";
  2. import deprecationWarning from "../Core/deprecationWarning.js";
  3. import IonImageryProvider from "./IonImageryProvider.js";
  4. import IonWorldImageryStyle from "./IonWorldImageryStyle.js";
  5. /**
  6. * Creates an {@link IonImageryProvider} instance for ion's default global base imagery layer, currently Bing Maps.
  7. *
  8. * @function
  9. *
  10. * @param {object} [options] Object with the following properties:
  11. * @param {IonWorldImageryStyle} [options.style=IonWorldImageryStyle] The style of base imagery, only AERIAL, AERIAL_WITH_LABELS, and ROAD are currently supported.
  12. * @returns {IonImageryProvider}
  13. * @deprecated
  14. *
  15. * @see Ion
  16. *
  17. * @example
  18. * // Create Cesium World Imagery with default settings
  19. * const viewer = new Cesium.Viewer('cesiumContainer', {
  20. * imageryProvider : Cesium.createWorldImagery();
  21. * });
  22. *
  23. * @example
  24. * // Create Cesium World Imagery with a different style
  25. * const viewer = new Cesium.Viewer('cesiumContainer', {
  26. * imageryProvider : Cesium.createWorldImagery({
  27. * style: Cesium.IonWorldImageryStyle.AERIAL_WITH_LABELS
  28. * })
  29. * });
  30. *
  31. */
  32. function createWorldImagery(options) {
  33. deprecationWarning(
  34. "createWorldImagery",
  35. "createWorldImagery was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use createWorldImageryAsync instead."
  36. );
  37. options = defaultValue(options, defaultValue.EMPTY_OBJECT);
  38. const style = defaultValue(options.style, IonWorldImageryStyle.AERIAL);
  39. const provider = new IonImageryProvider();
  40. // This is here for backwards compatibility
  41. IonImageryProvider._initialize(provider, style, options);
  42. return provider;
  43. }
  44. export default createWorldImagery;