SceneMode.js 1.1 KB

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