Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
cesium_dev_kit
Advanced tools
这是一个 Cesium 开发工具包,包含图层加载、坐标转换、坐标拾取、相机控制、测量、标绘、模型加载、模型平移旋转缩放、模型/3Dtiles 视角位置调整、模型拖拽、天气(雨,雪,雾)场景、雷达扫描、信息框、流动线、发光线、动态墙等各种发光材质、后置场景效果、通视分析、透视分析、坡度分析、淹没分析、方量分析、地形开挖等各种分析案例。
https://www.benpaodehenji.com/cesiumDevKit
npm install cesium_dev_kit
import { initCesium } from 'cesium_dev_kit'
通过初始化initCesium
可以获取到所有扩展模块
Property | Type | Description | Default Value |
---|---|---|---|
cesiumGlobal | Object | Ceiusm 对象 | '' |
containerId | String | dom 容器 id | '' |
viewerConfig | Object | viewer 基础配置(与官网一致) | {} |
extreaConfig | Object | 额外参数配置,如 {logo:true// 是否显示 logo, depthTest:true //开启深度检测} | {} |
MapImageryList | Array | 配置底图,参考 ImageryProvider | [] |
defaultStatic | Array | 着色器使用的静态资源配置(如图片 url) | '' |
name | Type | Description |
---|---|---|
viewer | Object | Ceiusm 实例对象 |
material | Object | 材质模块(修改实体材质) |
graphics | Object | 图形模块(如创建 PolygonGraphics 对象等) |
math3d | Object | 三维数学工具 |
primitive | Object | 图元操作对象(如使用 primivite 创建 polygon 等) |
draw | Object | 绘制模块(如多边形,矩形) |
passEffect | Object | 后置处理模块 |
customCesiumPlugin | Object | 自定义传感器扩展 |
control | Object | 控制模块(如模型位置调整,拖拽等) |
plugin | Object | 额外插件(如拓展 css3 的动画 ,地形裁剪) |
base | Object | 基础模块(如坐标转换,图层初始化等) |
analysis | Object | 分析模块(如坡度,坡向,可视域,通视分析) |
attackArrowObj | Object | 标绘(攻击) |
straightArrowObj | Object | 标绘(直击) |
pincerArrowObj | Object | 标绘(钳击) |
ThreeJs | Object | 集成 ThreeJS 扩展对象 |
// test.vue
<template>
<div id="cesiumContainer" class="map3d-contaner"></div>
</template>
<script>
import { initCesium } from 'cesium_dev_kit'
import { defaultStatic } from '../defaultStaticConf'
export default {
mounted() {
this.initMap()
},
methods: {
initMap() {
const tempData = [
{
id: 3,
name: '高德地图02',
type: 'UrlTemplateImageryProvider',
classConfig: {
url: 'https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
},
interfaceConfig: {},
offset: '0,0',
invertswitch: 0,
filterRGB: '#ffffff',
showswitch: 1,
weigh: 13,
createtime: 1624346908,
updatetime: 1647395260,
}
]
const { viewer,material,graphics} =
new initCesium({
cesiumGlobal: Cesium,
containerId: 'cesiumContainer',
viewerConfig: {
infoBox: false,
shouldAnimate: true,
},
extraConfig: {
depthTest: true
},
MapImageryList: tempData,
defaultStatic
})
}
}
}
</script>
可根据功能需求导出单一扩展类,减少代码冗余
import {Graphics, Material,Primitive,Draw,Analysis,CustomCesiumPlugin,PassEffect,Plugin,ThreeJs} from 'cesium_dev_kit'
// test.vue
<template>
<div id="cesiumContainer" class="map3d-contaner"></div>
</template>
<script>
import { Draw } from 'cesium_dev_kit'
export default {
mounted() {
this.initMap()
},
methods: {
initMap() {
const tempData = [
{
id: 3,
name: '高德地图02',
type: 'UrlTemplateImageryProvider',
classConfig: {
url: 'https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
},
interfaceConfig: {},
offset: '0,0',
invertswitch: 0,
filterRGB: '#ffffff',
showswitch: 1,
weigh: 13,
createtime: 1624346908,
updatetime: 1647395260,
}]
const drawObj = new Draw({
cesiumGlobal: Cesium, // 全局Cesium对象
containerId: 'cesiumContainer', // 容器id
viewerConfig: { // 同官方的viewer配置相同
infoBox: false,
shouldAnimate: true,
},
extraConfig: {// 其他配置
logo:true, // 是否显示logo
depthTest:true // 是否开启深度测试
},
MapImageryList: tempData // 底图配置
defaultStatic // 默认服务器地址以及材质等基础信息配置,具体请参考src\views\example\defaultStaticConf\index.js
})
this.c_viewer = drawObj.viewer
this.draw = drawObj.draw
this.draw.setDefSceneConfig()
this.draw.setBloomLightScene()
this.load3dTiles(drawObj.viewer)
this.StraightArrowObj = drawObj.straightArrowObj
this.AttackArrowObj = drawObj.attackArrowObj
this.PincerArrowObj = drawObj.pincerArrowObj
}
}
}
</script>
<script type="text/javascript" src="index.umd.js"></script>
new cesium_dev_kit.initCesium({...})
本地开发推荐使用Chrome 80+
浏览器
支持现代(chrome,Firefox,Microsoft edge,etc.)浏览器, 不支持 IE
cesium-d3kit
drawarrowforcesium
vue3-ts-cesium-map-show
本项目包括但不限于借鉴和参考以上资料,非常感谢作者分享
欢迎感兴趣朋友加入一起完善功能,让工作效更高效、开发更简单、生活更惬意。
FAQs
Encapsulate common Cesium APIs to provide reference cases and modular packaging, out of the box - quickly achieve a variety of effect.
The npm package cesium_dev_kit receives a total of 12 weekly downloads. As such, cesium_dev_kit popularity was classified as not popular.
We found that cesium_dev_kit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.