123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326 |
- /**
- * 弹窗类
- */
- define([
- 'html!templates/meteo/popup1', //弹窗
- 'html!templates/meteo/popup_surf', //弹窗
- 'html!templates/meteo/popup_global', //弹窗
- 'html!templates/meteo/popup_army', //弹窗
- 'html!templates/meteo/popup_auto', //弹窗
- ], function (html, surfHtml, globalHtml, armyHtml, autoHtml) {
- var popup = {
- options: [],
- length: [],
- chart: null,
- initImage: function () {
- for (var i = 0; i < 100; i++) {
- var image = new Image();
- var dayUrl = "";
- if (i < 10) {
- dayUrl = 'images/meteo/weatherIcon/cww0' + i + '.png';
- } else {
- dayUrl = 'images/meteo/weatherIcon/cww' + i + '.png';
- }
- image.src = dayUrl;
- }
- var dayAndNightImageId = [0, 1, 2, 3, 25, 26, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90];
- for (var j = 0; j < dayAndNightImageId.length; j++) {
- var image = new Image();
- var nightUrl = "";
- if (dayAndNightImageId[i] < 10) {
- nightUrl = 'images/meteo/weatherIcon/cww0' + i + 'n.png';
- } else {
- nightUrl = 'images/meteo/weatherIcon/cww' + i + 'n.png';
- }
- image.src = nightUrl;
- }
- },
- init: function () {
- // $('.meteo-popup').remove();
- $('.meteo-popup-surf').remove();
- $('.meteo-popup-global').remove();
- $('.meteo-popup-army').remove();
- $('.meteo-popup-auto').remove();
- if ($('#meteo-popup-title').html()) {
- return;
- }
- //初始化弹窗
- $('body').append(html);
- require(['meteoDir/other/jquery.easyui.min'], function () {
- $('.meteo-popup').draggable();
- });
- ONEMAP.C.publisher.subscribe(popup.popup_html_css, 'change23D');
- //滚动条
- $(".content_scrollx").mCustomScrollbar({
- axis: "x",
- advanced: {
- autoExpandHorizontalScroll: true,
- }
- });
- //------------添加/删除TD为星图添加(用于3D地图显示弹窗)---------------
- $('.meteo-weather-dot').click(function (event) {
- $('.meteo-popup').show();
- if (map23DData.display.map2D) {
- $(".meteo-popup .popup_html").removeClass('TD');
- } else {
- $(".meteo-popup .popup_html").addClass('TD');
- }
- });
- //----------------------------------------------------------------------
- //实况 菜单切换
- $('.meteo-popup #meteo-popup-bt1').addClass('current');
- $('.meteo-popup .meteo-popup-chart>div').eq(0).show().siblings().hide();
- $('.meteo-popup .meteo-popup-buttons a').click(function () {
- $(this).addClass('current').siblings().removeClass('current');
- $('.meteo-popup .meteo-popup-chart>div').eq($(this).index()).show().siblings().hide();
- })
- $('.meteo-popup .metie-popup-buttons-main').click(function (event) {
- $(this).addClass('current').siblings().removeClass('current');
- $('.meteo-popup .meteo-popup-main-warp').addClass('current').siblings().removeClass('current');
- });
- $('.meteo-popup .metie-popup-buttons-chart').click(function (event) {
- $(this).addClass('current').siblings().removeClass('current');
- $('.meteo-popup .meteo-popup-chart').addClass('current').siblings().removeClass('current');
- });
- //关闭按钮可关闭弹窗
- $('.meteo-popup .meteo-delete').click(function (event) {
- $('.meteo-popup').hide();
- $('.meteo-popup .meteo-popup-main-warp,.meteo-popup .metie-popup-buttons-main').addClass('current').siblings().removeClass('current');
- });
- //点击地图关闭弹窗 2D
- map2DViewer.map.on('click', function () {
- $('.meteo-popup').hide();
- })
- //todo 点击地图关闭弹窗 3D
- // locaSpaceMap.attachEvent('Click', function () {
- // PubSub.publish('map3D.click', {
- // from:'3D'
- // });
- // // $('#meteo-popup').hide();
- // })
- },
- initSurf: function () {
- // $('.meteo-popup-surf').remove();
- $('.meteo-popup').remove();
- $('.meteo-popup-global').remove();
- $('.meteo-popup-army').remove();
- $('.meteo-popup-auto').remove();
- if ($('#meteo-popup-surf-title').html()) {
- return;
- }
- //初始化弹窗
- $('body').append(surfHtml);
- if (meteo.c.map.mapType == '3d') {
- $(".meteo-popup-surf .popup_html").addClass('TD');
- } else {
- $(".meteo-popup-surf .popup_html").removeClass('TD');
- }
- require(['meteoDir/other/jquery.easyui.min'], function () {
- $('.meteo-popup-surf').draggable();
- });
- ONEMAP.C.publisher.subscribe(popup.popup_html_surf_css, 'change23D');
- //滚动条
- $(".content_scrollx").mCustomScrollbar({
- axis: "x",
- advanced: {
- autoExpandHorizontalScroll: true,
- }
- });
- //------------添加/删除TD为星图添加(用于3D地图显示弹窗)---------------
- $('.meteo-weather-dot').click(function (event) {
- $('.meteo-popup-surf').show();
- if (map23DData.display.map2D) {
- $(".meteo-popup-surf .popup_html").removeClass('TD');
- } else {
- $(".meteo-popup-surf .popup_html").addClass('TD');
- }
- });
- //----------------------------------------------------------------------
- //实况 菜单切换
- $('.meteo-popup-surf #meteo-popup-surf-bt1').addClass('current');
- $('.meteo-popup-surf .meteo-popup-chart>div').eq(0).show().siblings().hide();
- $('.meteo-popup-surf .meteo-popup-buttons a').click(function () {
- $(this).addClass('current').siblings().removeClass('current');
- $('.meteo-popup-surf .meteo-popup-chart>div').eq($(this).index()).show().siblings().hide();
- })
- $('.meteo-popup-surf .meteo-popup-buttons-main').click(function (event) {
- $(this).addClass('current').siblings().removeClass('current');
- $('.meteo-popup-surf .meteo-popup-main-warp').addClass('current').siblings().removeClass('current');
- });
- $('.meteo-popup-surf .meteo-popup-buttons-chart').click(function (event) {
- $(this).addClass('current').siblings().removeClass('current');
- $('.meteo-popup-surf .meteo-popup-chart').addClass('current').siblings().removeClass('current');
- });
- //关闭按钮可关闭弹窗
- $('.meteo-popup-surf .meteo-delete').click(function (event) {
- $('.meteo-popup-surf').hide();
- $('.meteo-popup-surf .meteo-popup-main-warp,.meteo-popup-surf .metie-popup-buttons-main').addClass('current').siblings().removeClass('current');
- });
- //点击地图关闭弹窗 2D
- map2DViewer.map.on('click', function () {
- $('.meteo-popup-surf').hide();
- })
- //todo 点击地图关闭弹窗 3D
- // locaSpaceMap.attachEvent('Click', function () {
- // PubSub.publish('map3D.click', {
- // from:'3D'
- // });
- // // $('#meteo-popup').hide();
- // })
- },
- initGlobal: function () {
- $('.meteo-popup').remove();
- $('.meteo-popup-surf').remove();
- // $('.meteo-popup-global').remove();
- $('.meteo-popup-army').remove();
- $('.meteo-popup-auto').remove();
- if ($('#meteo-popup-global-title').html()) {
- return;
- }
- //初始化弹窗
- $('body').append(globalHtml);
- if (meteo.c.map.mapType == '3d') {
- $(".meteo-popup-global .popup_html").addClass('TD');
- } else {
- $(".meteo-popup-global .popup_html").removeClass('TD');
- }
- require(['meteoDir/other/jquery.easyui.min'], function () {
- $('.meteo-popup-global').draggable();
- });
- ONEMAP.C.publisher.subscribe(popup.popup_html_global_css, 'change23D');
- //滚动条
- $(".content_scrollx").mCustomScrollbar({
- axis: "x",
- advanced: {
- autoExpandHorizontalScroll: true,
- }
- });
- //------------添加/删除TD为星图添加(用于3D地图显示弹窗)---------------
- $('.meteo-weather-dot').click(function (event) {
- $('.meteo-popup-global').show();
- if (map23DData.display.map2D) {
- $(".meteo-popup-global .popup_html").removeClass('TD');
- } else {
- $(".meteo-popup-global .popup_html").addClass('TD');
- }
- });
- //----------------------------------------------------------------------
- //实况 菜单切换
- $('.meteo-popup-global #meteo-popup-global-bt1').addClass('current');
- $('.meteo-popup-global .meteo-popup-chart>div').eq(0).show().siblings().hide();
- $('.meteo-popup-global .meteo-popup-buttons a').click(function () {
- $(this).addClass('current').siblings().removeClass('current');
- $('.meteo-popup-global .meteo-popup-chart>div').eq($(this).index()).show().siblings().hide();
- })
- $('.meteo-popup-global .metie-popup-buttons-main').click(function (event) {
- $(this).addClass('current').siblings().removeClass('current');
- $('.meteo-popup-global .meteo-popup-main-warp').addClass('current').siblings().removeClass('current');
- });
- $('.meteo-popup-global .metie-popup-buttons-chart').click(function (event) {
- $(this).addClass('current').siblings().removeClass('current');
- $('.meteo-popup-global .meteo-popup-chart').addClass('current').siblings().removeClass('current');
- });
- //关闭按钮可关闭弹窗
- $('.meteo-popup-global .meteo-delete').click(function (event) {
- $('.meteo-popup-global').hide();
- $('.meteo-popup-global .meteo-popup-main-warp,.meteo-popup-global .metie-popup-buttons-main').addClass('current').siblings().removeClass('current');
- });
- //点击地图关闭弹窗 2D
- map2DViewer.map.on('click', function () {
- $('.meteo-popup-global').hide();
- })
- //todo 点击地图关闭弹窗 3D
- // locaSpaceMap.attachEvent('Click', function () {
- // PubSub.publish('map3D.click', {
- // from:'3D'
- // });
- // // $('#meteo-popup').hide();
- // })
- },
- initArmy: function () {
- $('.meteo-popup').remove();
- $('.meteo-popup-surf').remove();
- $('.meteo-popup-global').remove();
- // $('.meteo-popup-army').remove();
- $('.meteo-popup-auto').remove();
- if ($('#meteo-popup-army-title').html()) {
- return;
- }
- //初始化弹窗
- $('body').append(armyHtml);
- if (meteo.c.map.mapType == '3d') {
- $(".meteo-popup-army .popup_html").addClass('TD');
- } else {
- $(".meteo-popup-army .popup_html").removeClass('TD');
- }
- require(['meteoDir/other/jquery.easyui.min'], function () {
- $('.meteo-popup-army').draggable();
- });
- ONEMAP.C.publisher.subscribe(popup.popup_html_army_css, 'change23D');
- //滚动条
- $(".content_scrollx").mCustomScrollbar({
- axis: "x",
- advanced: {
- autoExpandHorizontalScroll: true,
- }
- });
- //------------添加/删除TD为星图添加(用于3D地图显示弹窗)---------------
- $('.meteo-weather-dot').click(function (event) {
- $('.meteo-popup-army').show();
- if (map23DData.display.map2D) {
- $(".meteo-popup-army .popup_html").removeClass('TD');
- } else {
- $(".meteo-popup-army .popup_html").addClass('TD');
- }
- });
- //----------------------------------------------------------------------
- //实况 菜单切换
- $('.meteo-popup-army #meteo-popup-army-bt1').addClass('current');
- $('.meteo-popup-army .meteo-popup-chart>div').eq(0).show().siblings().hide();
- $('.meteo-popup-army .meteo-popup-buttons a').click(function () {
- $(this).addClass('current').siblings().removeClass('current');
- $('.meteo-popup-army .meteo-popup-chart>div').eq($(this).index()).show().siblings().hide();
- })
- $('.meteo-popup-army .metie-popup-buttons-main').click(function (event) {
- $(this).addClass('current').siblings().removeClass('current');
- $('.meteo-popup-global .meteo-popup-main-warp').addClass('current').siblings().removeClass('current');
- });
- $('.meteo-popup-army .metie-popup-buttons-chart').click(function (event) {
- $(this).addClass('current').siblings().removeClass('current');
- $('.meteo-popup-army .meteo-popup-chart').addClass('current').siblings().removeClass('current');
- });
- //关闭按钮可关闭弹窗
- $('.meteo-popup-army .meteo-delete').click(function (event) {
- $('.meteo-popup-army').hide();
- $('.meteo-popup-army .meteo-popup-main-warp,.meteo-popup-army .metie-popup-buttons-main').addClass('current').siblings().removeClass('current');
- });
- //点击地图关闭弹窗 2D
- map2DViewer.map.on('click', function () {
- $('.meteo-popup-army').hide();
- })
- //todo 点击地图关闭弹窗 3D
- // locaSpaceMap.attachEvent('Click', function () {
- // PubSub.publish('map3D.click', {
- // from:'3D'
- // });
- // // $('#meteo-popup').hide();
- // })
- },
- initAuto: function () {
- $('.meteo-popup').remove();
- $('.meteo-popup-surf').remove();
- $('.meteo-popup-global').remove();
- $('.meteo-popup-army').remove();
- // $('.meteo-popup-auto').remove();
- if ($('#meteo-popup-auto-title').html()) {
- return;
- }
- //初始化弹窗
- $('body').append(autoHtml);
- if (meteo.c.map.mapType == '3d') {
- $(".meteo-popup-auto .popup_html").addClass('TD');
- } else {
- $(".meteo-popup-auto .popup_html").removeClass('TD');
- }
- require(['meteoDir/other/jquery.easyui.min'], function () {
- $('.meteo-popup-auto').draggable();
- });
- ONEMAP.C.publisher.subscribe(popup.popup_html_auto_css, 'change23D');
- //滚动条
- $(".content_scrollx").mCustomScrollbar({
- axis: "x",
- advanced: {
- autoExpandHorizontalScroll: true,
- }
- });
- //------------添加/删除TD为星图添加(用于3D地图显示弹窗)---------------
- $('.meteo-weather-dot').click(function (event) {
- $('.meteo-popup-auto').show();
- if (map23DData.display.map2D) {
- $(".meteo-popup-auto .popup_html").removeClass('TD');
- } else {
- $(".meteo-popup-auto .popup_html").addClass('TD');
- }
- });
- //----------------------------------------------------------------------
- //实况 菜单切换
- $('.meteo-popup-auto #meteo-popup-auto-bt1').addClass('current');
- $('.meteo-popup-auto .meteo-popup-chart>div').eq(0).show().siblings().hide();
- $('.meteo-popup-auto .meteo-popup-buttons a').click(function () {
- $(this).addClass('current').siblings().removeClass('current');
- $('.meteo-popup-auto .meteo-popup-chart>div').eq($(this).index()).show().siblings().hide();
- })
- $('.meteo-popup-auto .metie-popup-buttons-main').click(function (event) {
- $(this).addClass('current').siblings().removeClass('current');
- $('.meteo-popup-auto .meteo-popup-main-warp').addClass('current').siblings().removeClass('current');
- });
- $('.meteo-popup-auto .metie-popup-buttons-chart').click(function (event) {
- $(this).addClass('current').siblings().removeClass('current');
- $('.meteo-popup-auto .meteo-popup-chart').addClass('current').siblings().removeClass('current');
- });
- //关闭按钮可关闭弹窗
- $('.meteo-popup-auto .meteo-delete').click(function (event) {
- $('.meteo-popup-auto').hide();
- $('.meteo-popup-auto .meteo-popup-main-warp,.meteo-popup-auto .metie-popup-buttons-main').addClass('current').siblings().removeClass('current');
- });
- //点击地图关闭弹窗 2D
- map2DViewer.map.on('click', function () {
- $('.meteo-popup-auto').hide();
- })
- //todo 点击地图关闭弹窗 3D
- // locaSpaceMap.attachEvent('Click', function () {
- // PubSub.publish('map3D.click', {
- // from:'3D'
- // });
- // // $('#meteo-popup').hide();
- // })
- },
- popup_html_css: function (type) {
- if (type == '2d') {
- $(".meteo-popup .popup_html").removeClass('TD');
- } else if (type == '3d') {
- $(".meteo-popup .popup_html").addClass('TD');
- }
- },
- popup_html_surf_css: function (type) {
- if (type == '2d') {
- $(".meteo-popup-surf .popup_html").removeClass('TD');
- } else if (type == '3d') {
- $(".meteo-popup-surf .popup_html").addClass('TD');
- }
- },
- popup_html_global_css: function (type) {
- if (type == '2d') {
- $(".meteo-popup-global .popup_html").removeClass('TD');
- } else if (type == '3d') {
- $(".meteo-popup-global .popup_html").addClass('TD');
- }
- },
- popup_html_army_css: function (type) {
- if (type == '2d') {
- $(".meteo-popup-army .popup_html").removeClass('TD');
- } else if (type == '3d') {
- $(".meteo-popup-army .popup_html").addClass('TD');
- }
- },
- popup_html_auto_css: function (type) {
- if (type == '2d') {
- $(".meteo-popup-auto .popup_html").removeClass('TD');
- } else if (type == '3d') {
- $(".meteo-popup-auto .popup_html").addClass('TD');
- }
- },
- getUrlForType: function (type) {
- var urls =
- //地面站
- type == 0 ? [meteo.c.http.stationInfo, meteo.c.http.stationReal,
- meteo.c.http.stationFcst, meteo.c.http.stationFcstDay] :
- //5000站点
- type == 1 ? [meteo.c.http.stationGInfo, meteo.c.http.stationGReal, meteo.c.http.stationGFcst] :
- //JD站
- type == 2 ? [meteo.c.http.amsuInfo, meteo.c.http.amsuReal, meteo.c.http.amsuFcst] :
- //自动站
- type == 3 ? [meteo.c.http.awsInfo, meteo.c.http.awsReal, meteo.c.http.amsuFcst] :
- //船舶报
- type == 4 ? [meteo.c.http.shipInfo] :
- null;
- return urls;
- },
- showPopup: function (station, name, type, day, day2) {
- day = null;
- day2 = null;
- popup.count = 0;
- $(".meteo-popup-button").hide(); //隐藏所有按钮
- var urls = popup.getUrlForType(type);
- if (!urls) return;
- if (type == 0) {////地面站
- //弹框 实况按钮选中
- this.initSurf();
- $('.meteo-popup-surf').css('left', '260px');
- $('.meteo-popup-surf').css('top', '100px');
- $('.meteo-popup-surf #meteo-popup-surf-bt1').addClass('current').siblings().removeClass('current');
- popup.setSurfContent(station, name, urls[0], function () {
- $('.meteo-popup-button').removeClass('.current');
- $('.meteo-popup-chart-list').hide();
- $('.meteo-shikuang-div').show();
- $('.meteo-popup-surf').show();
- $('#meteo-popup-surf-bt2').hide();
- $('#meteo-popup-surf-bt3').hide();
- popup.setSurfFcst(station, urls[2], day2);
- popup.setSurfFcstD(station, urls[3], day2);
- }, day, type);
- } else if (type == 1) {//5000站点
- //弹框 实况按钮选中
- $('.meteo-popup-global #meteo-popup-global-bt1').addClass('current').siblings().removeClass('current');
- this.initGlobal();
- $('.meteo-popup-global').css('left', '260px');
- $('.meteo-popup-global').css('top', '100px');
- popup.setGlobalContent(station, name, urls[0], function () {
- }, day, type);
- $('.meteo-popup-button').removeClass('.current');
- $('.meteo-popup-chart-list').hide();
- $('.meteo-shikuang-div').show();
- $('.meteo-popup-global').show();
- $('#meteo-popup-global-bt3').hide();
- popup.setGlobalFcstD(station, urls[2], day2);
- } else if (type == 2) {//JD站
- //弹框 实况按钮选中
- $('.meteo-popup-army #meteo-popup-army-bt1').addClass('current').siblings().removeClass('current');
- this.initArmy();
- $('.meteo-popup-army').css('left', '260px');
- $('.meteo-popup-army').css('top', '100px');
- popup.setArmyContent(station, name, urls[0], function () {
- }, day, type);
- $('.meteo-popup-button').removeClass('.current');
- $('.meteo-popup-chart-list').hide();
- $('.meteo-popup-army').show();
- // popup.setArmyFcst(station, urls[1], day2);
- } else if (type == 3) {//自动站
- //弹框 实况按钮选中
- $('.meteo-popup-auto #meteo-popup-auto-bt1').addClass('current').siblings().removeClass('current');
- this.initAuto();
- $('.meteo-popup-auto').css('left', '260px');
- $('.meteo-popup-auto ').css('top', '100px');
- popup.setAutoContent(station, name, urls[0], function () {
- }, day, type);
- $('.meteo-popup-button').removeClass('.current');
- $('.meteo-popup-chart-list').hide();
- $('.meteo-popup-auto').show();
- } else if (type == 4) {
- $('.meteo-popup #meteo-popup-bt1').addClass('current').siblings().removeClass('current');
- this.init();
- popup.setContent(station, name, urls[0], function () {
- }, day, type);
- $('.meteo-popup').show();
- } else {
- $('.meteo-popup #meteo-popup-bt1').addClass('current').siblings().removeClass('current');
- this.init();
- popup.setContent(station, name, urls[0], function () {}, day, type);
- $('.meteo-popup').show();
- }
- },
- setContent: function (station, name, url, callback, day, type) {
- var par = null;
- if (day) {
- par = {
- odate: day
- }
- }
- meteo.c.http.httpFunction(url, station, par, function (json) {
- if (json) {
- var date = json.ldate;
- if (type == 0) date = "01/09";
- popup.setTitle('#meteo-popup-title', name, station, date);
- var wth = meteo.c.process.setWth(json.wth);
- popup.setPopupData('#meteo-popup-wth', wth);
- var tt = meteo.c.process.setTt(json.tt);
- popup.setPopupData('#meteo-popup-tt', tt);
- var wth1 = meteo.c.process.setWth(json.wth1);
- popup.setPopupData('#meteo-popup-wth1', wth1);
- var wth2 = meteo.c.process.setWth(json.wth2);
- popup.setPopupData('#meteo-popup-wth2', wth2);
- var td = meteo.c.process.setTt(json.td);
- popup.setPopupData('#meteo-popup-td', td);
- var pr = meteo.c.process.setPr(json.pr);
- popup.setPopupData('#meteo-popup-pr', pr);
- var vis = meteo.c.process.setVis(json.vis);
- popup.setPopupData('#meteo-popup-vis', vis);
- var rh = meteo.c.process.setRh(json.rh);
- popup.setPopupData('#meteo-popup-rh', rh);
- var rn = meteo.c.process.setRn(json.rn06);
- popup.setPopupData('#meteo-popup-rn06', rn);
- var cn = meteo.c.process.setCn(json.cn);
- popup.setPopupData('#meteo-popup-cn', cn);
- var wd = meteo.c.process.setWd(json.wd);
- var ws = meteo.c.process.setWs(json.ws);
- popup.setPopupData('#meteo-popup-wd', wd + " " + ws);
- // popup.setPopupData('#meteo-popup-ws', wd, '');
- var dp = meteo.c.process.setPr(json.dp03);
- popup.setPopupData('#meteo-popup-dp03', dp);
- var cm = meteo.c.process.setCn(json.cm);
- popup.setPopupData('#meteo-popup-cm', cm);
- var ch = meteo.c.process.setCh(json.ch);
- popup.setPopupData('#meteo-popup-ch', ch);
- callback ? callback() : null;
- } else {
- alert('暂无数据');
- }
- })
- },
- setSurfContent: function (station, name, url, callback, day, type) {
- var par = null;
- if (day) {
- par = {
- odate: day
- }
- }
- meteo.c.http.httpFunction(url, station, par, function (json) {
- var date = json.ldate;
- // if (type == 0) date = "01/09";
- popup.setTitle('#meteo-popup-surf-title', name, station, date);
- var wth = meteo.c.process.setWth(json.wth);
- popup.setPopupData('#meteo-popup-surf-wth', wth);
- var tt = meteo.c.process.setTt(json.tt);
- popup.setPopupData('#meteo-popup-surf-tt', tt);
- var wth1 = meteo.c.process.setWth(json.wth1);
- popup.setPopupData('#meteo-popup-surf-wth1', wth1);
- var wth2 = meteo.c.process.setWth(json.wth2);
- popup.setPopupData('#meteo-popup-surf-wth2', wth2);
- var td = meteo.c.process.setTt(json.td);
- popup.setPopupData('#meteo-popup-surf-td', td);
- var pr = meteo.c.process.setPr(json.pr);
- popup.setPopupData('#meteo-popup-surf-pr', pr);
- var vis = meteo.c.process.setVis(json.vis);
- popup.setPopupData('#meteo-popup-surf-vis', vis);
- var rh = meteo.c.process.setRh(json.rh);
- popup.setPopupData('#meteo-popup-surf-rh', rh);
- var rn = meteo.c.process.setRn(json.rn06);
- popup.setPopupData('#meteo-popup-surf-rn06', rn);
- var cn = meteo.c.process.setCn(json.cn);
- popup.setPopupData('#meteo-popup-surf-cn', cn);
- var wd = meteo.c.process.setWd(json.wd);
- var ws = meteo.c.process.setWs(json.ws);
- popup.setPopupData('#meteo-popup-surf-wd', wd + " " + ws);
- // popup.setPopupData('#meteo-popup-ws', wd, '');
- var dp = meteo.c.process.setPr(json.dp03);
- popup.setPopupData('#meteo-popup-surf-dp03', dp);
- var cm = meteo.c.process.setCn(json.cm);
- popup.setPopupData('#meteo-popup-surf-cm', cm);
- var ch = meteo.c.process.setCh(json.ch);
- popup.setPopupData('#meteo-popup-surf-ch', ch);
- callback ? callback() : null;
- }, function () {
- ONEMAP.C.publisher.publish({type: 'warning', message: '暂无当前站点数据'}, 'noteBar::add');
- $('.meteo-popup-surf').remove();
- })
- },
- setGlobalContent: function (station, name, url, callback, day, type) {
- var par = null;
- if (day) {
- par = {
- odate: day
- }
- }
- meteo.c.http.httpFunction(url, station, par, function (json) {
- if (json) {
- var date = json.ldate;
- popup.setTitle('#meteo-popup-global-title', name, station, date);
- var wth = meteo.c.process.setWth(json.wth);
- popup.setPopupData('#meteo-popup-global-wth', wth);
- var tt = meteo.c.process.setTt(json.tt);
- popup.setPopupData('#meteo-popup-global-tt', tt);
- var wth1 = meteo.c.process.setWth(json.wth1);
- popup.setPopupData('#meteo-popup-global-wth1', wth1);
- var wth2 = meteo.c.process.setWth(json.wth2);
- popup.setPopupData('#meteo-popup-global-wth2', wth2);
- var td = meteo.c.process.setTt(json.td);
- popup.setPopupData('#meteo-popup-global-td', td);
- var pr = meteo.c.process.setPr(json.pr);
- popup.setPopupData('#meteo-popup-global-pr', pr);
- var vis = meteo.c.process.setVis(json.vis);
- popup.setPopupData('#meteo-popup-global-vis', vis);
- var rh = meteo.c.process.setRh(json.rh);
- popup.setPopupData('#meteo-popup-global-rh', rh);
- var rn = meteo.c.process.setRn(json.rn06);
- popup.setPopupData('#meteo-popup-global-rn06', rn);
- var cn = meteo.c.process.setCn(json.cn);
- popup.setPopupData('#meteo-popup-global-cn', cn);
- var wd = meteo.c.process.setWd(json.wd);
- var ws = meteo.c.process.setWs(json.ws);
- popup.setPopupData('#meteo-popup-global-wd', wd + " " + ws);
- // popup.setPopupData('#meteo-popup-ws', wd, '');
- var dp = meteo.c.process.setPr(json.dp03);
- popup.setPopupData('#meteo-popup-global-dp03', dp);
- var cm = meteo.c.process.setCn(json.cm);
- popup.setPopupData('#meteo-popup-global-cm', cm);
- var ch = meteo.c.process.setCh(json.ch);
- popup.setPopupData('#meteo-popup-global-ch', ch);
- callback ? callback() : null;
- } else {
- alert('暂无数据');
- }
- }, function () {
- $('.meteo-popup-global').remove();
- })
- },
- setArmyContent: function (station, name, url, callback, day, type) {
- var par = null;
- if (day) {
- par = {
- odate: day
- }
- }
- meteo.c.http.httpFunction(url, station, par, function (json) {
- if (json) {
- var date = json.ldate;
- popup.setTitle('#meteo-popup-army-title', name, station, date);
- var wth = meteo.c.process.setWth(json.wth);
- popup.setPopupData('#meteo-popup-army-wth', wth);
- var tt = meteo.c.process.setTt(json.tt);
- popup.setPopupData('#meteo-popup-army-tt', tt);
- var wth1 = meteo.c.process.setWth(json.wth1);
- popup.setPopupData('#meteo-popup-army-wth1', wth1);
- var wth2 = meteo.c.process.setWth(json.wth2);
- popup.setPopupData('#meteo-popup-army-wth2', wth2);
- var td = meteo.c.process.setTt(json.td);
- popup.setPopupData('#meteo-popup-army-td', td);
- var pr = meteo.c.process.setPr(json.pr);
- popup.setPopupData('#meteo-popup-army-pr', pr);
- var vis = meteo.c.process.setVis(json.vis);
- popup.setPopupData('#meteo-popup-army-vis', vis);
- var rh = meteo.c.process.setRh(json.rh);
- popup.setPopupData('#meteo-popup-army-rh', rh);
- var rn = meteo.c.process.setRn(json.rn06);
- popup.setPopupData('#meteo-popup-army-rn06', rn);
- var cn = meteo.c.process.setCn(json.cn);
- popup.setPopupData('#meteo-popup-army-cn', cn);
- var wd = meteo.c.process.setWd(json.wd);
- var ws = meteo.c.process.setWs(json.ws);
- popup.setPopupData('#meteo-popup-army-wd', wd + " " + ws);
- // popup.setPopupData('#meteo-popup-ws', wd, '');
- var dp = meteo.c.process.setPr(json.dp03);
- popup.setPopupData('#meteo-popup-army-dp03', dp);
- var cm = meteo.c.process.setCn(json.cm);
- popup.setPopupData('#meteo-popup-army-cm', cm);
- var ch = meteo.c.process.setCh(json.ch);
- popup.setPopupData('#meteo-popup-army-ch', ch);
- callback ? callback() : null;
- } else {
- alert('暂无数据');
- }
- }, function () {
- $('.meteo-popup-army').remove();
- })
- },
- setAutoContent: function (station, name, url, callback, day, type) {
- var par = null;
- if (day) {
- par = {
- odate: day
- }
- }
- meteo.c.http.httpFunction(url, station, par, function (json) {
- if (json) {
- var date = json.ldate;
- popup.setTitle('#meteo-popup-auto-title', name, station, date);
- var wth = meteo.c.process.setWth(json.wth);
- popup.setPopupData('#meteo-popup-auto-wth', wth);
- var tt = meteo.c.process.setTt(json.tt);
- popup.setPopupData('#meteo-popup-auto-tt', tt);
- var wth1 = meteo.c.process.setWth(json.wth1);
- popup.setPopupData('#meteo-popup-auto-wth1', wth1);
- var wth2 = meteo.c.process.setWth(json.wth2);
- popup.setPopupData('#meteo-popup-auto-wth2', wth2);
- var td = meteo.c.process.setTt(json.td);
- popup.setPopupData('#meteo-popup-auto-td', td);
- var pr = meteo.c.process.setPr(json.pr);
- popup.setPopupData('#meteo-popup-auto-pr', pr);
- var vis = meteo.c.process.setVis(json.vis);
- popup.setPopupData('#meteo-popup-auto-vis', vis);
- var rh = meteo.c.process.setRh(json.rh);
- popup.setPopupData('#meteo-popup-auto-rh', rh);
- var rn = meteo.c.process.setRn(json.rn06);
- popup.setPopupData('#meteo-popup-auto-rn06', rn);
- var cn = meteo.c.process.setCn(json.cn);
- popup.setPopupData('#meteo-popup-auto-cn', cn);
- var wd = meteo.c.process.setWd(json.wd);
- var ws = meteo.c.process.setWs(json.ws);
- popup.setPopupData('#meteo-popup-auto-wd', wd + " " + ws);
- // popup.setPopupData('#meteo-popup-ws', wd, '');
- var dp = meteo.c.process.setPr(json.dp03);
- popup.setPopupData('#meteo-popup-auto-dp03', dp);
- var cm = meteo.c.process.setCn(json.cm);
- popup.setPopupData('#meteo-popup-auto-cm', cm);
- var ch = meteo.c.process.setCh(json.ch);
- popup.setPopupData('#meteo-popup-auto-ch', ch);
- callback ? callback() : null;
- } else {
- alert('暂无数据');
- }
- }, function () {
- $('.meteo-popup-auto').remove();
- })
- },
- setReal: function (station, url, day) {
- if (!url) {
- return;
- }
- var par = null;
- if (day) {
- par = {
- ldate: day,
- odate: day
- }
- }
- meteo.c.http.httpFunction(url, station, par, function (json) {
- if (json.length > 0) {
- $('#meteo-popup-bt1').show();
- $('#meteo-popup-cdiv1').show();
- var chartWidth = json.length * 50;
- chartWidth = chartWidth < 740 ? 740 : chartWidth;
- $('#meteo-popup-chart').css('width', chartWidth); //设置宽度
- var chart = meteo.c.chart.getChart('meteo-popup-chart');
- var option = meteo.c.chart.getChartOption(json, "实况");
- chart.resize();
- chart.setOption(option);
- $(".content_scrollx").mCustomScrollbar('update');
- }
- }, function () {
- });
- },
- setSurfReal: function (station, url, day) {
- if (!url) {
- return;
- }
- var par = null;
- if (day) {
- par = {
- ldate: day,
- odate: day
- }
- }
- meteo.c.http.httpFunction(url, station, par, function (json) {
- if (json.length > 0) {
- $('#meteo-popup-surf-bt1').show();
- $('#meteo-popup-surf-cdiv1').hide();
- var chartWidth = json.length * 50;
- chartWidth = chartWidth < 740 ? 740 : chartWidth;
- $('#meteo-popup-surf-chart').css('width', chartWidth); //设置宽度
- var chart = meteo.c.chart.getChart('meteo-popup-surf-chart');
- var option = meteo.c.chart.getChartOption(json, "实况");
- chart.resize();
- chart.setOption(option);
- $(".content_scrollx").mCustomScrollbar('update');
- }
- }, function () {
- });
- },
- setGlobalReal: function (station, url, day) {
- if (!url) {
- return;
- }
- var par = null;
- if (day) {
- par = {
- ldate: day,
- odate: day
- }
- }
- meteo.c.http.httpFunction(url, station, par, function (json) {
- if (json.length > 0) {
- $('#meteo-popup-global-bt1').show();
- $('#meteo-popup-global-cdiv1').show();
- var chartWidth = json.length * 50;
- chartWidth = chartWidth < 740 ? 740 : chartWidth;
- $('#meteo-popup-global-chart').css('width', chartWidth); //设置宽度
- var chart = meteo.c.chart.getChart('meteo-popup-global-chart');
- var option = meteo.c.chart.getChartOption(json, "实况");
- chart.resize();
- chart.setOption(option);
- $(".content_scrollx").mCustomScrollbar('update');
- }
- }, function () {
- });
- },
- setArmyReal: function (station, url, day) {
- if (!url) {
- return;
- }
- var par = null;
- if (day) {
- par = {
- ldate: day,
- odate: day
- }
- }
- meteo.c.http.httpFunction(url, station, par, function (json) {
- if (json.length > 0) {
- $('#meteo-popup-army-bt1').show();
- $('#meteo-popup-army-cdiv1').show();
- var chartWidth = json.length * 50;
- chartWidth = chartWidth < 740 ? 740 : chartWidth;
- $('#meteo-popup-army-chart').css('width', chartWidth); //设置宽度
- var chart = meteo.c.chart.getChart('meteo-popup-army-chart');
- var option = meteo.c.chart.getChartOption(json, "实况");
- chart.resize();
- chart.setOption(option);
- $(".content_scrollx").mCustomScrollbar('update');
- }
- }, function () {
- });
- },
- setAutoReal: function (station, url, day) {
- if (!url) {
- return;
- }
- var par = null;
- if (day) {
- par = {
- ldate: day,
- odate: day
- }
- }
- meteo.c.http.httpFunction(url, station, par, function (json) {
- if (json.length > 0) {
- $('#meteo-popup-auto-bt1').show();
- $('#meteo-popup-auto-cdiv1').show();
- var chartWidth = json.length * 50;
- chartWidth = chartWidth < 740 ? 740 : chartWidth;
- $('#meteo-popup-auto-chart').css('width', chartWidth); //设置宽度
- var chart = meteo.c.chart.getChart('meteo-popup-auto-chart');
- var option = meteo.c.chart.getChartOption(json, "实况");
- chart.resize();
- chart.setOption(option);
- $(".content_scrollx").mCustomScrollbar('update');
- }
- }, function () {
- });
- },
- setFcst: function (station, url, type, day) {
- if (!url) {
- return;
- }
- var par = null;
- if (day) {
- par = {
- ldate: day,
- odate: day
- }
- }
- meteo.c.http.httpFunction(url, station, par, function (json) {
- if (json.length > 0) {
- if (type == 1) {
- $('#meteo-popup-bt2').hide();
- $('#meteo-popup-bt4').show();
- var chartWidth = json.length * 50;
- chartWidth = chartWidth < 740 ? 740 : chartWidth;
- $('#meteo-popup-chart4').css('width', chartWidth); //设置宽度
- var chart = meteo.c.chart.getChart('meteo-popup-chart4');
- var option = meteo.c.chart.getGlobalData(json, "预报");
- chart.resize();
- chart.setOption(option);
- $(".content_scrollx").mCustomScrollbar('update');
- } else {
- $('#meteo-popup-bt4').hide();
- $('#meteo-popup-bt2').show();
- var chartWidth = json.length * 50;
- chartWidth = chartWidth < 740 ? 740 : chartWidth;
- $('#meteo-popup-chart2').css('width', chartWidth); //设置宽度
- var chart = meteo.c.chart.getChart('meteo-popup-chart2');
- var option = meteo.c.chart.getChartOption(json, "预报");
- chart.resize();
- chart.setOption(option);
- $(".content_scrollx").mCustomScrollbar('update');
- }
- }
- }, function () {
- })
- },
- setSurfFcst: function (station, url, day) {
- if (!url) {
- $('#meteo-popup-surf-bt2').hide();
- return;
- }
- var par = null;
- // if (day) {
- // par = {
- // ldate: day,
- // odate: day
- // }
- // }
- meteo.c.http.httpFunction(url, station, par, function (json) {
- if (json.length > 0) {
- $('#meteo-popup-surf-bt4').hide();
- $('#meteo-popup-surf-bt2').show();
- $('#meteo-popup-surf-chart').show();
- var chartWidth = json.length * 60;
- chartWidth = chartWidth < 740 ? 740 : chartWidth;
- $('#meteo-popup-surf-chart').css('width', chartWidth); //设置宽度
- var chart = meteo.c.chart.getChart('meteo-popup-surf-chart');
- chart.clear();
- // var option = meteo.c.chart.getChartOption(json, "预报");
- var option = meteo.c.chart.getSurfHourChartOption(json, "预报");
- // chart.resize();
- chart.setOption(option);
- $(".content_scrollx").mCustomScrollbar('update');
- } else {
- $('#meteo-popup-surf-chart').hide();
- $('#meteo-popup-surf-bt2').hide();
- }
- }, function () {
- $('#meteo-popup-surf-bt2').hide();
- })
- },
- setGlobalFcst: function (station, url, day) {
- if (!url) {
- return;
- }
- var par = null;
- if (day) {
- par = {
- ldate: day,
- odate: day
- }
- }
- meteo.c.http.httpFunction(url, station, par, function (json) {
- if (json.length > 0) {
- $('#meteo-popup-global-bt4').hide();
- $('#meteo-popup-global-bt2').show();
- var chartWidth = json.length * 50;
- chartWidth = chartWidth < 740 ? 740 : chartWidth;
- $('#meteo-popup-global-chart').css('width', chartWidth); //设置宽度
- var chart = meteo.c.chart.getChart('meteo-popup-global-chart');
- var option = meteo.c.chart.getChartOption(json, "预报");
- chart.resize();
- chart.setOption(option);
- $(".content_scrollx").mCustomScrollbar('update');
- }
- }, function () {
- })
- },
- setArmyFcst: function (station, url, day) {
- if (!url) {
- return;
- }
- var par = null;
- if (day) {
- par = {
- ldate: day,
- odate: day
- }
- }
- meteo.c.http.httpFunction(url, station, par, function (json) {
- if (json.length > 0) {
- $('#meteo-popup-army-bt4').hide();
- $('#meteo-popup-army-bt2').show();
- var chartWidth = json.length * 50;
- chartWidth = chartWidth < 740 ? 740 : chartWidth;
- $('#meteo-popup-army-chart').css('width', chartWidth); //设置宽度
- var chart = meteo.c.chart.getChart('meteo-popup-army-chart');
- var option = meteo.c.chart.getHourChartOption(json, "预报");
- chart.resize();
- chart.setOption(option);
- $(".content_scrollx").mCustomScrollbar('update');
- }
- }, function () {
- })
- },
- setAutoFcst: function (station, url, day) {
- if (!url) {
- return;
- }
- var par = null;
- if (day) {
- par = {
- ldate: day,
- odate: day
- }
- }
- meteo.c.http.httpFunction(url, station, par, function (json) {
- if (json.length > 0) {
- $('#meteo-popup-auto-bt4').hide();
- $('#meteo-popup-auto-bt2').show();
- var chartWidth = json.length * 50;
- chartWidth = chartWidth < 740 ? 740 : chartWidth;
- $('#meteo-popup-auto-chart').css('width', chartWidth); //设置宽度
- var chart = meteo.c.chart.getChart('meteo-popup-auto-chart');
- var option = meteo.c.chart.getAutoHourChartOption(json, "预报");
- chart.resize();
- chart.setOption(option);
- $(".content_scrollx").mCustomScrollbar('update');
- }
- }, function () {
- })
- },
- setFcstD: function (station, url, day) {
- if (!url) {
- return;
- }
- var par = null;
- if (day) {
- par = {
- ldate: day,
- odate: day
- }
- }
- meteo.c.http.httpFunction(url, station, par, function (json) {
- if (json.length > 0) {
- $('#meteo-popup-bt3').show();
- var chartWidth = json.length * 40;
- chartWidth = chartWidth < 740 ? 740 : chartWidth;
- $('#meteo-popup-chart2').css('width', chartWidth); //设置宽度
- var chart = meteo.c.chart.getChart('meteo-popup-chart2');
- var option = meteo.c.chart.getChartOption(json, "七天预报");
- chart.resize();
- chart.setOption(option);
- $(".content_scrollx").mCustomScrollbar('update');
- }
- }, function () {
- })
- },
- setSurfFcstD: function (station, url, day) {
- if (!url) {
- $('#meteo-popup-surf-bt3').hide();
- return;
- }
- var par = null;
- // if (day) {
- // par = {
- // ldate: day,
- // odate: day
- // }
- // }
- meteo.c.http.httpFunction(url, station, par, function (json) {
- if (json.length > 0) {
- $('#meteo-popup-surf-bt3').show();
- $('#meteo-popup-surf-chart2').show();
- var chartWidth = json.length * 60;
- chartWidth = chartWidth < 740 ? 740 : chartWidth;
- $('#meteo-popup-surf-chart2').css('width', chartWidth); //设置宽度
- var chart = meteo.c.chart.getChart('meteo-popup-surf-chart2');
- chart.clear();
- var option = meteo.c.chart.getSurfDaysChartOption(json, "七天预报");
- // var option = meteo.c.chart.getChartOption(json, "七天预报");
- // chart.resize();
- chart.setOption(option);
- $(".content_scrollx").mCustomScrollbar('update');
- } else {
- $('#meteo-popup-surf-chart2').hide();
- $('#meteo-popup-surf-bt3').hide();
- }
- }, function () {
- $('#meteo-popup-surf-bt3').hide();
- })
- },
- setGlobalFcstD: function (station, url, day) {
- if (!url) {
- $('#meteo-popup-global-bt3').hide();
- return;
- }
- var par = null;
- // if (day) {
- // par = {
- // ldate: day,
- // odate: day
- // }
- // }
- meteo.c.http.httpFunction(url, station, par, function (json) {
- if (json.length > 0) {
- $('#meteo-popup-global-bt3').show();
- $('#meteo-popup-global-chart1').show();
- var chartWidth = json.length * 40;
- chartWidth = chartWidth < 740 ? 740 : chartWidth;
- $('#meteo-popup-global-chart1').css('width', chartWidth); //设置宽度
- var chart = meteo.c.chart.getChart('meteo-popup-global-chart1');
- chart.clear();
- // var option = meteo.c.chart.getChartOption(json, "七天预报");
- var option = meteo.c.chart.getGlobalDaysChartOption(json, "七天预报");
- chart.setOption(option);
- $(".content_scrollx").mCustomScrollbar('update');
- } else {
- $('#meteo-popup-global-bt3').hide();
- $('#meteo-popup-global-chart1').hide();
- }
- }, function () {
- $('#meteo-popup-global-bt3').hide();
- })
- },
- setArmyFcstD: function (station, url, day) {
- if (!url) {
- return;
- }
- var par = null;
- if (day) {
- par = {
- ldate: day,
- odate: day
- }
- }
- meteo.c.http.httpFunction(url, station, par, function (json) {
- if (json.length > 0) {
- $('#meteo-popup-army-bt3').show();
- var chartWidth = json.length * 40;
- chartWidth = chartWidth < 740 ? 740 : chartWidth;
- $('#meteo-popup-army-chart2').css('width', chartWidth); //设置宽度
- var chart = meteo.c.chart.getChart('meteo-popup-army-chart2');
- var option = meteo.c.chart.getChartOption(json, "七天预报");
- chart.resize();
- chart.setOption(option);
- $(".content_scrollx").mCustomScrollbar('update');
- }
- }, function () {
- })
- },
- setAutoFcstD: function (station, url, day) {
- if (!url) {
- return;
- }
- var par = null;
- if (day) {
- par = {
- ldate: day,
- odate: day
- }
- }
- meteo.c.http.httpFunction(url, station, par, function (json) {
- if (json.length > 0) {
- $('#meteo-popup-auto-bt3').show();
- var chartWidth = json.length * 40;
- chartWidth = chartWidth < 740 ? 740 : chartWidth;
- $('#meteo-popup-auto-chart2').css('width', chartWidth); //设置宽度
- var chart = meteo.c.chart.getChart('meteo-popup-auto-chart2');
- var option = meteo.c.chart.getChartOption(json, "七天预报");
- chart.resize();
- chart.setOption(option);
- $(".content_scrollx").mCustomScrollbar('update');
- }
- }, function () {
- })
- },
- hidePopup: function () {
- $('.meteo-popup').hide();
- $('.meteo-popup-surf').hide();
- $('.meteo-popup-global').hide();
- $('.meteo-popup-army').hide();
- $('.meteo-popup-auto').hide();
- },
- setPopupData: function (id, data) {
- var html = data ? data : "--";
- $(id).html(html);
- },
- setTitle: function (id, name, station, ldate) {
- // var html = data == 0 || data ? data + company : "--";
- if (name == "undefined" || !name) name = null;
- var html = name ? name + " (" + station + ")" : "(" + station + ")";
- html = ldate ? html + " " + ldate : html;
- $(id).html(html);
- },
- }
- // popup.init();
- // popup.initImage();
- return popup;
- });
|