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

潍坊知名网站建设服务商外包公司和劳务派遣哪个好一点

潍坊知名网站建设服务商,外包公司和劳务派遣哪个好一点,阿里云虚拟机怎么做多个网站,免费笑话网站系统1.弹窗没法向加入点位一样加入到地图内部,entity没法实现 2.使用绝对定位,将地图组件通过定位加入到地图上,注意弹窗层级一定在地图上 3.通过判断点击位置是否是点位来获取entity信息,将信息显示在弹窗 4.将点击处点位的经纬度转为…

1.弹窗没法向加入点位一样加入到地图内部,entity没法实现

2.使用绝对定位,将地图组件通过定位加入到地图上,注意弹窗层级一定在地图上

3.通过判断点击位置是否是点位来获取entity信息,将信息显示在弹窗

4.将点击处点位的经纬度转为浏览器视图的x,y坐标,设置弹窗位置

5.监听地图的缩放和拖动,实时改变显示的弹窗的位置,使弹窗一直保持在点位上方

效果:

地图组件(.vue)

<template><div id="cesiumContainer" class="e-cesium"><PopUp></PopUp></div>
</template><script lang="ts" setup>
import { onMounted } from 'vue';
import { mountedEvt } from './hooks';
import PopUp from './components/PopUp/index.vue';
onMounted(() => {mountedEvt();
});
</script>
<style lang="scss" scoped>
.e {&-cesium {height: 100%;width: 100%;box-sizing: border-box;}
}
</style>

 hooks.ts文件

import * as Cesium from 'cesium';
import { popInfo } from './config';
let viewer;
export function mountedEvt() {Cesium.Ion.defaultAccessToken ='自己的token';viewer = new Cesium.Viewer('cesiumContainer', {baseLayerPicker: false, // 关闭图层选择});let data = viewer.dataSources.add(Cesium.GeoJsonDataSource.load('/public/testData/pointLitter.json', {}),  // 加载点);data.then((dataSource) => {const entities = dataSource.entities.values;for (const item in entities) {const entity = entities[item];entity.billboard = {image: '/public/images/gg.png',  // 点位图片color: Cesium.Color.PINK,width: 40,height: 40,heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, // 贴地};entity.label = {text: entity.name,  // 标签font: '16px',pixelOffset: new Cesium.Cartesian3(0, 30, 0),};}});viewer.zoomTo(data);addPopEvt();
}
/*** @Description 弹窗* @Author: wms* @Date: 2023-11-17 11:02:33*/
export const addPopEvt = () => {let popBox = new Cesium.InfoBox(document.getElementById('popBox'));viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement,) {let pickedObject = viewer.scene.pick(movement.position);if (Cesium.defined(pickedObject) &&pickedObject.id instanceof Cesium.Entity) {var entity = pickedObject.id;if (entity.position) {// 显示弹窗popBox.container.style.visibility = 'visible';// 获取位置信息let entityPosition = entity.position.getValue(viewer.clock.currentTime,);popInfo.value = entity.properties;// 监听 Viewer 的 postRender 事件,在地图移动时更新弹窗位置viewer.scene.postRender.addEventListener(function () {try {if (entityPosition !== null) {let screenPosition =Cesium.SceneTransforms.wgs84ToWindowCoordinates(viewer.scene,entityPosition,);if (screenPosition) {let leftOffset =screenPosition.x -popBox.container.clientWidth / 2;  // 左右位置let topOffset =screenPosition.y -popBox.container.clientHeight -18;  // 上下位置popBox.container.style.left = leftOffset + 'px';popBox.container.style.top = topOffset + 'px';}}} catch (error) {console.log(error);}});} else {popBox.container.style.visibility = 'hidden';}} else {// 隐藏弹窗popBox.container.style.visibility = 'hidden';}}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
};

config.ts文件

import { Ref, ref } from 'vue';export const popInfo: Ref<any> = ref({});

 弹窗组件(components/PopUp/index.vue)

<template><div id="popBox" class="pop"><div class="pop-box"><div class="pop-box-title">{{ popInfo.title }}</div><div class="pop-box-line"></div><div class="pop-box-content"><div class="pop-box-content-item"><div class="pop-box-content-item-label"><span class="pop-box-content-item-labelCont">颜色:</span>{{ popInfo.color }}</div><div class="pop-box-content-item-label"><span class="pop-box-content-item-labelCont">描述:</span>{{ popInfo.symbol }}</div></div></div></div><div class="pop-box-triangle"></div></div>
</template><script lang="ts" setup>
import { popInfo } from '../../config';
import './index.scss';
</script>
<style lang="scss" scoped></style>

弹窗样式(components/PopUp/index.scss)

.pop {position: absolute;display: flex;flex-direction: column;width: 280px;z-index: 99;visibility: hidden;&-box {background-color: rgba(29, 54, 68, 0.8);&-title {font-size: 18px;color: #fff;padding: 12px;text-align: center;color: #fff;}&-line {background-color: #0d1536a9;height: 1px;}&-content {color: #fff;padding: 12px;font-size: 14px;&-item {&-labelCont {color: #fff;}}}&-triangle {align-self: center;width: 0;height: 0;border-top: 15px solid rgba(29, 54, 68, 0.8);border-right: 12px solid transparent;border-left: 12px solid transparent;}}
}

 geojson数据(测试数据  pointLitter.json)

{"type": "FeatureCollection","features": [{"type": "Feature","geometry": {"type": "Point","coordinates": [114,30]},"properties": {"title": "99","color": "#B9EB14","symbol":"风格独特"}},{"type": "Feature","geometry": {"type": "Point","coordinates": [114.001,30]},"properties": {"title": "0","symbol": "海角天涯","color": "#D13C3C"}},{"type": "Feature","geometry": {"type": "Point","coordinates": [114.002,30]},"properties": {"title": "8","symbol": "特别的晚风","marker-size":12,"color": "#C49D22"}},{"type": "Feature","geometry": {"type": "Point","coordinates": [114.003,30]},"properties": {"title": "2","symbol": "那年仲夏你背上行囊离开家古道旁我欲语泪先下庙里求签我哭诉青梅等竹马","color": "#8EE3A6"}},{"type": "Feature","geometry": {"type": "Point","coordinates": [114.004,30]},"properties": {"title": "3","symbol": "似水中月情迷着镜中花竹篱笆木琵琶拱桥月下谁在弹唱思念远方牵挂","color": "#34BE96"}}]
}
http://www.yayakq.cn/news/905058/

相关文章:

  • 网站域名综合查询wordpress用户注册登录插件
  • 企业小型网站要多少钱教做吃的网站
  • 九江网站建设旅游网站建设意义
  • 宁波网站建设多少钱一个做网站公司深
  • 做普通网站公司吗怎么用手机做软件
  • 新乡谷雨网络公司做的网站怎么样百度seo wordpress插件
  • 济南网站建设公司大全足球直播网站怎么做
  • 企业开发网站建设wordpress电视剧主题
  • 淘宝优惠网站怎么做四视图网站
  • 网站服务体系星空视频大全免费观看下载
  • 免费好用的网站wordpress页面宽度改为全屏
  • 帮做暑假作业网站移动网站建设作业
  • 淘客网站推广怎么做备案网站名称攻略
  • 重庆网站空间费用开发网站需要什么硬件
  • 设计网站高级感睢宁网站建设
  • js做网站登录框验证码安徽网站定制
  • 网站优化新闻网络网站是多少钱
  • 青海保险网站建设公司企业网站建设费多少钱
  • 中国建设银行湖南分行官网站衡水wap网站建设
  • 门户网站建设内容wordpress模板+保险
  • 无锡网站制作怎么样安徽经工建设集团网站
  • 看案例网站双语网站用什么程序做
  • 郑州网站建设白杨网络常见的网站开发环境
  • 济南最好的网站开发阿里云cdn wordpress错位
  • 海南省建设注册执业资格中心网站深圳龙华区好玩的地方
  • 网站制作切图重庆网站设计方案
  • 网站建设5000费用网上接做网站的单子
  • 台州做网站的公司有哪些公司旅游宣传网站建设方案
  • 有关做橡胶品的网站放置文件
  • 微网站开发提供的服务器青岛嘎嘎