当前位置: 首页 > news >正文

昔阳做网站公司怎样做网站平台

昔阳做网站公司,怎样做网站平台,发布新闻的平台有哪些,凡客网登录原理就是不断改变地图中心点,改变相机角度方向,明白这一点,其他地图引擎譬如cesium都可效仿,本人就是通过cesium的漫游实现四维图新的漫游,唯一不足的是转弯的时候不能丝滑转向,尝试过应该是四维图新引擎的…

原理就是不断改变地图中心点,改变相机角度方向,明白这一点,其他地图引擎譬如cesium都可效仿,本人就是通过cesium的漫游实现四维图新的漫游,唯一不足的是转弯的时候不能丝滑转向,尝试过应该是四维图新引擎的问题

/** @Description: * @Author: 大帅逼* @Date: 2023-08-17 17:52:09* @LastEditTime: 2023-08-21 15:39:15* @LastEditors: Do not edit* @Reference: */
export default function flyView (map, roadLine,nextIndex){let index = 1;let ding;let currentCenter;if(nextIndex){index = nextIndex;}const flyTime = 12000; //一段路程的飞行时间/*** 设置时间差* @returns 开始时间 结束时间*/function setExtentTime(time) {const startTime = new Date().getTime();const stopTime = startTime + time;return {stopTime,startTime };}/*** 相机转向角* @param {number} angle 角度* @returns {number} 弧度*/function bearings(startLat, startLng, destLat, destLng) {const y = Math.sin(destLng - startLng) * Math.cos(destLat);const x = Math.cos(startLat) * Math.sin(destLat) - Math.sin(startLat) * Math.cos(destLat) * Math.cos(destLng - startLng);const brng = Math.atan2(y, x);const brngDgr = brng * 180 / Math.PI;return brngDgr;}/*** 控制飞行动画*/function flyExtent() {if(index>=roadLine.length-1){index = 1;}const time = setExtentTime(flyTime);const bearing = Math.abs(bearings(roadLine[index - 1].lat, roadLine[index - 1].lng, roadLine[index].lat, roadLine[index].lng));map.setCenter([roadLine[index - 1].lng,roadLine[index - 1].lat])map.setBearing(Math.abs(bearing));// const currentBearing = map.getBearing();// const angle = (bearing - currentBearing) / 5000;// const nowHeading = map.getBearing();// console.log(-bearing);// 构造循环体const loop = function () {const delTime = new Date().getTime() - time.startTime;const stepLng = (roadLine[index].lng - roadLine[index - 1].lng) / flyTime * delTime;const stepLat = (roadLine[index].lat - roadLine[index - 1].lat) / flyTime * delTime;const currentBearing = map.getBearing();if (delTime > 0) {const endPosition = [roadLine[index - 1].lng + stepLng,roadLine[index - 1].lat + stepLat];map.setCenter([endPosition[0], endPosition[1]]);// if(currentBearing <= bearing) {//   map.setCameraBearing(currentBearing+angle);//   console.log(angle);// }} };// 定时器实现动画ding = setInterval(() => {loop();if (new Date().getTime() - time.stopTime >= 0) {console.log(111);clearInterval(ding);index = ++index >= roadLine.length ? 0 : index;if (index != 0) {console.log(index);flyExtent();}}}, 100);function stopFlyExtent() {clearInterval(ding);currentCenter = map.getCenter();}function startFlyExtent() {roadLine[index-1].lng = currentCenter.lngroadLine[index-1].lat = currentCenter.latflyExtent(index);}return {stopFlyExtent,startFlyExtent,index};}/*** 切换相机转向角*/// function changeCameraHeading () {//   // const changeTime = 2000;//   // const time = setExtentTime(changeTime);//   // const angle = (bearing - currentBearing) / changeTime;//   // 构造循环体//   // const loop = function () {//     const currentCenter = map.getCenter();//     // const currentBearing = map.getBearing();//     const bearing = Math.abs(bearings(currentCenter.lat,currentCenter.lng, roadLine[index].lat, roadLine[index].lng));//     // const delTime = new Date().getTime() - time.startTime;//     // const heading = delTime * angle + currentBearing;//   // if (delTime > 0) {//       map.setBearing(-bearing);//     // }//   // };//   // 定时器实现动画//   // const ding = setInterval(() => {//   //   loop();//   //   if (new Date().getTime() - time.stopTime >= 0) {//   //     console.log(111);//   //     clearInterval(ding);//   //     // index = ++index >= roadLine.length ? 0 : index;//   //     // if (index != 0) {//   //     //   console.log(index);//   //     //   flyExtent();//   //     // }//   //   }//   // }, 100);// }const control = flyExtent();return control;}const roadLine = [{lng: 118.30918373160092,lat: 33.8934430266404},{lng: 118.317598598913,lat: 33.89589007385073},{lng: 118.32260700135133,lat: 33.897263166704974},{lng: 118.32527174444655,lat: 33.897387332495924},
]
使用
this.control = flyView(map, roadLine);
this.control.startFlyExtent(); //控制开始
this.control.stopFlyExtent();//停止漫游
http://www.hkea.cn/news/486257/

相关文章:

  • 什么网站做国外批发百度推广自己怎么做
  • 网站管理工具百度推广可以自己开户吗
  • 三水网站制作中山做网站推广公司
  • ysl网站设计论文郑州seo地址
  • 做食品的网站设计要注意片多多可以免费看电视剧吗
  • 网站排名推广自己怎么做长沙seo代理商
  • 手机网站改版公司加盟关键词优化排名查询
  • html5 图片网站建设企业网站多少钱
  • 企业网站定制开发流程网络营销的概念及特点
  • 做火影网站背景图农村电商平台有哪些
  • 国内html5网站建设seo兼职工资一般多少
  • 青海西宁网站建设公司百度网络推广
  • 服装公司网站设计百度站长收录入口
  • 做搜索关键词任务网站网站维护是什么意思
  • 2018什么做网站百度网盘网页版入口
  • 深圳福田大型商城网站建设石家庄最新疫情最新消息
  • 网站版面结构chatgpt 网站
  • 网站后期推广是谁来做广州百度推广开户
  • 不上此网站枉做男人免费制作网站平台
  • 防红短链接生成佛山抖音seo
  • 网站建设php带数据库模板站长工具四叶草
  • 做网站客户拖着不验收店铺推广渠道有哪些方式
  • 站群系统哪个好用怎样进行seo推广
  • 淄博网站建设方案网络推广是做什么的
  • 网站建设销售工作职责seo平台怎么样
  • 免费的网站给一个百度seo优化服务项目
  • 现代广告创意设计郑州百度网站优化排名
  • 兰州网站建设哪家专业谷歌seo网站推广
  • 崇信门户网站留言回复上优化seo
  • 网站建设费用有哪些站长工具搜索