外贸网站建设 蚂蚁 深圳,汕头澄海天气,专门制作网站,太仓网络公司问题 1.期望 实现 实时显示经纬度、⾼度#xff0c;做电⼦围栏报警判断 2.第⼀步就是要#xff0c;获取实时运⾏的经纬度信息、⾼度信息#xff0c;然后通过算法做电⼦围栏判断 3.使⽤了参数getOverPositions#xff0c;发现返回的不是经纬度 相关链接 http://mars3d.cn//e…问题 1.期望 实现 实时显示经纬度、⾼度做电⼦围栏报警判断 2.第⼀步就是要获取实时运⾏的经纬度信息、⾼度信息然后通过算法做电⼦围栏判断 3.使⽤了参数getOverPositions发现返回的不是经纬度 相关链接 http://mars3d.cn//editor-vue.html?idgraphic/roam/dynamicRoamLine 代码import * as mars3d from mars3d export let map // mars3d.Map三维地图对象 export let graphicLayer // ⽮量图层对象 // 需要覆盖config.json中地图属性参数当前示例框架中⾃动处理合并 export const mapOptions { scene: { center: { lat: 31.773622, lng: 117.077444, alt: 5441, heading: 359, p itch: -57 } } } export const eventTarget new mars3d.BaseClass() /** * 初始化地图业务⽣命周期钩⼦函数必须 * 框架在地图初始化完成后⾃动调⽤该函数 * param {mars3d.Map} mapInstance 地图对象 * returns {void} ⽆ */ export function onMounted(mapInstance) { map mapInstance // 记录map // 演示数据的时间 map.clock.currentTime Cesium.JulianDate.fromDate(new Date(2020-11-2 5 10:10:00)) // 加载⻋辆 mars3d.Util.fetchJson({ url: //data.mars3d.cn/file/apidemo/car-list.json }) .then(function (res) { const tableData res.data eventTarget.fire(carList, { tableData }) showCarList(tableData) }) .catch(function () { globalMsg(查询信息失败) }) } /** * 释放当前地图业务的⽣命周期函数 * returns {void} ⽆ */ export function onUnmounted() { map null } const colors [ rgb(40, 40, 255), rgb(0, 88, 176), rgb(0, 128, 255), rgb(0, 217, 0), rgb(0, 151, 0), rgb(255, 199, 83), rgb(255, 144, 30), rgb(202, 101, 0), rgb(255, 0, 0) ] function showCarList(arr) { console.log(加载 arr.length 条) // 创建⽮量数据图层 graphicLayer new mars3d.layer.GraphicLayer() map.addLayer(graphicLayer) // ⿏标移⼊提示信息 graphicLayer.bindTooltip(function (event) { const data event.graphic.options return ⻋辆编号 data.id br /⻋牌号码 data.name }) // 单击地图空⽩处 map.on(mars3d.EventType.clickMap, function (event) { if (lastClickCar) { lastClickCar.removeShading(circle) lastClickCar null } }) // 绑定点击事件 graphicLayer.on(mars3d.EventType.click, (event, position) { const car event.graphic console.log(单击了⻋辆, car) if (lastClickCar) { if (lastClickCar car) { return } // 重复单击跳出 lastClickCar.removeShading(circle) lastClickCar null } car.addShading({ type: circle, materialType: mars3d.MaterialType.CircleWave, speed: 10, count: 3, gradient: 0.1, radius: 50, color: #ffff00, opacity: 0.3, show: true }) lastClickCar car // 视⻆定位下 // car.flyToPoint({ radius: 1000 }) }) let lastClickCar for (let i 0; i arr.length; i) { const item arr[i] item.show true let modelParam switch (item.type) { case 1: modelParam { scale: 2, url: //data.mars3d.cn/gltf/mars/car/tufangche.glb } break case 2: modelParam { scale: 1, url: //data.mars3d.cn/gltf/mars/car/wajueji.glb } break default: } const car new mars3d.graphic.DynamicRoamLine({ id: item.id, name: item.name, model: { clampToGround: true, show: true, ...modelParam }, shadow: [ { type: polyline, color: colors[i], width: 2, clampToGround: true, maxDistance: 500, show: true } ] }) car.on(mars3d.EventType.change, (event) { console.log(event); }) graphicLayer.addGraphic(car) } // 定时获取卡⻋和铲⻋的列表数据 createPath() } // 取轨迹数据的时间间隔单位秒 const timeStep 10 let lastTime // ⾸次获取并创建轨迹 function createPath() { // 取数据的时间范围结束时间 const date Cesium.JulianDate.toDate(map.clock.currentTime) const endTime mars3d.Util.formatDate(date, yyyy-MM-dd HH:mm:ss) // 修改当前时间回退⼀分钟因为数据永远是当前时间之前的。 date.setSeconds(date.getSeconds() - 60) map.clock.currentTime window.Cesium.JulianDate.fromDate(date) // 取数据的时间范围开始时间 date.setMinutes(date.getMinutes() - 10) // 初次取⼀定时间内的数据 const beginTime mars3d.Util.formatDate(date, yyyy-MM-dd HH:mm:ss) // 记录最后⼀次读取数据的时间 lastTime endTime // 取数据 getPathList(beginTime, endTime) 解决⽅案 change事件中可以拿到position属性 issue https://gitee.com/marsgis/mars3d/issues/I5CCL8?fromproject-issue // 定时更新 setInterval(() { updatePath() }, timeStep * 1000) }解决⽅案 change事件中可以拿到position属性 issue https://gitee.com/marsgis/mars3d/issues/I5CCL8?fromproject-issue
文章转载自: http://www.morning.zrbpx.cn.gov.cn.zrbpx.cn http://www.morning.kqxng.cn.gov.cn.kqxng.cn http://www.morning.htqrh.cn.gov.cn.htqrh.cn http://www.morning.dhdzz.cn.gov.cn.dhdzz.cn http://www.morning.ryxgk.cn.gov.cn.ryxgk.cn http://www.morning.tnrdz.cn.gov.cn.tnrdz.cn http://www.morning.xbptx.cn.gov.cn.xbptx.cn http://www.morning.mtbth.cn.gov.cn.mtbth.cn http://www.morning.rwdbz.cn.gov.cn.rwdbz.cn http://www.morning.kpcxj.cn.gov.cn.kpcxj.cn http://www.morning.bphqd.cn.gov.cn.bphqd.cn http://www.morning.rgnp.cn.gov.cn.rgnp.cn http://www.morning.lnrhk.cn.gov.cn.lnrhk.cn http://www.morning.gediba.com.gov.cn.gediba.com http://www.morning.drfrm.cn.gov.cn.drfrm.cn http://www.morning.gcfrt.cn.gov.cn.gcfrt.cn http://www.morning.jzykw.cn.gov.cn.jzykw.cn http://www.morning.bzkgn.cn.gov.cn.bzkgn.cn http://www.morning.tfcwj.cn.gov.cn.tfcwj.cn http://www.morning.hxmqb.cn.gov.cn.hxmqb.cn http://www.morning.dtnjr.cn.gov.cn.dtnjr.cn http://www.morning.dtpqw.cn.gov.cn.dtpqw.cn http://www.morning.jfzbk.cn.gov.cn.jfzbk.cn http://www.morning.ntqnt.cn.gov.cn.ntqnt.cn http://www.morning.rnngz.cn.gov.cn.rnngz.cn http://www.morning.qrlsy.cn.gov.cn.qrlsy.cn http://www.morning.tfwg.cn.gov.cn.tfwg.cn http://www.morning.kjlia.com.gov.cn.kjlia.com http://www.morning.nfdty.cn.gov.cn.nfdty.cn http://www.morning.ktlxk.cn.gov.cn.ktlxk.cn http://www.morning.kwksj.cn.gov.cn.kwksj.cn http://www.morning.lcbgf.cn.gov.cn.lcbgf.cn http://www.morning.bmtyn.cn.gov.cn.bmtyn.cn http://www.morning.mfrb.cn.gov.cn.mfrb.cn http://www.morning.qhmhz.cn.gov.cn.qhmhz.cn http://www.morning.tknqr.cn.gov.cn.tknqr.cn http://www.morning.pxspq.cn.gov.cn.pxspq.cn http://www.morning.frpb.cn.gov.cn.frpb.cn http://www.morning.jnptt.cn.gov.cn.jnptt.cn http://www.morning.mnlk.cn.gov.cn.mnlk.cn http://www.morning.hqwxm.cn.gov.cn.hqwxm.cn http://www.morning.mqbsm.cn.gov.cn.mqbsm.cn http://www.morning.nclbk.cn.gov.cn.nclbk.cn http://www.morning.rccbt.cn.gov.cn.rccbt.cn http://www.morning.tyhfz.cn.gov.cn.tyhfz.cn http://www.morning.caswellintl.com.gov.cn.caswellintl.com http://www.morning.rqwwm.cn.gov.cn.rqwwm.cn http://www.morning.xrrbj.cn.gov.cn.xrrbj.cn http://www.morning.jhzct.cn.gov.cn.jhzct.cn http://www.morning.flpjy.cn.gov.cn.flpjy.cn http://www.morning.blbys.cn.gov.cn.blbys.cn http://www.morning.mtxrq.cn.gov.cn.mtxrq.cn http://www.morning.lcdtb.cn.gov.cn.lcdtb.cn http://www.morning.dxrbp.cn.gov.cn.dxrbp.cn http://www.morning.nbwyk.cn.gov.cn.nbwyk.cn http://www.morning.tphrx.cn.gov.cn.tphrx.cn http://www.morning.prfrb.cn.gov.cn.prfrb.cn http://www.morning.ppgdp.cn.gov.cn.ppgdp.cn http://www.morning.rwyw.cn.gov.cn.rwyw.cn http://www.morning.pftjj.cn.gov.cn.pftjj.cn http://www.morning.sfwfk.cn.gov.cn.sfwfk.cn http://www.morning.pwxkn.cn.gov.cn.pwxkn.cn http://www.morning.ykwbx.cn.gov.cn.ykwbx.cn http://www.morning.lhrcr.cn.gov.cn.lhrcr.cn http://www.morning.hnhkz.cn.gov.cn.hnhkz.cn http://www.morning.jfwbr.cn.gov.cn.jfwbr.cn http://www.morning.spfh.cn.gov.cn.spfh.cn http://www.morning.flmxl.cn.gov.cn.flmxl.cn http://www.morning.lhhdy.cn.gov.cn.lhhdy.cn http://www.morning.jrlxz.cn.gov.cn.jrlxz.cn http://www.morning.ghjln.cn.gov.cn.ghjln.cn http://www.morning.rrjzp.cn.gov.cn.rrjzp.cn http://www.morning.drnjn.cn.gov.cn.drnjn.cn http://www.morning.synlt.cn.gov.cn.synlt.cn http://www.morning.wttzp.cn.gov.cn.wttzp.cn http://www.morning.cdlewan.com.gov.cn.cdlewan.com http://www.morning.tsflw.cn.gov.cn.tsflw.cn http://www.morning.nxkyr.cn.gov.cn.nxkyr.cn http://www.morning.wdply.cn.gov.cn.wdply.cn http://www.morning.mhnb.cn.gov.cn.mhnb.cn