toolFullScreen.js 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. define(function() {
  2. var status = {
  3. isFullScreen: false,
  4. initialized: false, //是否初始化
  5. };
  6. /**
  7. * 初始化并订阅事件
  8. * @return {[type]} [description]
  9. */
  10. function init() {
  11. if (!status.initialized) {
  12. subscribe();
  13. status.initialized = true
  14. }
  15. $(window).resize(function() {
  16. layoutResize();
  17. });
  18. ONEMAP.C.publisher.publish({
  19. modName: 'isFullScreen'
  20. }, 'tools:active');
  21. }
  22. /**
  23. * 页面重置
  24. */
  25. function layoutResize(){
  26. if (status.isFullScreen){
  27. }else{
  28. }
  29. }
  30. /**
  31. * 监听事件
  32. */
  33. function subscribe() {
  34. ONEMAP.C.publisher.subscribe(remove, 'tools:active');
  35. }
  36. function remove(options) {
  37. if (options.modName === 'isFullScreen') {
  38. if (status.isFullScreen) {
  39. ONEMAP.C.publisher.publish(false, 'layout::fullMap');
  40. $("#topBar .tools-fullScreen").removeClass('cur');
  41. /*if(map23DData.display.map3D){
  42. $(".tools-elevation").hide();
  43. $(".tools-painting").hide();
  44. $(".tools-marker").hide();
  45. $(".tools-measuring3DE").show();
  46. $(".tools-LDZZ").show();
  47. $(".tools-KSFX").show();
  48. $(".tools-TSFX").show();
  49. $(".tools-flyLineModal").show();
  50. }else if(map23DData.display.map2D){
  51. $(".tools-elevation").show();
  52. $(".tools-painting").show();
  53. $(".tools-marker").show();
  54. $(".tools-measuring3DE").hide();
  55. $(".tools-LDZZ").hide();
  56. $(".tools-KSFX").hide();
  57. $(".tools-TSFX").hide();
  58. $(".tools-flyLineModal").hide();
  59. }*/
  60. // $("#heighterSlider").show();
  61. $("#fullscreen").hide();
  62. $("#footer .contact").show();
  63. $('#topBar .tools-fullScreen').attr('title','全屏');
  64. $("#rule").hide();
  65. status.isFullScreen = false;
  66. } else {
  67. $("#fullscreen .cover-content").addClass('cur').addClass('tools-fullScreen');
  68. $("#fullscreen .cover-content").attr('title','退出全屏');
  69. $("#fullscreen").show();
  70. $("#heighterSlider").hide();
  71. $("#footer .contact").hide();
  72. ONEMAP.C.publisher.publish(true, 'layout::fullMap');
  73. // $("#topBar .tools-fullScreen").addClass('cur');
  74. // $('#topBar .tools-fullScreen').attr('title','退出全屏');
  75. status.isFullScreen = true;
  76. }
  77. }
  78. }
  79. return ONEMAP.M.toolFullScreen = {
  80. init: init
  81. }
  82. })