/**
* 时间插件类
*/
define(['meteoDir/other/DatePicker/WdatePicker',
'meteoDir/other/meteoVideo/meteoVideo'], function (wdt, video) {
var time = {
input: null,
count: 0, //用来记录当前有多少功能开启了时间轴
init: function () {
var content = "
";
$('body').append(content);
$('.meteo-time-boxone').hide();
video.init('meteo-time-box', function () {
// $(".meteo-title-left").draggable()
$(".meteo-title-left").dragmove($('.meteo-time-boxone'));
})
ONEMAP.C.publisher.subscribe(function (option) { //全屏动画
if (option) {
$(".meteo-time-boxone").animate({ //时间轴
top: "120%"
}, 400)
var top = $('.meteo-legend-box').css('top'); //色标
top = parseInt(top) + 64;
$(".meteo-legend-box").animate({
top: top + 'px'
}, 400)
} else {
$(".meteo-time-boxone").animate({ //时间轴
top: "78%"
}, 400)
var top = $('.meteo-legend-box').css('top'); //色标
top = parseInt(top) - 64;
$(".meteo-legend-box").animate({
top: top + 'px'
}, 400)
}
}, 'layout::fullMap');
},
open: function (isSea) {
// if (time.count == 0) //第一次开启时间轴时重置时间(现在改为每次都重置时间
video.clearTime(isSea);
time.count++;
// video.initTime();
$('.meteo-time-boxone').show();
},
close: function () {
time.count--;
if (time.count == 0){
$('.meteo-time-boxone').hide();
video.stop();
}
},
getTime: function () {
var myTime = $('#meteo-video-query-startDate').val();
myTime = myTime.split('/').join('-');
myTime = myTime.length > 15 ? myTime.substring(0, 16) : myTime;
return myTime;
},
getVti: function () {
var vti = $('.meteo-video-progress-nowtime').html();
return vti;
},
timeUpdate: function () {
for (var key in meteo.f) {
if (meteo.f[key].update) meteo.f[key].update();
}
},
updateOdate: function (e) {
video.updateQbTime();
},
clearOdate: function (e) {
video.clearTime(false);
}
}
return time;
});