compareLayout.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /**
  2. * [ATLAS.M.pcLayout]
  3. * @return {[object]}
  4. */
  5. define([
  6. 'html!templates/layout',
  7. 'css!styles/layout',
  8. // 'layoutDir/noteBar'
  9. ], function(tplLayout) {
  10. /**
  11. * 模块数据 用于数据存储和外部调用
  12. * @type {Object}
  13. */
  14. var modValue = {}
  15. /**
  16. * 模块界面样式 例如:宽,高
  17. * @type {Object}
  18. */
  19. var styles = {}
  20. /**
  21. * 模块状态,用于存储模块的状态 例如:收起,关闭
  22. * @type {Object}
  23. */
  24. var status = {}
  25. /**
  26. * 加载布局 初始化
  27. * 先加载 CSS,html,html事件,地图,地图控件
  28. * @type {Function}
  29. * @returns {*}
  30. */
  31. function init() {
  32. setLayout();
  33. };
  34. /**
  35. * [layoutResize description]
  36. * 设置布局
  37. */
  38. function setLayout() {
  39. $('body').append(tplLayout);
  40. switch(loadMod){
  41. case 'atlasCategory':
  42. require(['modDir/atlas/atlasCategory'], function (atlasCategory) {
  43. atlasCategory.init();
  44. });
  45. break;
  46. case 'atlasView':
  47. require(['modDir/atlas/atlasView'], function (atlasView) {
  48. atlasView.init();
  49. });
  50. break;
  51. }
  52. };
  53. /**
  54. * 界面事件绑定
  55. * @return {[type]} [description]
  56. */
  57. function bindEvent(){}
  58. /**
  59. * 界面重置
  60. * @return {[type]} [description]
  61. */
  62. function layoutResize() {};
  63. /**
  64. * 注册订阅
  65. * @type {Function}
  66. * 推送:ONEMAP.C.publisher.publish(options,'atlasList::type');
  67. * 订阅:ONEMAP.C.publisher.subscribe(layoutResize,'sideBarLayoutChange');
  68. */
  69. function subscribe() {}
  70. /**
  71. * 取消订阅
  72. * @type {Function}
  73. * 取消订阅:ONEMAP.C.publisher.unSubscribe(layoutResize,'sideBarLayoutChange');
  74. */
  75. function unSubscribe() {}
  76. /**
  77. * 模块移除
  78. * @return {[type]} [description]
  79. */
  80. function remove() {
  81. //取消订阅
  82. unSubscribe();
  83. }
  84. return ATLAS.M.pcLayout = {
  85. init: init
  86. };
  87. });