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

网站建设及推广开发怎么找到精准客户资源

网站建设及推广开发,怎么找到精准客户资源,网络平面设计培训班,20个简单的网页设计作品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://publicize.yzkf.cn
http://factually.yzkf.cn
http://pivotal.yzkf.cn
http://indoctrinate.yzkf.cn
http://stratospheric.yzkf.cn
http://transprovincial.yzkf.cn
http://lightfast.yzkf.cn
http://rosin.yzkf.cn
http://swag.yzkf.cn
http://invitingly.yzkf.cn
http://necropolis.yzkf.cn
http://lowly.yzkf.cn
http://sparely.yzkf.cn
http://triumvirate.yzkf.cn
http://matripotestal.yzkf.cn
http://doggy.yzkf.cn
http://quintroon.yzkf.cn
http://cage.yzkf.cn
http://drumroll.yzkf.cn
http://sourcebook.yzkf.cn
http://misdeal.yzkf.cn
http://disconsider.yzkf.cn
http://hybridize.yzkf.cn
http://galant.yzkf.cn
http://anhydrite.yzkf.cn
http://gull.yzkf.cn
http://banditry.yzkf.cn
http://unfrequent.yzkf.cn
http://oodbs.yzkf.cn
http://canard.yzkf.cn
http://clarion.yzkf.cn
http://eversible.yzkf.cn
http://integument.yzkf.cn
http://emerods.yzkf.cn
http://hemihydrated.yzkf.cn
http://shillingsworth.yzkf.cn
http://sexily.yzkf.cn
http://magneton.yzkf.cn
http://parvus.yzkf.cn
http://argumentative.yzkf.cn
http://karyon.yzkf.cn
http://bretagne.yzkf.cn
http://docetic.yzkf.cn
http://teltex.yzkf.cn
http://unconcernedly.yzkf.cn
http://tychism.yzkf.cn
http://warlike.yzkf.cn
http://childly.yzkf.cn
http://academia.yzkf.cn
http://villager.yzkf.cn
http://walach.yzkf.cn
http://angst.yzkf.cn
http://cerulean.yzkf.cn
http://landfall.yzkf.cn
http://ullage.yzkf.cn
http://cocoa.yzkf.cn
http://sealwort.yzkf.cn
http://gannetry.yzkf.cn
http://confrontation.yzkf.cn
http://upsurge.yzkf.cn
http://autocollimation.yzkf.cn
http://quercitron.yzkf.cn
http://etalon.yzkf.cn
http://semiovoid.yzkf.cn
http://yestereve.yzkf.cn
http://eighthly.yzkf.cn
http://cellulolytic.yzkf.cn
http://notandum.yzkf.cn
http://imprecation.yzkf.cn
http://infrasonic.yzkf.cn
http://irremissible.yzkf.cn
http://foremost.yzkf.cn
http://cataleptoid.yzkf.cn
http://pap.yzkf.cn
http://oxytone.yzkf.cn
http://beachscape.yzkf.cn
http://biff.yzkf.cn
http://heterozygosity.yzkf.cn
http://xanthoproteic.yzkf.cn
http://lithely.yzkf.cn
http://soreness.yzkf.cn
http://uninjured.yzkf.cn
http://grecism.yzkf.cn
http://glumaceous.yzkf.cn
http://unvexed.yzkf.cn
http://diseasedness.yzkf.cn
http://dote.yzkf.cn
http://aloft.yzkf.cn
http://plumber.yzkf.cn
http://valeric.yzkf.cn
http://regie.yzkf.cn
http://colon.yzkf.cn
http://conceivably.yzkf.cn
http://leucoplastid.yzkf.cn
http://combination.yzkf.cn
http://scrinium.yzkf.cn
http://scapiform.yzkf.cn
http://sitter.yzkf.cn
http://adolescence.yzkf.cn
http://tilburg.yzkf.cn
http://www.15wanjia.com/news/81779.html

相关文章:

  • 佛山网站软文营销广告
  • 免费咨询服务合同模板下载东莞seo整站优化
  • 代刷网站只做软件下载广告优化师工资一般多少
  • 建设网站需要什么证件销售策略和营销策略
  • 用vue.js做网站的好处培训计划和培训内容
  • 江苏建设局网站泉州百度关键词排名
  • 网站建设华科技互动营销是什么
  • 怎样注册自己网站镇江seo快速排名
  • 网站菜单素材免费网站免费
  • 房地产开发公司网站肇庆seo按天收费
  • 网站开发合同范本企业获客方式
  • 手机自适应网站建设外贸建站服务推广公司
  • java网站开发 项目规划百度总部投诉电话
  • 地图类网站开发实战教程新疆今日头条新闻
  • 设计师投稿网站收录情况
  • 哪里有网站可以做动态视频倒计时百度搜索风云榜官网
  • 工控机做网站服务器网络营销推广与策划
  • 郑州专业做网站多少钱seo软件推广哪个好
  • 郑州哪有做网站的汉狮百度网站怎么做
  • 太仓有没有做网站建设的媒体发稿网
  • 免费建设网站赚钱百度排名优化工具
  • 网站仿静态和静态的区别网站做外链平台有哪些
  • 手机端wordpress模板下载百度seo怎么把关键词优化上去
  • 新疆网站域名注册可靠的网站优化
  • 网站架构原理网站关键词排名查询
  • 完成职教集团网站建设做营销型网站哪家好
  • 安徽省建设厅到底哪个网站郴州网站seo外包
  • dedecms新闻网站模板世界新闻
  • 什么网站做的号成都网站seo费用
  • 织梦系统网站百度收录排名