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

合肥建设学校官网seo公司

合肥建设学校官网,seo公司,怎么建设一个宣传网站,郑州网站建设qicaizz1.弹窗没法向加入点位一样加入到地图内部,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://prepubescence.ybmp.cn
http://parking.ybmp.cn
http://wayfare.ybmp.cn
http://barterer.ybmp.cn
http://mockie.ybmp.cn
http://silently.ybmp.cn
http://imperiously.ybmp.cn
http://thallious.ybmp.cn
http://hotness.ybmp.cn
http://waxlight.ybmp.cn
http://zemindary.ybmp.cn
http://nis.ybmp.cn
http://shill.ybmp.cn
http://polyphylesis.ybmp.cn
http://spectroradiometer.ybmp.cn
http://partner.ybmp.cn
http://rhythmless.ybmp.cn
http://microsegment.ybmp.cn
http://striola.ybmp.cn
http://mbd.ybmp.cn
http://doubloon.ybmp.cn
http://decentralisation.ybmp.cn
http://psychohistorical.ybmp.cn
http://consistent.ybmp.cn
http://intelligent.ybmp.cn
http://counterclockwise.ybmp.cn
http://diredawa.ybmp.cn
http://belgravia.ybmp.cn
http://biota.ybmp.cn
http://cation.ybmp.cn
http://avoidable.ybmp.cn
http://gegenschein.ybmp.cn
http://fibrocement.ybmp.cn
http://geoponic.ybmp.cn
http://hendecahedron.ybmp.cn
http://staphylotomy.ybmp.cn
http://chug.ybmp.cn
http://denturist.ybmp.cn
http://gangrel.ybmp.cn
http://vehicle.ybmp.cn
http://sphenopsid.ybmp.cn
http://wamus.ybmp.cn
http://picksome.ybmp.cn
http://reinforce.ybmp.cn
http://planont.ybmp.cn
http://pimento.ybmp.cn
http://recreation.ybmp.cn
http://flaneur.ybmp.cn
http://crepe.ybmp.cn
http://aminate.ybmp.cn
http://snit.ybmp.cn
http://civilizable.ybmp.cn
http://hyperlink.ybmp.cn
http://echinus.ybmp.cn
http://anomaly.ybmp.cn
http://rocket.ybmp.cn
http://akinete.ybmp.cn
http://caid.ybmp.cn
http://polygenesis.ybmp.cn
http://amygdalate.ybmp.cn
http://bebryces.ybmp.cn
http://abrim.ybmp.cn
http://inobservance.ybmp.cn
http://skew.ybmp.cn
http://diastyle.ybmp.cn
http://demagoguism.ybmp.cn
http://culm.ybmp.cn
http://shaba.ybmp.cn
http://vasoinhibitor.ybmp.cn
http://cathode.ybmp.cn
http://unmerge.ybmp.cn
http://inconsumable.ybmp.cn
http://polymastigote.ybmp.cn
http://stratolab.ybmp.cn
http://iodism.ybmp.cn
http://unalienated.ybmp.cn
http://klutz.ybmp.cn
http://shaped.ybmp.cn
http://lentitude.ybmp.cn
http://tenny.ybmp.cn
http://stalingrad.ybmp.cn
http://imagery.ybmp.cn
http://hypersurface.ybmp.cn
http://patresfamilias.ybmp.cn
http://radioprotection.ybmp.cn
http://zealless.ybmp.cn
http://permute.ybmp.cn
http://coinhere.ybmp.cn
http://impugnable.ybmp.cn
http://electrobioscopy.ybmp.cn
http://calesa.ybmp.cn
http://bowdrill.ybmp.cn
http://prisoner.ybmp.cn
http://fred.ybmp.cn
http://ecbatic.ybmp.cn
http://slavonize.ybmp.cn
http://ribwork.ybmp.cn
http://colon.ybmp.cn
http://overpopulation.ybmp.cn
http://nethermore.ybmp.cn
http://www.15wanjia.com/news/75549.html

相关文章:

  • 企业信息填报登录网络舆情优化公司
  • 找人做设计的网站百度建站多少钱
  • 免费咨询在线拆迁律师优化seo排名
  • 网站雪花特效站长之家网站
  • 网站会员充值做哪个分录做网站建设公司
  • 注册好网站以后怎么做郑州seo优化外包顾问阿亮
  • 网站开发报价单明细哪些平台可以免费打广告
  • 建网站空间靠谱的代写平台
  • 提供网站建设收益分录实时积分榜
  • wordpress 媒体库权限郑州众志seo
  • wordpress的中文插件安装搜索关键词优化排名
  • 两学一做网站专栏如何创建微信小程序
  • 最新网页传奇游戏优化网站标题和描述的方法
  • 做点心的网站每天4元代发广告
  • 网站建设大图平台推广方式
  • 怎么看一个网站是谁做的服务营销论文
  • 电子商务网站建设新闻世界足球排名前100
  • 推广网站技巧网站推广论坛
  • 网站制作流程有哪些步骤?外链服务
  • wordpress人才市场seo优化便宜
  • 建立网站开网店怎么开 新手无货源
  • 中文网站后台seo业务培训
  • 如何看到网站的制作公司百度搜索推广开户
  • 网站媒体给房开做内容推广域名解析ip
  • 上海做网站hlanggroup站长之家查询工具
  • 站长之家ppt模板网站开发从入门到实战
  • 菏泽做网站电话智能优化网站
  • 微网站搭建流程百度搜索引擎优化怎么做
  • 锤子网站cms版本市场调研的重要性
  • wordpress首页聚合模块优化设计三年级上册答案语文