SceneMode.js 1.4 KB

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