SceneMode.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*global define*/
  2. define([
  3. '../Core/freezeObject'
  4. ], function(
  5. freezeObject) {
  6. "use strict";
  7. /**
  8. * Indicates if the scene is viewed in 3D, 2D, or 2.5D Columbus view.
  9. *
  10. * @namespace
  11. * @alias SceneMode
  12. *
  13. * @see Scene#mode
  14. */
  15. var SceneMode = {
  16. /**
  17. * Morphing between mode, e.g., 3D to 2D.
  18. *
  19. * @type {Number}
  20. * @constant
  21. */
  22. MORPHING : 0,
  23. /**
  24. * Columbus View mode. A 2.5D perspective view where the map is laid out
  25. * flat and objects with non-zero height are drawn above it.
  26. *
  27. * @type {Number}
  28. * @constant
  29. */
  30. COLUMBUS_VIEW : 1,
  31. /**
  32. * 2D mode. The map is viewed top-down with an orthographic projection.
  33. *
  34. * @type {Number}
  35. * @constant
  36. */
  37. SCENE2D : 2,
  38. /**
  39. * 3D mode. A traditional 3D perspective view of the globe.
  40. *
  41. * @type {Number}
  42. * @constant
  43. */
  44. SCENE3D : 3
  45. };
  46. /**
  47. * Returns the morph time for the given scene mode.
  48. *
  49. * @param {SceneMode} value The scene mode
  50. * @returns {Number} The morph time
  51. */
  52. SceneMode.getMorphTime = function(value) {
  53. if (value === SceneMode.SCENE3D) {
  54. return 1.0;
  55. } else if (value === SceneMode.MORPHING) {
  56. return undefined;
  57. }
  58. return 0.0;
  59. };
  60. return freezeObject(SceneMode);
  61. });