From 36fbd1e5a40e319e6ac5f43d11c99ba4b66e93a3 Mon Sep 17 00:00:00 2001 From: surprise <15810472099@163.com> Date: 星期三, 29 十一月 2023 16:50:16 +0800 Subject: [PATCH] 坡度分析下载修改 --- public/WebSDK/Workers/path/Path.html | 836 +++++++++++++++++++++++++++++----------------------------- 1 files changed, 417 insertions(+), 419 deletions(-) diff --git a/public/WebSDK/Workers/path/Path.html b/public/WebSDK/Workers/path/Path.html index f3a2097..1ca92c8 100644 --- a/public/WebSDK/Workers/path/Path.html +++ b/public/WebSDK/Workers/path/Path.html @@ -2,460 +2,458 @@ <html lang="en"> <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <meta name="viewport" - content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> - <title>SmartEarth-SDK绀轰緥</title> - <link rel="stylesheet" href="../layui/css/layui.css"> - <style> - html, - body, - .layui-prop { - background-color: rgba(0, 0, 0, 0); - height: 100%; - color: #fff; - overflow-y: auto; - overflow-x: hidden; - } + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <meta name="viewport" + content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> + <title>SmartEarth-SDK绀轰緥</title> + <link rel="stylesheet" href="../layui/css/layui.css"> + <style> + html, + body, + .layui-prop { + background-color: rgba(0, 0, 0, 0); + height: 100%; + color: #fff; + overflow-y: auto; + overflow-x: hidden; + } - .layui-prop::-webkit-scrollbar { - /*婊氬姩鏉℃暣浣撴牱寮�*/ - width: 8px; - /*楂樺鍒嗗埆瀵瑰簲妯珫婊氬姩鏉$殑灏哄*/ - height: 8px; - scrollbar-arrow-color: red; - } + .layui-prop::-webkit-scrollbar { + /*婊氬姩鏉℃暣浣撴牱寮�*/ + width: 8px; + /*楂樺鍒嗗埆瀵瑰簲妯珫婊氬姩鏉$殑灏哄*/ + height: 8px; + scrollbar-arrow-color: red; + } - .layui-prop::-webkit-scrollbar-thumb { - border-radius: 5px; - -webkit-box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2); - box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2); - background: rgba(218, 218, 218, 0.5); - scrollbar-arrow-color: red; - } + .layui-prop::-webkit-scrollbar-thumb { + border-radius: 5px; + -webkit-box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2); + box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2); + background: rgba(218, 218, 218, 0.5); + scrollbar-arrow-color: red; + } - .layui-prop::-webkit-scrollbar-track { - -webkit-box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2); - box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2); - border-radius: 0; - background: rgba(218, 218, 218, 0.1); - } + .layui-prop::-webkit-scrollbar-track { + -webkit-box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2); + box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2); + border-radius: 0; + background: rgba(218, 218, 218, 0.1); + } - form { - width: 95%; - } + form { + width: 95%; + } - html { - overflow: hidden; - } + html { + overflow: hidden; + } - .layui-form-item { - width: 313px !important; - } + .layui-form-item { + width: 313px !important; + } - .layui-input { - background-color: #fff !important; - height: 30px; - margin-top: 5px; - } + .layui-input { + background-color: #fff !important; + height: 30px; + margin-top: 5px; + } - .layui-form-label { - width: 96px !important; - } + .layui-form-label { + width: 96px !important; + } - .layui-input-block { - width: 150px !important; - margin-left: 150px !important; - } + .layui-input-block { + width: 150px !important; + margin-left: 150px !important; + } - .layui-prop { - margin-left: 10px; - } + .layui-prop { + margin-left: 10px; + } - .layui-form-item .line { - display: block; - } + .layui-form-item .line { + display: block; + } - .layui-input-block { - margin-left: 0; - } + .layui-input-block { + margin-left: 0; + } - .layui-form-item { - border: 1px solid; - margin-bottom: 0px !important; - border-bottom: none; - } + .layui-form-item { + border: 1px solid; + margin-bottom: 0px !important; + border-bottom: none; + } - .layui-input { - background-color: rgba(0, 0, 0, 0) !important; - margin-top: 5px; - color: #fff; - } + .layui-input { + background-color: rgba(0, 0, 0, 0) !important; + margin-top: 5px; + color: #fff; + } - .layui-form-select dl { - background-color: rgba(0, 0, 0, 0.5) !important; - } + .layui-form-select dl { + background-color: rgba(0, 0, 0, 0.5) !important; + } - .layui-form-select dl dd:hover { - background-color: #f2f2f250; - } + .layui-form-select dl dd:hover { + background-color: #f2f2f250; + } - .bnt-box { - text-align: center; - height: 58px; - } + .bnt-box { + text-align: center; + height: 58px; + } - .bnt-box button { - margin-top: 10px; - } + .bnt-box button { + margin-top: 10px; + } - .fly { - display: none; - } + .fly { + display: none; + } - #flySpeed { - padding: 19px 0; - } - </style> + #flySpeed { + padding: 19px 0; + } + </style> </head> <body> - <div class="layui-prop"> - <div class="bnt-box"> - <button type="button" class="layui-btn layui-btn-normal" id="start">缁х画婕父</button> - <button type="button" class="layui-btn layui-btn-normal" id="stop" style="margin-left: 0;">鏆傚仠婕父</button> - <button type="button" class="layui-btn layui-btn-normal" id="exit">閫�鍑烘极娓�</button> - </div> - <form class="layui-form" action=""> - <div class="layui-form-item"> - <label class="layui-form-label">璺嚎鍚嶇О</label> - <div class="layui-input-block" id="roadName" style="line-height: 38px;"> - - </div> - </div> - <div class="layui-form-item"> - <label class="layui-form-label">瑙嗚妯″紡</label> - <div class="layui-input-block"> - <select id="sjms" name="sjms" lay-filter="sjms"> - <option value="0">璺熼殢妯″瀷</option> - <option value="1">绗竴浜虹О瑙嗚</option> - <option value="2">涓婂笣瑙嗚</option> - </select> - </div> - </div> - <div class="layui-form-item norline fly"> - <label class="layui-form-label">椋炶楂樺害</label> - <div class="layui-input-block"> - <input id="cameraHeight" type="text" value="0" name="cameraHeight" lay-filter="cameraHeight" - class="layui-input" onkeyup="value=value.replace(/[^\d\.\-]/g,'')"> - </div> - </div> - <div class="layui-form-item norline fly notGod"> - <label class="layui-form-label">椋炶璺濈</label> - <div class="layui-input-block"> - <input id="cameraDistance" type="text" value="0" name="cameraDistance" lay-filter="cameraDistance" - class="layui-input" onkeyup="value=value.replace(/[^\d\.\-]/g,'')"> - </div> - </div> - <div class="layui-form-item norline fly notGod"> - <label class="layui-form-label">淇话瑙�</label> - <div class="layui-input-block"> - <input id="pitch" type="text" value="0" name="pitch" lay-filter="pitch" class="layui-input" - onkeyup="value=value.replace(/[^\d\.\-]/g,'')"> - </div> - </div> - <div class="layui-form-item norline"> - <label class="layui-form-label">婕父閫熷害(m/s)</label> - <div class="layui-input-block"> - <div id="flySpeed" class="flySpeed"></div> - </div> - </div> - <div class="layui-form-item norline"> - <label class="layui-form-label">鎬婚暱搴�</label> - <div class="layui-input-block" id="totalLen" style="line-height: 38px;"> - </div> - </div> - <div class="layui-form-item norline"> - <label class="layui-form-label">宸叉极娓搁暱搴�</label> - <div class="layui-input-block" id="distanceTraveled" style="line-height: 38px;"> - 0 - </div> - </div> - <div class="layui-form-item norline"> - <label class="layui-form-label">鎬绘椂闀�</label> - <div class="layui-input-block" id="totalTime" style="line-height: 38px;"> - </div> - </div> - <div class="layui-form-item norline"> - <label class="layui-form-label">宸叉极娓告椂闂�</label> - <div class="layui-input-block" id="time" style="line-height: 38px;"> - 0 - </div> - </div> - <div class="layui-form-item norline"> - <label class="layui-form-label">鏄惁鏄剧ず妯″瀷</label> - <div class="layui-input-block"> - <input id="showModel" type="checkbox" lay-skin="switch" lay-filter="showModel" value="off" - lay-text="鏄瘄鍚�"> - </div> - </div> - <div class="layui-form-item norline"> - <label class="layui-form-label">鏄惁鏄剧ず璺嚎</label> - <div class="layui-input-block"> - <input id="showLine" type="checkbox" lay-skin="switch" lay-filter="showLine" value="off" - lay-text="鏄瘄鍚�"> - </div> - </div> - <div class="layui-form-item norline"> - <label class="layui-form-label">閫熷害</label> - <div class="layui-input-block" id="sd" style="line-height: 38px;"> - 50m/s - </div> - </div> - <div class="layui-form-item norline"> - <label class="layui-form-label">缁忓害</label> - <div class="layui-input-block" id="jd" style="line-height: 38px;"> - </div> - </div> - - <div class="layui-form-item norline"> - <label class="layui-form-label">绾害</label> - <div class="layui-input-block" id="wd" style="line-height: 38px;"> - </div> - </div> - - <div class="layui-form-item norline"> - <label class="layui-form-label">婕父楂樼▼</label> - <div class="layui-input-block" id="height" style="line-height: 38px;"> - </div> - </div> - <div class="layui-form-item norline"> - <label class="layui-form-label">鍦伴潰楂樼▼</label> - <div class="layui-input-block" id="globeHeight" style="line-height: 38px;"> - </div> - </div> - <div class="layui-form-item"> - <div class="layui-progress layui-progress-big" lay-showpercent="true" lay-filter="ratio"> - <div class="layui-progress-bar layui-bg-red" lay-percent="0%"></div> - </div> - </div> - </form> + <div class="layui-prop"> + <div class="bnt-box"> + <button type="button" class="layui-btn layui-btn-normal" id="start">缁х画婕父</button> + <button type="button" class="layui-btn layui-btn-normal" id="stop" style="margin-left: 0;">鏆傚仠婕父</button> + <button type="button" class="layui-btn layui-btn-normal" id="exit">閫�鍑烘极娓�</button> </div> - <script src="../jquery-2.0.3.js"></script> - <script src="../layui/layui.js"></script> + <form class="layui-form" action=""> + <div class="layui-form-item"> + <label class="layui-form-label">璺嚎鍚嶇О</label> + <div class="layui-input-block" id="roadName" style="line-height: 38px;"> - <script> - /// <reference path="sjcs.js" /> - var fly = null; - var sgworld = parent.sgworld; - var routeData = parent.PathAnimationData.flyData; - var url = parent.SmartEarthRootUrl + "Workers/Model/xiaoche.glb"; - $('#start').hide(); - $('#stop').show(); - var form, element, slider; - var ratio = 0; - layui.use(['form', 'element', 'slider'], function () { - form = layui.form; - element = layui.element; - slider = layui.slider; + </div> + </div> + <div class="layui-form-item"> + <label class="layui-form-label">瑙嗚妯″紡</label> + <div class="layui-input-block"> + <select id="sjms" name="sjms" lay-filter="sjms"> + <option value="0">璺熼殢妯″瀷</option> + <option value="1">绗竴浜虹О瑙嗚</option> + <option value="2">涓婂笣瑙嗚</option> + </select> + </div> + </div> + <div class="layui-form-item norline fly"> + <label class="layui-form-label">椋炶楂樺害</label> + <div class="layui-input-block"> + <input id="cameraHeight" type="text" value="0" name="cameraHeight" lay-filter="cameraHeight" + class="layui-input" onkeyup="value=value.replace(/[^\d\.\-]/g,'')"> + </div> + </div> + <div class="layui-form-item norline fly notGod"> + <label class="layui-form-label">椋炶璺濈</label> + <div class="layui-input-block"> + <input id="cameraDistance" type="text" value="0" name="cameraDistance" lay-filter="cameraDistance" + class="layui-input" onkeyup="value=value.replace(/[^\d\.\-]/g,'')"> + </div> + </div> + <div class="layui-form-item norline fly notGod"> + <label class="layui-form-label">淇话瑙�</label> + <div class="layui-input-block"> + <input id="pitch" type="text" value="0" name="pitch" lay-filter="pitch" class="layui-input" + onkeyup="value=value.replace(/[^\d\.\-]/g,'')"> + </div> + </div> + <div class="layui-form-item norline"> + <label class="layui-form-label">婕父閫熷害(m/s)</label> + <div class="layui-input-block"> + <div id="flySpeed" class="flySpeed"></div> + </div> + </div> + <div class="layui-form-item norline"> + <label class="layui-form-label">鎬婚暱搴�</label> + <div class="layui-input-block" id="totalLen" style="line-height: 38px;"> + </div> + </div> + <div class="layui-form-item norline"> + <label class="layui-form-label">宸叉极娓搁暱搴�</label> + <div class="layui-input-block" id="distanceTraveled" style="line-height: 38px;"> + 0 + </div> + </div> + <div class="layui-form-item norline"> + <label class="layui-form-label">鎬绘椂闀�</label> + <div class="layui-input-block" id="totalTime" style="line-height: 38px;"> + </div> + </div> + <div class="layui-form-item norline"> + <label class="layui-form-label">宸叉极娓告椂闂�</label> + <div class="layui-input-block" id="time" style="line-height: 38px;"> + 0 + </div> + </div> + <div class="layui-form-item norline"> + <label class="layui-form-label">鏄惁鏄剧ず妯″瀷</label> + <div class="layui-input-block"> + <input id="showModel" type="checkbox" lay-skin="switch" lay-filter="showModel" value="off" lay-text="鏄瘄鍚�"> + </div> + </div> + <div class="layui-form-item norline"> + <label class="layui-form-label">鏄惁鏄剧ず璺嚎</label> + <div class="layui-input-block"> + <input id="showLine" type="checkbox" lay-skin="switch" lay-filter="showLine" value="off" lay-text="鏄瘄鍚�"> + </div> + </div> + <div class="layui-form-item norline"> + <label class="layui-form-label">閫熷害</label> + <div class="layui-input-block" id="sd" style="line-height: 38px;"> + 50m/s + </div> + </div> + <div class="layui-form-item norline"> + <label class="layui-form-label">缁忓害</label> + <div class="layui-input-block" id="jd" style="line-height: 38px;"> + </div> + </div> - if (routeData.distance) { - document.getElementById("totalLen").innerText = getDistance(routeData.distance); - } - if (routeData.Totaltime) { - document.getElementById("totalTime").innerText = getTime(routeData.Totaltime); - } - if (routeData.range) { - document.getElementById("cameraDistance").value = routeData.range; - } - if (routeData.height) { - document.getElementById("cameraHeight").value = routeData.height; - } - if (routeData.pitch) { - document.getElementById("pitch").value = routeData.pitch; - } - document.getElementById("roadName").innerText = routeData.name; + <div class="layui-form-item norline"> + <label class="layui-form-label">绾害</label> + <div class="layui-input-block" id="wd" style="line-height: 38px;"> + </div> + </div> - fly = sgworld.Creator.createDynamicObject(routeData, url, shuj); - parent.PathAnimationData.fly = fly + <div class="layui-form-item norline"> + <label class="layui-form-label">婕父楂樼▼</label> + <div class="layui-input-block" id="height" style="line-height: 38px;"> + </div> + </div> + <div class="layui-form-item norline"> + <label class="layui-form-label">鍦伴潰楂樼▼</label> + <div class="layui-input-block" id="globeHeight" style="line-height: 38px;"> + </div> + </div> + <div class="layui-form-item"> + <div class="layui-progress layui-progress-big" lay-showpercent="true" lay-filter="ratio"> + <div class="layui-progress-bar layui-bg-red" lay-percent="0%"></div> + </div> + </div> + </form> + </div> + <script src="../jquery-2.0.3.js"></script> + <script src="../layui/layui.js"></script> - if (routeData.mode) { - $('#sjms option[value="' + routeData.mode + '"]').attr('selected', ''); - form.render(); - switch (routeData.mode) { - case 1: - $('.fly').show(); - break; - case 2: - $('.fly').show(); - $('.notGod').hide(); - break; - } - } - form.on('select(sjms)', function (data) { - if (data.value === "0") { - fly && fly.changeFlyMode(0); - routeData && (routeData.mode = 0); - $('.fly').hide(); - } else if (data.value === "1") { - fly && fly.changeFlyMode(1); - routeData && (routeData.mode = 1); - $('.fly').show(); - } else if (data.value === "2") { - fly && fly.changeFlyMode(2); - routeData && (routeData.mode = 2); - $('.fly').show(); - $('.notGod').hide(); - } - }); + <script> + /// <reference path="sjcs.js" /> + var fly = null; + var sgworld = parent.sgworld; + var routeData = parent.PathAnimationData.flyData; + var url = parent.SmartEarthRootUrl + "Workers/Model/xiaoche.glb"; + $('#start').hide(); + $('#stop').show(); + var form, element, slider; + var ratio = 0; + layui.use(['form', 'element', 'slider'], function() { + form = layui.form; + element = layui.element; + slider = layui.slider; - slider.render({ - elem: '#flySpeed', - theme: '#1E9FFF', //涓婚鑹� - min: 1, - max: 500, - value: 50, - change: function (value) { - let speed = value / 50.5; - fly && fly.setSpeed(speed); - routeData && (routeData.speed = speed); - document.getElementById("sd").innerText = value + 'm/s'; - } - }); + if (routeData.distance) { + document.getElementById("totalLen").innerText = getDistance(routeData.distance); + } + if (routeData.Totaltime) { + document.getElementById("totalTime").innerText = getTime(routeData.Totaltime); + } + if (routeData.range) { + document.getElementById("cameraDistance").value = routeData.range; + } + if (routeData.height) { + document.getElementById("cameraHeight").value = routeData.height; + } + if (routeData.pitch) { + document.getElementById("pitch").value = routeData.pitch; + } + document.getElementById("roadName").innerText = routeData.name; - $('#cameraDistance').on('input propertychange', function (event) { - var distance = $(this).val().replace(/[^\d\.\-]/g, ''); - fly && fly.setFlyDistance(parseFloat(distance)); - routeData && (routeData.range = parseFloat(distance)); - }); - $('#cameraHeight').on('input propertychange', function (event) { - var height = $(this).val().replace(/[^\d\.\-]/g, ''); - fly && fly.setFlyHeight(parseFloat(height)); - routeData && (routeData.height = parseFloat(height)); - }); - $('#pitch').on('input propertychange', function (event) { - var pitch = $(this).val().replace(/[^\d\.\-]/g, ''); - fly && fly.setFlyPitch(parseFloat(pitch)); - routeData && (routeData.pitch = parseFloat(pitch)); - }); - if (routeData.showModel) { - $('#showModel').next().click(); - $('#showModel').attr('value', 'on'); - } - form.on('switch(showModel)', function (data) { - fly && fly.showModel(this.checked); - routeData && (routeData.showModel = this.checked); - }); - if (routeData.showLine) { - $('#showLine').next().click(); - $('#showLine').attr('value', 'on'); - } - form.on('switch(showLine)', function (data) { - fly && fly.showLine(this.checked); - routeData && (routeData.showLine = this.checked); - }); - //杩涘害鏉� - setInterval(function () { - element.progress('ratio', ratio + '%'); - }, 500); - }); - //鎸夐挳浜嬩欢 - $(".bnt-box button").click(function () { - var id = this.id; - switch (id) { - case 'start': - fly && fly.isPause(false); - $('#start').hide(); - $('#stop').show(); - break; - case 'stop': - fly && fly.isPause(true); - $('#start').show(); - $('#stop').hide(); - break; - case 'exit': - parent.layer.close(parent.PathAnimationData.winIndex) - break; - } - }); + fly = sgworld.Creator.createDynamicObject(routeData, url, shuj); + parent.PathAnimationData.fly = fly - function shuj(data) { - if (data.distanceTraveled) { - //宸叉极娓搁暱搴� - document.getElementById("distanceTraveled").innerText = getDistance(data.distanceTraveled); - } - if (data.time) { - //宸叉极娓告椂闂� - document.getElementById("time").innerText = getTime(parseInt(data.time)); - } - if (data.longitude) { - //缁忓害 - document.getElementById("jd").innerText = data.longitude.toFixed(7) + '掳'; - } - if (data.latitude) { - //绾害 - document.getElementById("wd").innerText = data.latitude.toFixed(7) + '掳'; - } - // if (data.speed) { - // //閫熷害 - // document.getElementById("sd").innerText = data.speed; - // } - if (data.height) { - //閫熷害 - document.getElementById("height").innerText = getDistance(data.height); - } - if (data.globeHeight) { - //閫熷害 - document.getElementById("globeHeight").innerText = getDistance(data.globeHeight); - } - if (data.ratio) { - ratio = parseInt(data.ratio * 100); - } + if (routeData.mode) { + $('#sjms option[value="' + routeData.mode + '"]').attr('selected', ''); + form.render(); + switch (routeData.mode) { + case 1: + $('.fly').show(); + break; + case 2: + $('.fly').show(); + $('.notGod').hide(); + break; } - - //鑷姩鐐瑰嚮鍏抽棴绐楀彛鐐瑰叧闂簨浠� - function closeLayer() { - var $title = $(window.parent.document).find('.layui-layer-title'); - if ($title.length > 0) { - $title.each(function (i, item) { - if (item.innerHTML === "婕父璺嚎") { - var closeButton = $(item).parent().find('.layui-layer-close'); - var event = document.createEvent('MouseEvents'); - event.initEvent("click", false, true); - closeButton[0].dispatchEvent(event); - } - }) - } + } + form.on('select(sjms)', function(data) { + if (data.value === "0") { + fly && fly.changeFlyMode(0); + routeData && (routeData.mode = 0); + $('.fly').hide(); + } else if (data.value === "1") { + fly && fly.changeFlyMode(1); + routeData && (routeData.mode = 1); + $('.fly').show(); + } else if (data.value === "2") { + fly && fly.changeFlyMode(2); + routeData && (routeData.mode = 2); + $('.fly').show(); + $('.notGod').hide(); } + }); - function getTime(data) { - var time; - if (data < 60) { - time = data + "绉�"; - } else if (data >= 60 && data < 3600) { - time = Math.floor(data / 60) + '鍒�' + data % 60 + '绉�'; - } else { - var h = Math.floor(data / 3600); - data -= h * 3600; - var m = Math.floor(data / 60); - data -= m * 60; - time = h + '灏忔椂' + m + '鍒�' + data + '绉�'; - } - return time; + slider.render({ + elem: '#flySpeed', + theme: '#1E9FFF', //涓婚鑹� + min: 1, + max: 500, + value: 50, + change: function(value) { + let speed = value / 50.5; + fly && fly.setMultiplier(speed); + routeData && (routeData.speed = speed); + document.getElementById("sd").innerText = value + 'm/s'; } + }); - function getDistance(data) { - var dis; - data = parseFloat(data).toFixed(2); - data = parseFloat(data); - if (data >= 1000) { - dis = (data / 1000).toFixed(3) + "鍗冪背"; - } else { - dis = data + "绫�"; - } - return dis; - } - </script> + $('#cameraDistance').on('input propertychange', function(event) { + var distance = $(this).val().replace(/[^\d\.\-]/g, ''); + fly && fly.setFlyDistance(parseFloat(distance)); + routeData && (routeData.range = parseFloat(distance)); + }); + $('#cameraHeight').on('input propertychange', function(event) { + var height = $(this).val().replace(/[^\d\.\-]/g, ''); + fly && fly.setFlyHeight(parseFloat(height)); + routeData && (routeData.height = parseFloat(height)); + }); + $('#pitch').on('input propertychange', function(event) { + var pitch = $(this).val().replace(/[^\d\.\-]/g, ''); + fly && fly.setFlyPitch(parseFloat(pitch)); + routeData && (routeData.pitch = parseFloat(pitch)); + }); + if (routeData.showModel) { + $('#showModel').next().click(); + $('#showModel').attr('value', 'on'); + } + form.on('switch(showModel)', function(data) { + fly && fly.showModel(this.checked); + routeData && (routeData.showModel = this.checked); + }); + if (routeData.showLine) { + $('#showLine').next().click(); + $('#showLine').attr('value', 'on'); + } + form.on('switch(showLine)', function(data) { + fly && fly.showLine(this.checked); + routeData && (routeData.showLine = this.checked); + }); + //杩涘害鏉� + setInterval(function() { + element.progress('ratio', ratio + '%'); + }, 500); + }); + //鎸夐挳浜嬩欢 + $(".bnt-box button").click(function() { + var id = this.id; + switch (id) { + case 'start': + fly && fly.isPause(false); + $('#start').hide(); + $('#stop').show(); + break; + case 'stop': + fly && fly.isPause(true); + $('#start').show(); + $('#stop').hide(); + break; + case 'exit': + parent.layer.close(parent.PathAnimationData.winIndex) + break; + } + }); + + function shuj (data) { + if (data.distanceTraveled) { + //宸叉极娓搁暱搴� + document.getElementById("distanceTraveled").innerText = getDistance(data.distanceTraveled); + } + if (data.time) { + //宸叉极娓告椂闂� + document.getElementById("time").innerText = getTime(parseInt(data.time)); + } + if (data.longitude) { + //缁忓害 + document.getElementById("jd").innerText = data.longitude.toFixed(7) + '掳'; + } + if (data.latitude) { + //绾害 + document.getElementById("wd").innerText = data.latitude.toFixed(7) + '掳'; + } + // if (data.speed) { + // //閫熷害 + // document.getElementById("sd").innerText = data.speed; + // } + if (data.height) { + //閫熷害 + document.getElementById("height").innerText = getDistance(data.height); + } + if (data.globeHeight) { + //閫熷害 + document.getElementById("globeHeight").innerText = getDistance(data.globeHeight); + } + if (data.ratio) { + ratio = parseInt(data.ratio * 100); + } + } + + //鑷姩鐐瑰嚮鍏抽棴绐楀彛鐐瑰叧闂簨浠� + function closeLayer () { + var $title = $(window.parent.document).find('.layui-layer-title'); + if ($title.length > 0) { + $title.each(function(i, item) { + if (item.innerHTML === "婕父璺嚎") { + var closeButton = $(item).parent().find('.layui-layer-close'); + var event = document.createEvent('MouseEvents'); + event.initEvent("click", false, true); + closeButton[0].dispatchEvent(event); + } + }) + } + } + + function getTime (data) { + var time; + if (data < 60) { + time = data + "绉�"; + } else if (data >= 60 && data < 3600) { + time = Math.floor(data / 60) + '鍒�' + data % 60 + '绉�'; + } else { + var h = Math.floor(data / 3600); + data -= h * 3600; + var m = Math.floor(data / 60); + data -= m * 60; + time = h + '灏忔椂' + m + '鍒�' + data + '绉�'; + } + return time; + } + + function getDistance (data) { + var dis; + data = parseFloat(data).toFixed(2); + data = parseFloat(data); + if (data >= 1000) { + dis = (data / 1000).toFixed(3) + "鍗冪背"; + } else { + dis = data + "绫�"; + } + return dis; + } + </script> </body> -</html> +</html> \ No newline at end of file -- Gitblit v1.9.3