Commit d9dcd038 by 呼呼啦啦

test:添加成阿模型

parent 5af46c61
......@@ -8,7 +8,7 @@
"clean-cache": "rimraf node_modules/.cache/ && rimraf node_modules/.vite",
"clean-lib": "rimraf node_modules",
"preview": "vite preview",
"build": "npm run lint && vite build",
"build": "vite build",
"serve:dist": "http-server ./dist",
"lint": "npm run eslint",
"eslint": "eslint ./src/**/*.{js,jsx,vue,ts,tsx} --fix",
......
This source diff could not be displayed because it is too large. You can view the blob instead.
{"asset":{"generatetool":"cesiumlab3@www.cesiumlab.com/model2tiles","version":"1.1"},"extras":{"scenetree":"scenetree.json"},"geometricError":4985.810779890744,"properties":null,"refine":"REPLACE","root":{"boundingVolume":{"box":[-5.820766091346741e-10,0.2920130076818168,38.76158188004047,2492.905389945372,0,0,0,2139.679740175605,0,0,0,39.704499586485326]},"children":[{"boundingVolume":{"box":[-110.14034118503491,-22.137830397334028,45.40852046063659,1451.376700969989,0,0,0,537.5209116827041,0,0,0,33.5958463053146]},"content":{"uri":"NoLod_0.glb"},"geometricError":0.0,"refine":"REPLACE"},{"boundingVolume":{"box":[340.80431598664853,-253.80650719436449,28.772352373792955,385.6067238239901,0,0,0,306.1396584531659,0,0,0,15.750753864190338]},"content":{"uri":"NoLod_1.glb"},"geometricError":0.0,"refine":"REPLACE"},{"boundingVolume":{"box":[43.64250888625554,265.73336943200684,14.219345887134443,1973.0094062582507,0,0,0,1509.199732431005,0,0,0,14.45136417836728]},"content":{"uri":"NoLod_2.glb"},"geometricError":0.0,"refine":"REPLACE"},{"boundingVolume":{"box":[1170.8716893028563,502.5177545759484,16.993473127914513,558.4576110075915,0,0,0,445.6156534071529,0,0,0,6.10951453175033]},"content":{"uri":"NoLod_3.glb"},"geometricError":0.0,"refine":"REPLACE"},{"boundingVolume":{"box":[68.81223658131023,129.36493476346152,23.257050041721246,1667.9475898742721,0,0,0,800.727904195818,0,0,0,21.75489249846179]},"content":{"uri":"NoLod_4.glb"},"geometricError":0.0,"refine":"REPLACE"},{"boundingVolume":{"box":[-1279.1944841741367,127.12740054577867,16.00220596766392,334.3960220341778,0,0,0,575.9987546841837,0,0,0,5.281212458274911]},"content":{"uri":"NoLod_5.glb"},"geometricError":0.0,"refine":"REPLACE"},{"boundingVolume":{"box":[37.78925434502435,280.97718678415663,20.6071960939692,2011.7614539185306,0,0,0,1775.2133162957123,0,0,0,18.064793987322368]},"content":{"uri":"NoLod_6.glb"},"geometricError":0.0,"refine":"REPLACE"},{"boundingVolume":{"box":[-69.7195557735954,26.728972492402875,24.682551790986142,1492.4823194961048,0,0,0,575.0782449340732,0,0,0,12.649846120460612]},"content":{"uri":"NoLod_7.glb"},"geometricError":0.0,"refine":"REPLACE"},{"boundingVolume":{"box":[-4.848217145081435e-05,0.2918820869497267,20.898766891477504,2491.887204740864,0,0,0,2139.6570742760987,0,0,0,10.271988167349328]},"content":{"uri":"NoLod_8.glb"},"geometricError":0.0,"refine":"REPLACE"},{"boundingVolume":{"box":[57.86775436824939,43.84288695180561,21.687738080016956,1671.4065595500738,0,0,0,904.2341206660972,0,0,0,4.304441162235008]},"content":{"uri":"NoLod_9.glb"},"geometricError":0.0,"refine":"REPLACE"},{"boundingVolume":{"box":[356.3030429066066,201.18103808051626,42.3958508063381,1388.5910474742195,0,0,0,759.1823531631213,0,0,0,36.90856228855242]},"content":{"uri":"NoLod_10.glb"},"geometricError":0.0,"refine":"REPLACE"},{"boundingVolume":{"box":[392.4451073241433,-305.6477113005809,18.140210232755877,714.715874733952,0,0,0,554.7999130114857,0,0,0,7.381179375631687]},"content":{"uri":"NoLod_11.glb"},"geometricError":0.0,"refine":"REPLACE"},{"boundingVolume":{"box":[545.5376676622881,-499.05350945305094,14.918689140154394,186.8756849032233,0,0,0,65.83586873255211,0,0,0,4.422437195933972]},"content":{"uri":"NoLod_12.glb"},"geometricError":0.0,"refine":"REPLACE"},{"boundingVolume":{"box":[9.428791556017927,252.6360614885482,15.422073557033016,1899.8901148076693,0,0,0,1510.8722674097742,0,0,0,6.893104926695841]},"content":{"uri":"NoLod_13.glb"},"geometricError":0.0,"refine":"REPLACE"}],"geometricError":4985.810779890744,"transform":[-0.9678986948651501,-0.25134063833439124,0.0,0.0,0.12829925825031904,-0.49407324432524474,0.8599016976226674,0.0,-0.21612824158530788,0.8322977308413066,0.5104596658166588,0.0,-1379698.997929356,5313143.422616404,3236809.598433898,1.0]}}
......@@ -10,6 +10,13 @@ function UIComponent() {
<Space wrap>
<MarsButton
onClick={() => {
mapWork.showChengADemo()
}}
>
成阿
</MarsButton>
<MarsButton
onClick={() => {
mapWork.showQxShequDemo()
}}
>
......
import * as mars3d from "mars3d"
export let map
export let graphicLayer // 矢量图层对象
// 需要覆盖config.json中地图属性参数(当前示例框架中自动处理合并)
export const mapOptions = {
......@@ -74,6 +75,10 @@ export function onMounted(mapInstance) {
map.scene.globe.showGroundAtmosphere = false
}
// 创建矢量数据图层
graphicLayer = new mars3d.layer.GraphicLayer()
map.addLayer(graphicLayer)
const type = mars3d.Util.getRequestByName("data")
switch (type) {
case "qx-shequ":
......@@ -98,7 +103,7 @@ export function onMounted(mapInstance) {
showPntsGantaDemo()
break
default:
showQxShequDemo()
showChengADemo()
break
}
}
......@@ -111,6 +116,20 @@ export function onUnmounted() {
map = null
}
// 立体围墙扩散效果,面状
function addDemoGraphic1() {
const circleDiffuseWallGlow = new mars3d.graphic.DiffuseWall({
position: Cesium.Cartesian3.fromDegrees(104.559315, 30.692167, 27.88), // 圆中心点
style: {
diffHeight: 2000, // 高度
radius: 60, // 半径
color: "#ff0000",
speed: 10 // 速度
},
attr: { remark: "示例2" }
})
graphicLayer.addGraphic(circleDiffuseWallGlow)
}
/**
* 浏览器
*
......@@ -230,6 +249,63 @@ export function showQxShequDemo() {
})
}
export function showChengADemo() {
removeLayer()
tiles3dLayer = new mars3d.layer.TilesetLayer({
name: "石化工厂",
type: "3dtiles",
url: "/a/tileset.json",
position: { lng: 104.559315, lat: 30.692167, alt: 404.5 },
scale: 0.8,
// opacity: 0.5,
maximumScreenSpaceError: 1,
// shadows: Cesium.ShadowMode.DISABLED,
// 以下参数可以参考用于3dtiles总数据大,清晰度过高情况下进行性能优化。这不是一个通用的解决方案,但可以以此为参考。
skipLevelOfDetail: true,
loadSiblings: true,
cullRequestsWhileMoving: true,
cullRequestsWhileMovingMultiplier: 10,
preferLeaves: true,
dynamicScreenSpaceError: true,
preloadWhenHidden: true,
enableDebugWireframe: true, // 是否可以进行三角网的切换显示
// 以上为优化的参数
// popup: "all",
highlight: {
type: mars3d.EventType.click, // 默认为鼠标移入高亮,也可以指定click单击高亮
outlineEffect: true, // 采用OutlineEffect方式来高亮
color: "#00FF00",
width: 6
},
center: {
lng: 104.559315,
lat: 30.692167,
alt: 985,
pitch: -45,
roll: 0
},
flyTo: true
})
map.addLayer(tiles3dLayer)
// 加一些演示数据
addDemoGraphic1()
// 可以绑定Popup弹窗,回调方法中任意处理
tiles3dLayer.bindPopup(function (event) {
const attr = event.graphic.attr
// attr["视频"] = `<video src='http://data.mars3d.cn/file/video/lukou.mp4' controls autoplay style="width: 300px;" ></video>`;
return mars3d.Util.getTemplateHtml({ title: "石化工厂", template: "all", attr })
})
// 单击事件
tiles3dLayer.on(mars3d.EventType.click, function (event) {
console.log("单击了3dtiles图层", event)
})
}
/**
* 倾斜摄影 景区文庙
*
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论