//cesium时钟时间格式化 function CesiumTimeFormatter(datetime, viewModel) { var
julianDT = new Cesium.JulianDate(); Cesium.JulianDate.addHours(datetime, 8,
julianDT); var gregorianDT = Cesium.JulianDate.toGregorianDate(julianDT); let
hour = gregorianDT.hour + ""; let minute = gregorianDT.minute + ""; let second
= gregorianDT.second + ""; return `${hour.padStart(2,
"0")}:${minute.padStart(2, "0")}:${second.padStart(2, "0")}`; } //cesium时钟日期格式化
function CesiumDateFormatter(datetime, viewModel, ignoredate) { var julianDT =
new Cesium.JulianDate(); Cesium.JulianDate.addHours(datetime, 8, julianDT); var
gregorianDT = Cesium.JulianDate.toGregorianDate(julianDT); return
`${gregorianDT.year}年${gregorianDT.month}月${gregorianDT.day}日`; }
//cesium时间轴格式化 function CesiumDateTimeFormatter(datetime, viewModel,
ignoredate) { var julianDT = new Cesium.JulianDate();
Cesium.JulianDate.addHours(datetime, 8, julianDT); var gregorianDT =
Cesium.JulianDate.toGregorianDate(julianDT); let hour = gregorianDT.hour + "";
let minute = gregorianDT.minute + ""; return
`${gregorianDT.day}日${hour.padStart(2, "0")}:${minute.padStart(2, "0")}`; }
Cesium.Timeline.prototype.makeLabel = CesiumDateTimeFormatter; let viewer = new
Cesium.Viewer(...);//省略 viewer.animation.viewModel.dateFormatter =
CesiumDateFormatter; viewer.animation.viewModel.timeFormatter =
CesiumTimeFormatter;

 

技术
今日推荐
下载桌面版
GitHub
百度网盘(提取码:draw)
Gitee
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:[email protected]
QQ群:766591547
关注微信