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

cesium本地文档-天空盒-arcgis切片404-服务查询

1.vite-plugin-cesium

// vite-plugin-cesium 是一个 Vite 插件,用于在 Vite 项目中轻松集成和使用 Cesium 地图引擎。它简化了在 Vite 项目中使用 Cesium 的配置和引入过程。

// 具体来说,vite-plugin-cesium 主要提供了以下功能:

// 自动引入 Cesium:通过 vite-plugin-cesium 插件,在 Vite 项目中可以直接引入 Cesium,无需手动配置复杂的路径等信息。

// 处理 Cesium 的依赖关系:Cesium 本身有一些依赖关系需要处理,vite-plugin-cesium 可以帮助自动处理这些依赖,确保 Cesium 在 Vite 项目中正常运行。

// 优化加载:vite-plugin-cesium 可以优化 Cesium 的加载方式,避免不必要的网络请求和加载时间,提高项目性能。

// 总的来说,vite-plugin-cesium 简化了在 Vite 项目中使用 Cesium 的流程,使得开发者更容易地集成 Cesium 地图引擎到他们的项目中,并且提供了一些优化功能来改善用户体验。

2. cesium本地文档查看 

下载sdk,案例以1.106.1版本为例,执行build-docs生成本地http://localhost:8080/Build/Documentation

3.天空盒skyBox设置背景色-六张图片放在public下面,以相对路径引入

 cesium1.106.1

   <link href="<%= BASE_URL %>Cesium/Widgets/widgets.css" rel="stylesheet">   
   <script src="./Cesium/Cesium.js"></script>

4.arcgis切片404问题


addLayers (item) {let { layerUrl, name, visible, layerName } = item;// let img_layer = nullif (name.includes('天地图')) {let img_layer = viewer.imageryLayers.addImageryProvider(new Cesium.UrlTemplateImageryProvider({subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],url: item.layerUrl3d,show: visible,name: name,}));} else {let img_layer = viewer.imageryLayers.addImageryProvider(new Cesium.WebMapTileServiceImageryProvider({// url: layerUrl + "/WMTS/tile/1.0.0/" + layerName + "/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",// 行列号就会减少一倍url: layerUrl + "/tile/{TileMatrix}/{TileRow}/{TileCol}",tileMatrixSetID: "",tileWidth: 256,tileHeight: 256,tilingScheme: new Cesium.GeographicTilingScheme(),maximumLevel: 18,tileMatrixLabels: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"],}));img_layer.imageryProvider.layerName = name}},

5. 根据屏幕点击获取经纬度,进行arcgis服务查询

let _this = thislet handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);handler.setInputAction(function (event) {let pick = viewer.scene.pick(event.position);let ray = viewer.camera.getPickRay(event.position);const position = event.position;let cartesian = viewer.camera.pickEllipsoid(position, viewer.scene.globe.ellipsoid);// 将世界坐标转换为地理坐标(经度和纬度)let cartographic = Cesium.Cartographic.fromCartesian(cartesian);let longitude = Cesium.Math.toDegrees(cartographic.longitude);let latitude = Cesium.Math.toDegrees(cartographic.latitude);if (pick && pick.id._type) {let obj = pick.id;} else {_this.$emit('getPointHandle', [longitude, latitude])}}, Cesium.ScreenSpaceEventType.LEFT_CLICK)
// 获取点击点位信息getPointHandle (coordinate) {this.coordinate = coordinatelet allLayers = viewer.imageryLayers._layersthis.queryLayers = allLayers.filter(item => item.show && (item.imageryProvider.layerName === '公益林优化调整数据' || item.imageryProvider.layerName === '管护小班'))if (this.queryLayers.length) {const url = this.queryLayers[0].imageryProvider.url.split('/tile')[0]this.queryLayer(url, coordinate)this.queryLayers[0].imageryProvider.url.includes('name_km') ? this.isManagementShow = true : this.isForestShow = true}},
 queryLayer (propLayerUrl, coordinate) {let params = {geometry: coordinate.join(','),geometryType: 'esriGeometryPoint',outFields: '*',returnGeometry: true,f: 'pjson'};fetch(propLayerUrl + '/0/query?' + new URLSearchParams(params)).then(response => response.json()).then(json => {if (json.features && json.features.length) {if (this.polygonFeature) {// 删除数据并且销毁viewer.dataSources.remove(this.polygonFeature, true)this.polygonFeature = null}this.infForestManage = json.features[0].attributeslet geojson = {"type": "Polygon","coordinates": json.features[0].geometry.rings}// 转化geojson数据const geojsonDataSource = Cesium.GeoJsonDataSource.load(geojson, {stroke: Cesium.Color.HOTPINK,fill: Cesium.Color.PINK,strokeWidth: 2,markerSymbol: '?'})geojsonDataSource.then(dataSource => {this.polygonFeature = dataSourceviewer.dataSources.add(this.polygonFeature);viewer.zoomTo(dataSource)})} else {this.$message.warning('没有查询到该图层信息')this.infForestManage = {}}})},

6.进行wms服务查询

// 获取点击点位信息getPointHandle (coordinate) {this.coordinate = coordinateif (!this.isMap3) {let allLayers = gisMap.map.getLayers().getArray()this.queryLayers = allLayers.find(item => item.values_.visible && (item.values_.name == "公益林优化调整数据"))if (this.queryLayers) {this.loading = truethis.getProp2d().then(json => {this.queryLayer(json.data)})}} else {let allLayers = viewer.imageryLayers._layersthis.queryLayers = allLayers.find(item => item.show && (item.imageryProvider.layerName === '公益林优化调整数据'))if (this.queryLayers) {this.loading = truethis.getProp3d()}}},// 查询服务属性async getProp2d () {let source = this.queryLayers.getSource();let urlrd = source.getFeatureInfoUrl(this.coordinate, gisMap.map.getView().getResolution(), gisMap.map.getView().getProjection(),{ 'INFO_FORMAT': 'application/json', 'FEATURE_COUNT': 1 });return await axios.get(urlrd, {headers: {'Content-Type': 'application/json;charset=UTF-8'}}).then(json => {return json})},getProp3d () {const bboxSize = 0.001const [longitude, latitude] = this.coordinateconst url = this.queryLayers.imageryProvider.urlconst urlParams = new URLSearchParams({service: 'WMS',request: 'GetFeatureInfo',version: '1.1.0',layers: 'map1:gyl_20231123_84',query_layers: 'map1:gyl_20231123_84',bbox: `${longitude - bboxSize},${latitude - bboxSize},${longitude + bboxSize},${latitude + bboxSize}`,width: 101,height: 101,info_format: 'application/json',x: 50,y: 50,srs: 'EPSG:4326',transparent: true})const fullUrl = `${url}?${urlParams.toString()}`;fetch(fullUrl).then(response => {if (!response.ok) {throw new Error('Network response was not ok ' + response.statusText);}return response.json();}).then(data => {this.queryLayer(data)})},queryLayer (json) {this.loading = falseif (json.features && json.features.length) {const features = json.featuresif (!this.isMap3) {if (this.polygonFeature) {gisMap.featuresSource.removeFeature(this.polygonFeature)this.polygonFeature = null}this.infForestManage = features[0].propertiesthis.polygonFeature = gisMap.featureUtils.transformFeatureFromGeojson(features[0].geometry)gisMap.featuresSource.addFeature(this.polygonFeature)gisMap.flyTo(this.polygonFeature)} else {if (this.polygonFeature) {// 删除数据并且销毁viewer.dataSources.remove(this.polygonFeature, true)this.polygonFeature = null}this.infForestManage = features[0].propertiesconsole.log(features, 'features')let geojson = features[0].geometry// 转化geojson数据const geojsonDataSource = Cesium.GeoJsonDataSource.load(geojson, {stroke: Cesium.Color.HOTPINK,fill: Cesium.Color.PINK,strokeWidth: 2,markerSymbol: '?'})geojsonDataSource.then(dataSource => {this.polygonFeature = dataSourceviewer.dataSources.add(this.polygonFeature);viewer.zoomTo(dataSource)})}this.isForestShow = true} else {this.$message.warning('没有查询到该图层信息')this.infForestManage = {}}},

相关文章:

cesium本地文档-天空盒-arcgis切片404-服务查询

1.vite-plugin-cesium // vite-plugin-cesium 是一个 Vite 插件&#xff0c;用于在 Vite 项目中轻松集成和使用 Cesium 地图引擎。它简化了在 Vite 项目中使用 Cesium 的配置和引入过程。 // 具体来说&#xff0c;vite-plugin-cesium 主要提供了以下功能&#xff1a; // 自动…...

OpenMv图片预处理

本博客讲述的是获取一张图片首先对图像进行处理,比如畸形矫正,图像滤波等操作。 1.histeq()自适应直方图均衡 # 自适应直方图均衡例子 # # 此示例展示了如何使用自适应直方图均衡来改善图像中的对比度。 #自适应直方图均衡将图像分割成区域,然后均衡这些区域中的直方图,…...

Springboot 实战运用

一&#xff0c;基本配置 1&#xff0c;pom文件配置介绍 1.1继承 <parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.5.2</version><relativePath/> <…...

kafka的安装与简单使用

下载地址&#xff1a;Apache Kafka 1. 上传并解压安装包 tar -zxvf kafka_2.13-3.6.2.tgz 修改文件名&#xff1a;mv kafka_2.13-3.6.2 kafka 2. 配置环境变量 sudo vim /etc/profile #配置kafka环境变量 export KAFKA_HOME/export/server/kafka export PATH$PATH:$KAFKA…...

【服务器部署篇】Linux下Node.js的安装和配置

作者介绍&#xff1a;本人笔名姑苏老陈&#xff0c;从事JAVA开发工作十多年了&#xff0c;带过刚毕业的实习生&#xff0c;也带过技术团队。最近有个朋友的表弟&#xff0c;马上要大学毕业了&#xff0c;想从事JAVA开发工作&#xff0c;但不知道从何处入手。于是&#xff0c;产…...

【OrangePi AIpro】香橙派 AIpro 为AI而生

产品简介 OrangePi AIpro(8T)&#xff1a;定义边缘智能新纪元的全能开发板 在当今人工智能与物联网技术融合发展的浪潮中&#xff0c;OrangePi AIpro(8T)凭借其强大的硬件配置与全面的接口设计&#xff0c;正逐步成为开发者手中的创新利器。这款开发板不仅代表了香橙派与华为…...

AES算法

收集了几个博主 1、https://blog.csdn.net/shaosunrise/article/details/80219950 2、AESECB加密算法 C 语言代码实现_c语言aes-256-cbc-CSDN博客 3、https://www.cnblogs.com/hello-/articles/8718186.html 4、AES加密过程详解-CSDN博客 5、AES加密算法原理的详细介绍与实…...

自主创新助力科技强军,麒麟信安闪耀第九届军博会

由中国指挥与控制学会主办的中国指挥控制大会暨第九届北京军博会于5月17日-19日在北京国家会议中心盛大开展&#xff0c;政府、军队、武警、公安、交通、人防、航天、航空、兵器、船舶、电科集团等从事国防军工技术与产业领域的30000多名代表到场参加。 麒麟信安作为国产化方案…...

Android Retrofit 封装模版

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 文章目录 一、加上网络访问的权限二、引入依赖三、由API生成JavaBean四、封装Retrofit五、调用 一、加上网络访问的权限 <uses-permission android:name"android.p…...

【介绍下运维开发】

&#x1f3a5;博主&#xff1a;程序员不想YY啊 &#x1f4ab;CSDN优质创作者&#xff0c;CSDN实力新星&#xff0c;CSDN博客专家 &#x1f917;点赞&#x1f388;收藏⭐再看&#x1f4ab;养成习惯 ✨希望本文对您有所裨益&#xff0c;如有不足之处&#xff0c;欢迎在评论区提出…...

mybatis-plus中多条件查询使用and合or嵌套使用

背景 在实际项目中&#xff0c;数据库条件查询经常需有一些复杂的查询条件的SQL语句,将这些SQL语句用mybatis-plus 组件的实现的时候经常会费一些时间&#xff0c;下面对几种常见的SQL语句实现做个介绍以方便以后遇到时少走弯路提高开发效率。 案例 Data public class User{ …...

前端加密的方式汇总

目录 一、Base64编码 二、哈希算法 三、对称加密(AES/DES) 四、非对称加密(RSA) 五、加盐 六、Web Cryptography API 七、总结 随着信息和数据安全重要性的日益凸显&#xff0c;如何保证信息数据在传输的过程中的安全成为开发者重点关注的内容。前端加密通常是指在浏览…...

ELT 同步 MySQL 到 Doris

如何基于 Flink CDC 快速构建 MySQL 到 Doris 的 Streaming ELT 作业&#xff0c;包含整库同步、表结构变更同步和分库分表同步的功能。 本教程的演示都将在 Flink CDC CLI 中进行&#xff0c;无需一行 Java/Scala 代码&#xff0c;也无需安装 IDE。 准备阶段 # 准备一台已经…...

100个 Unity小游戏系列七 -Unity 抽奖游戏专题五 刮刮乐游戏

一、演示效果 二、知识点讲解 2.1 布局 void CreateItems(){var rewardLists LuckyManager.Instance.CalculateRewardId(rewardDatas, Random.Range(4, 5));reward_data_list reward_data_list ?? new List<RewardData>();reward_data_list.Clear();for (int i 0; …...

链游:区块链技术的游戏新纪元

随着区块链技术的快速发展&#xff0c;越来越多的行业开始探索与其结合的可能性&#xff0c;其中&#xff0c;游戏行业与区块链的结合尤为引人注目。链游&#xff0c;即基于区块链技术的游戏&#xff0c;正以其独特的优势&#xff0c;为玩家带来全新的游戏体验。本文将对链游进…...

格式化字符串

自学python如何成为大佬(目录):https://blog.csdn.net/weixin_67859959/article/details/139049996?spm1001.2014.3001.5501 格式化字符串是指先制定一个模板&#xff0c;在这个模板中预留几个空位&#xff0c;然后再根据需要填上相应的内容。这些空位需要通过指定的符号标记…...

错误信息:Traceback (most recent call last):

错误信息 Traceback (most recent call last): File "E:\python.learning\pythonDateExcavateTreat\数据挖掘课程设计\2_京东用户意向购买数据探索.py", line 74, in <module> df_ui df_ui.to_frame().reset_index() File "E:\python.learning\lib\site-…...

Thinkphp3.2.3网站后台不能访问如何修复

我是使用Thinkphp3.2.3新搭建的PHP网站&#xff0c;但是网站前台可以访问&#xff0c;后台访问出现如图错误&#xff1a; 由于我使用的Hostease的Linux虚拟主机产品默认带普通用户权限的cPanel面板&#xff0c;对于上述出现的问题不清楚如何处理&#xff0c;因此联系Hostease的…...

Golang 如何使用 gorm 存取带有 emoji 表情的数据

Golang 如何使用 gorm 存取带有 emoji 表情的数据 结论&#xff1a;在 mysql 中尽量使用 utf8mb4&#xff0c;不要使用 utf8。db报错信息&#xff1a;Error 1366 (HY000): Incorrect string value: \\xE6\\x8C\\xA5\\xE7\\xAC\\xA6...根本原因&#xff1a;emoji 4个字节&#x…...

计算机算法中的数字表示法——原码、反码、补码

目录 1.前言2.研究数字表示法的意义3.数字表示法3.1 无符号整数3.2 有符号数值3.3 二进制补码(Twos Complement, 2C)3.4 二进制反码(也称作 1 的补码, Ones Complement, 1C)3.5 减 1 表示法(Diminished one System, D1)3.6 原码、反码、补码总结 1.前言 昨天有粉丝让我讲解下定…...

BGP策略实验

一、实验要求 二、实验分析 1.先配置IP 2.再配置BGP 3.配置BGP策略 三、实验过程 要求 1. [r4]ip ip-prefix aa permit 192.168.10.0 24 [r4]route-policy aa permit node 10 [r4-route-policy]if-match ip-prefix aa [r4-route-policy]apply preferred-value 100 [r4]rout…...

目标检测 | R-CNN、Fast R-CNN与Faster R-CNN理论讲解

☀️教程&#xff1a;霹雳吧啦Wz ☀️链接&#xff1a;https://www.bilibili.com/video/BV1af4y1m7iL?p1&vd_sourcec7e390079ff3e10b79e23fb333bea49d 一、R-CNN R-CNN&#xff08;Region with CNN feature&#xff09;是由Ross Girshick在2014年提出的&#xff0c;在PAS…...

【busybox记录】【shell指令】mkdir

目录 内容来源&#xff1a; 【GUN】【mkdir】指令介绍 【busybox】【mkdir】指令介绍 【linux】【mkdir】指令介绍 使用示例&#xff1a; 创建文件夹 - 默认 创建文件夹 - 创建的同时指定文件权限 创建文件夹 - 指定多级文件路径&#xff0c;如果路径不存在&#xff0c…...

SQL刷题笔记day6-1

1从不订购的客户 分析&#xff1a;从不订购&#xff0c;就是购买订单没有记录&#xff0c;not in 我的代码&#xff1a; select c.name as Customers from Customers c where c.id not in (select o.customerId from Orders o) 2 部门工资最高的员工 分析&#xff1a;每个部…...

KITTI数据中pose含义

Folder ‘poses’: The folder ‘poses’ contains the ground truth poses (trajectory) for the first 11 sequences. This information can be used for training/tuning your method. Each file xx.txt contains a N x 12 table, where N is the number of frames of this …...

C++模拟实现stack和queue

1 stack 1.1概念 stl栈 1.2栈概念 1.3代码 2 queue 2.1概念 stl队列 2.2队列概念 2.3代码...

awtk踩坑记录一:awtk-web build.py编译过程笔记

工作需求&#xff0c;接触了awtk, 要求把界面部署到web上&#xff0c;期间因为各种编译问题卡的半死&#xff0c;提了不少issue, 经过几天补课&#xff0c;把项目的编译结构给摸了一遍&#xff0c;做个记录&#xff0c;也希望能帮到有同样问题的朋友。 之前python只是略接触过…...

docker容器中解决中文乱码

1. 找到dockerfile文件 2. 编辑Dockerfile 添加 ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 3. 生成新的镜像文件 FROM java17_yinpeng:latest MAINTAINER YP <2064676101QQ.COM> ADD jiquan_online_chat.jar jiquan_online_chat #CM…...

Javascript 位运算符(,|,^,<<,>>,>>>)

文章目录 一、什么是位运算&#xff1f;二、如何使用1. 位与&#xff08;AND&#xff09;&#xff1a;&用途&#xff08;1&#xff09;数据清零&#xff08;2&#xff09;判断奇偶 2. 位或&#xff08;OR&#xff09;&#xff1a;|用途&#xff08;1&#xff09;向下取整 3…...

Golang项目代码组织架构实践

Golang在项目结构上没有强制性规范&#xff0c;虽然这给了开发者很大的自由度&#xff0c;但也需要自己沉淀一套可行的架构。本文介绍了一种项目布局&#xff0c;可以以此为参考设计适合自己的 Golang 项目组织模式。原文: Golang Project Layout Go 有很多强制的或是约定俗成的…...