123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- /**
- * Created by Administrator on 2017/11/21.
- */
- define([
- 'css!styles/meteo/meteo', //css样式
- 'meteoDir/c/timeInput', //时间控件
- 'html!templates/meteo/controlStation', //站点气象
- 'html!templates/meteo/controlT799', //大气
- 'html!templates/meteo/controlOcean', //海洋
- 'html!templates/meteo/controlCloud', //云图
- 'html!templates/meteo/controlCloudList', //云图列表
- 'html!templates/meteo/controlTyphoon', //台风列表
- 'html!templates/meteo/controlSpaceWeather', //空间天气列表
- ], function (css, time, station, t799, ocean, cloud, cloudList, typhoonList, testSpaWea) {
- var layout = {
- level: {
- '地面': '9999',
- '925': '0925',
- '850': '0850',
- '700': '0700',
- '500': '0500',
- },
- oceanLevel: {
- '海表': '0000',
- '10米': '0010',
- '20米': '0020',
- '30米': '0030',
- '50米': '0050',
- },
- init: function () {
- //快捷方式 start
- // $('.tools-toolWheather').append(shortcut);
- //hover 气象
- // $('.tools-toolWheather').hover(function () {
- // $('.meteo-hover-div').show();
- // }, function () {
- // $('.meteo-hover-div').hide();
- // })
- //end
- layout.initControl();
- layout.initButton();
- $(".content_scroll").mCustomScrollbar({
- advanced: {
- autoExpandHorizontalScroll: true,
- }
- });
- //-------------------加载世界地图geoJson(无底图时使用)---------------------------
- //L.geoJson(world, {}).addTo(map2DViewer.map);
- },
- initControl: function () {
- //------------------布局填充----------------------
- $('#meteo-ul-station').html(station); //站点查询
- $('#meteo-ul-799').html(t799); //大气海洋环境
- $('#meteo-ul-ocean').html(ocean); //大气海洋环境
- $('#meteo-ul-cloud').html(cloud); //云图
- $('#sideBarBody').append(cloudList); //云图列表
- $('#sideBarBody').append(typhoonList); //台风
- $('#sideBarBody').append(testSpaWea); //空间天气
- //-------------------布局交互-----------------------
- $('.meteo-control-active').click(function (e) {
- $(this).parent().siblings().removeClass('active');
- $(this).parent().toggleClass('active');
- });
- //侧边栏展开代码
- $('#meteo-bt-controld').click(function () {
- //设置zIndex 为最高
- var zIndex = ONEMAP.M.sideBar.getZIndex();
- $('#meteo-control-typhoon').css({zIndex: zIndex});
- ONEMAP.D.currentSideBarMod = 'atlas';
- //开启侧栏
- ONEMAP.C.publisher.publish('handShow', 'layout::sideBar');
- });
- //拖动插件
- require(['meteoDir/other/jquery.easyui.min'], function () {
- // $('#meteo-control').draggable();
- $('.meteo-popup').draggable();
- });
- time.init();
- },
- initButton: function () {
- $('.meteo-button-799').click(function (e) {
- var elem = $(this).parent().parent()[0].attributes.meteotype.nodeValue;
- var level = $(this).html();
- if (meteo.f[elem] && meteo.f[elem].click) meteo.f[elem].click(layout.level[level]);
- });
- $('.meteo-button-ocean').click(function (e) {
- var elem = $(this).parent().parent()[0].attributes.meteotype.nodeValue;
- var level = $(this).html();
- if (meteo.f[elem] && meteo.f[elem].click) meteo.f[elem].click(layout.oceanLevel[level]);
- });
- },
- showCloudList: function () { //显示云图列表
- //设置zIndex 为最高
- var zIndex = ONEMAP.M.sideBar.getZIndex();
- $('#meteo-control-cloud').css({zIndex: zIndex});
- ONEMAP.D.currentSideBarMod = 'atlas';
- //开启侧栏
- ONEMAP.C.publisher.publish('handShow', 'layout::sideBar');
- },
- getTimeObject: function () {
- return time;
- }
- }
- layout.init();
- return layout;
- })
|