marsgis / mars3d Goto Github PK
View Code? Open in Web Editor NEW【Mars3D平台 】主仓库,包含所有开源仓库清单导航
Home Page: http://mars3d.cn
License: Apache License 2.0
【Mars3D平台 】主仓库,包含所有开源仓库清单导航
Home Page: http://mars3d.cn
License: Apache License 2.0
加载3DTiles三维模型并使用setCursor设置鼠标状态后 移动模型鼠标状态会变回default
没距离选择点的时候,容易飘,很难选,很多时候明明是不天10米的距离,却测量显示是100多米,换了角度查看,原来测量点选到了高空中,可是空中明明没有任何东西。
我感觉这个是个BUG,选中的点根本不是我在图上点的的那个点。
-sorry wrong repository-
现有需求限制摄像机视角锁定在固定经纬度 / 固定朝向范围 / 固定高度范围.
尝试监听如下方法:
map.on(mars3d.EventType.cameraMoveStart, fun, this)
map.on(mars3d.EventType.cameraChanged, fun, this)
map.on(mars3d.EventType.cameraMoveEnd, fun, this)
发现传入 fun
内的参数不是 undefined
就是一个 number
类型值, 无法直接调整目标相机视角等参数.
另外在这些事件的监听器内尝试调用 map.camera.setView
等 API 均效果不佳, 会产生闪屏 / 视角错位等错误.
请问有无方法可以在监听器方法内获取事件实例?
或有无方法获取到即将提交到事件总线的事件实例?
另外能否修改获取到的事件实例成员参数以调整本次事件过程?
mars3d.Map
能否先实例化,再设置dom
react项目webpack配置,运行时包这个错误
Uncaught TypeError: Super expression must either be null or a function
at _0x49bb40. (mars3d.js:25)
at mars3d.js:30
at Module. (mars3d.js:30)
at _0x1a2b01 (mars3d.js:25)
Cesium.js:1 Uncaught TypeError: Cannot read properties of undefined (reading 'newValue')
at HTMLInputElement. (addmodel.html:309)
at HTMLInputElement.dispatch (jquery-2.1.4.min.js:3)
at HTMLInputElement.r.handle (jquery-2.1.4.min.js:3)
at Object.trigger (jquery-2.1.4.min.js:3)
at HTMLInputElement. (jquery-2.1.4.min.js:3)
at Function.each (jquery-2.1.4.min.js:2)
at n.fn.init.each (jquery-2.1.4.min.js:2)
at n.fn.init.trigger (jquery-2.1.4.min.js:3)
at n.fn.init.n.fn. [as change] (jquery-2.1.4.min.js:4)
at _0x1cac4e. (addmodel.html:385)
fixedRoute.on(mars3d.EventType.endItem, (event) => {
console.log('经过第'+fixedRoute._flyok_index+'个点', fixedRoute)
})
fixedRoute.on(mars3d.EventType.stop, (event) => {
console.log('路线走完了', fixedRoute)
})
fixedRoute.on(mars3d.EventType.end, (event) => {
console.log('路线走完了', fixedRoute)
})
监听endItem
事件 开始 触发了两次
以及 监听 stop
和end
均在路线结束的时候无法触发、或者是监听错了事件?
监听endItem
事件 开始的时候仅触发一次
graphicLayer = new mars3d.layer.GeoJsonLayer({ name: "全国省界", url: "//data.mars3d.cn/file/geojson/areas/100000_full.json", format: simplifyGeoJSON, // 用于自定义处理geojson symbol: { type: "polyline", styleOptions: { opacity:0.3, width: 2, color:"#f00" } }, flyTo: true })
graphicLayer.opacity = 1
使用new mars3d.graphic.Popup(options)
创建一个graphic,其中options中的timeRender设置为true
,html设置为回调函数,html并不会实时更新(html回调函数只会触发一次) 如下:
...
const showHtml = (event) => {
console.log('e', event)
return " 我是layer上绑定的Popup" + new Date().toLocaleTimeString()
}
const graphicPopup = new mars3d.graphic.Popup({
className: 'mesh_popup',
id,
name: EntityType.POPUP,
position: graphic.center,
style: {
html: showHtml,
closeButton: false,
horizontalOrigin: mars3d.Cesium.HorizontalOrigin.CENTER,
verticalOrigin: mars3d.Cesium.VerticalOrigin.BOTTOM,
offsetY: 4,
timeRender: true
} as any
})
graphicLayer.addGraphic(graphicPopup)
...
但是使用bindPopup功能是没有问题的
WebGL发生渲染错误,渲染已经停止,请刷新页面。
TypeError: Failed to execute 'shaderSource' on 'WebGLRenderingContext': parameter 1 is not of type 'WebGLShader'.
TypeError: Failed to execute 'shaderSource' on 'WebGLRenderingContext': parameter 1 is not of type 'WebGLShader'.
at createAndLinkProgram (http://127.0.0.1:8080/lib/Cesium/Cesium.js:1:966425)
at reinitialize (http://127.0.0.1:8080/lib/Cesium/Cesium.js:1:969903)
at initialize$b (http://127.0.0.1:8080/lib/Cesium/Cesium.js:1:969835)
at ShaderProgram._bind (http://127.0.0.1:8080/lib/Cesium/Cesium.js:1:973648)
at beginDraw (http://127.0.0.1:8080/lib/Cesium/Cesium.js:1:2592249)
at Context.draw (http://127.0.0.1:8080/lib/Cesium/Cesium.js:1:2593798)
at DrawCommand.execute (http://127.0.0.1:8080/lib/Cesium/Cesium.js:1:930877)
at ComputeEngine.execute (http://127.0.0.1:8080/lib/Cesium/Cesium.js:1:2560769)
at ComputeCommand.execute (http://127.0.0.1:8080/lib/Cesium/Cesium.js:1:1506762)
at executeComputeCommands (http://127.0.0.1:8080/lib/Cesium/Cesium.js:1:3317680)
closure 参数,闭合轨道圆在2d及2.5d模式中不生效。
包版本为 3.5.6
由于百度离线地图的切片规则和高德不同,所以加载百度离线地图位置不对。请问有何解决办法?
config.json配置
{
"pid": 10,
"name": "百度电子",
"icon": "http://localhost:9990/static/images/basemaps/bd_vec.png",
"type": "xyz",
"url": "http://localhost:9990/maps/baidu/vec/{z}/{x}/{y}.png",
"chinaCRS": "BAIDU",
"minimumLevel": 3,
"maximumLevel": 19
}
1.问题描述:
// 引入cesium基础库
import "mars3d-cesium/Build/Cesium/Widgets/widgets.css"
import * as Cesium from "mars3d-cesium"
// 导入mars3d主库
import "mars3d/dist/mars3d.css"
import * as mars3d from "mars3d"
在HelloWorld.vue文件中console.log(Cesium)报错:Cesium is not defined.
请问在图层管理中编辑完图层后,全部的config.json数据可以导出来吗
麻烦问一下,对于低配置的电脑仅使用2d地图卡顿特别明显,有没有什么办法解决
电脑配置:
mars3d.config:
config.txt
help
mars3d.thing.TerrainClip在版本3.6.0重写后,占用GPU太高,操作明显卡顿,希望能优化下该功能
link : http://mars3d.cn/editor-vue.html?id=graphic/apply/quyuNum
I need to debug the library, but I can't find the unminified source code. Where is it?
Thanks.
请问 VolumeCloud支持多大数据量 ? values: data.values, // 3D 数据集数组,能否传递Float32Array呢?
调用 map.addLayer(layer)
API 返回的 Promise 对象永远不会被 resolve
或 reject
.
最小复现代码:
<style scoped>
</style>
<template>
<div>
<div id="mars3dContainer" class="mars3d-container"></div>
</div>
</template>
<script setup>
import {markRaw, onMounted, onUnmounted} from 'vue'
// 引入cesium基础库
import 'mars3d-cesium/Build/Cesium/Widgets/widgets.css'
import * as Cesium from 'mars3d-cesium'
// 导入mars3d主库
import 'mars3d/dist/mars3d.css'
import * as mars3d from 'mars3d'
let Map = null
onMounted(async () => {
let map = new mars3d.Map('mars3dContainer')
Map = markRaw(map)
let layer = new mars3d.layer.GraphicLayer()
console.log('开始添加图层')
let result = await map.addLayer(layer)
console.log('完成添加图层')
})
onUnmounted(() =>
{
Map.destroy()
Map = null
})
</script>
测试时, 后续的 console.log
调用永远不会执行.
测试环境 | -- |
---|---|
vue | 3.2.47 |
@vitejs/plugin-vue | 4.1.0 |
mars3d | 3.5.0 |
vite-plugin-mars3d | 2.0.3 |
浏览器 | Chrome 111.0.5563.110 |
在向 GraphicLayer 添加 PolygonPrimitive 对象时报错,错误如下图:
示例代码:
const positions = [
new Cartesian3(-2877753.8912436897, 4848831.729657154, 2971314.4878532737),
new Cartesian3(-2877782.6632767506, 4848822.004413433, 2971302.1542773163),
new Cartesian3(-2877798.206913736, 4848827.3474626485, 2971278.564903176),
]
const polygonPrimitive = new mars3d.graphic.PolygonPrimitive({
positions,
style: {
color: '#d40000',
opacity: 0.4,
outline: true,
outlineColor: '#d40000',
outlineOpacity: 1,
clampToGround: true
}
})
// graphicLayer 的创建过程省略
graphicLayer.addGraphic(polygonPrimitive)
mars3d: v3.1.20
mars3d-cesium: 1.89.0
经过测试,遮罩层只能是在数据为单独一个面的情况下使用,如果在数据为多个面的情况(使用场景:某些行政区包括多个面)下,加载遮罩的geojson会导致程序无法正常显示,大佬是否有进一步优化此功能?
应该提供用户开关的选项或者提供自定义输出信息的能力,使用console.log
输出变量不会被GC有可能会导致内存泄漏,3d场景下还是蛮重要的
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.