Skip to content

Commit 53b9176

Browse files
committed
同步代码
1 parent 600fce1 commit 53b9176

File tree

22 files changed

+178
-90
lines changed

22 files changed

+178
-90
lines changed

public/lib/mars3d/mars3d.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
* Mars3D三维可视化平台 mars3d
33
*
4-
* 版本信息:v3.9.6
5-
* 编译日期:2025-04-13 21:17
4+
* 版本信息:v3.9.7
5+
* 编译日期:2025-04-18 17:28
66
* 版权所有:Copyright by 火星科技 http://mars3d.cn
77
* 使用单位:火星科技免费公开版 ,2025-02-01
88
*/

public/lib/mars3d/mars3d.d.ts

Lines changed: 51 additions & 27 deletions
Large diffs are not rendered by default.

public/lib/mars3d/mars3d.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/lib/mars3d/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mars3d",
3-
"version": "3.9.5",
3+
"version": "3.9.7",
44
"description": "Mars3D三维可视化平台",
55
"main": "./mars3d.js",
66
"types": "./mars3d.d.ts",

public/lib/mars3d/plugins/echarts/mars3d-echarts.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/lib/mars3d/plugins/heatmap/mars3d-heatmap.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/lib/mars3d/plugins/mapv/mars3d-mapv.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/lib/mars3d/plugins/space/mars3d-space.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/lib/mars3d/plugins/wind/mars3d-wind.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/example/graphic/combine/flatBillboard/map.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -155,65 +155,65 @@ export function bindLayerPopup() {
155155
}
156156

157157
function getImageBySpeed(speed) {
158-
let windVaneUrl = "https://data.mars3d.cn/img/marker/wind/01.svg"
158+
let windVaneUrl = "https://data.mars3d.cn/img/marker/wind/01.png"
159159
if (speed >= 0 && speed <= 2) {
160-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/01.svg"
160+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/01.png"
161161
} else if (speed > 2 && speed <= 4) {
162-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/02.svg"
162+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/02.png"
163163
} else if (speed > 4 && speed <= 6) {
164-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/03.svg"
164+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/03.png"
165165
} else if (speed > 6 && speed <= 8) {
166-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/04.svg"
166+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/04.png"
167167
} else if (speed > 8 && speed <= 10) {
168-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/05.svg"
168+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/05.png"
169169
} else if (speed > 10 && speed <= 12) {
170-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/06.svg"
170+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/06.png"
171171
} else if (speed > 12 && speed <= 14) {
172-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/07.svg"
172+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/07.png"
173173
} else if (speed > 14 && speed <= 16) {
174-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/08.svg"
174+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/08.png"
175175
} else if (speed > 16 && speed <= 18) {
176-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/09.svg"
176+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/09.png"
177177
} else if (speed > 18 && speed <= 20) {
178-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/10.svg"
178+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/10.png"
179179
} else if (speed > 20 && speed <= 22) {
180-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/11.svg"
180+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/11.png"
181181
} else if (speed > 22 && speed <= 24) {
182-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/12.svg"
182+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/12.png"
183183
} else if (speed > 24 && speed <= 26) {
184-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/13.svg"
184+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/13.png"
185185
} else if (speed > 26 && speed <= 28) {
186-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/14.svg"
186+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/14.png"
187187
} else if (speed > 28 && speed <= 30) {
188-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/15.svg"
188+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/15.png"
189189
} else if (speed > 30 && speed <= 32) {
190-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/16.svg"
190+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/16.png"
191191
} else if (speed > 32 && speed <= 34) {
192-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/17.svg"
192+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/17.png"
193193
} else if (speed > 34 && speed <= 36) {
194-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/18.svg"
194+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/18.png"
195195
} else if (speed > 36 && speed <= 38) {
196-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/19.svg"
196+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/19.png"
197197
} else if (speed > 38 && speed <= 40) {
198-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/20.svg"
198+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/20.png"
199199
} else if (speed > 40 && speed <= 42) {
200-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/21.svg"
200+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/21.png"
201201
} else if (speed > 42 && speed <= 44) {
202-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/22.svg"
202+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/22.png"
203203
} else if (speed > 44 && speed <= 46) {
204-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/23.svg"
204+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/23.png"
205205
} else if (speed > 46 && speed <= 48) {
206-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/24.svg"
206+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/24.png"
207207
} else if (speed > 48 && speed <= 50) {
208-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/25.svg"
208+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/25.png"
209209
} else if (speed > 50 && speed <= 52) {
210-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/26.svg"
210+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/26.png"
211211
} else if (speed > 52 && speed <= 54) {
212-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/27.svg"
212+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/27.png"
213213
} else if (speed > 54 && speed <= 56) {
214-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/28.svg"
214+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/28.png"
215215
} else if (speed > 56) {
216-
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/29.svg"
216+
windVaneUrl = "https://data.mars3d.cn/img/marker/wind/29.png"
217217
}
218218
return windVaneUrl
219219
}

src/example/graphic/entity/polygon/map.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export function onMounted(mapInstance) {
3737
addDemoGraphic7(graphicLayer)
3838
addDemoGraphic8(graphicLayer)
3939
addDemoGraphic9(graphicLayer)
40+
addDemoGraphic10(graphicLayer)
4041
}
4142

4243
// 释放当前地图业务的生命周期函数,具体项目中时必须写onMounted的反向操作(如解绑事件、对象销毁、变量置空)
@@ -110,7 +111,9 @@ function addDemoGraphic2(graphicLayer) {
110111
// 测试整体平移
111112
setTimeout(function () {
112113
const centerNew = [117.169529, 31.841169, 235.3]
113-
const positionsNew = mars3d.PolyUtil.movePoints(graphic.positions, centerNew)
114+
const positionsNew = mars3d.PolyUtil.movePoints(graphic.positions, {
115+
center: centerNew
116+
})
114117
graphic.positions = positionsNew
115118
}, 6000)
116119
}
@@ -355,6 +358,28 @@ function addDemoGraphic9(graphicLayer) {
355358
})
356359
graphicLayer.addGraphic(graphic)
357360
}
361+
// 渐变面
362+
function addDemoGraphic10(graphicLayer) {
363+
const graphic = new mars3d.graphic.PolygonEntity({
364+
positions: [
365+
[117.308161, 31.907334, 16.9],
366+
[117.302609, 31.877667, 12.2],
367+
[117.337423, 31.873329, 13.6],
368+
[117.340994, 31.902117, 19.7]
369+
],
370+
style: {
371+
materialType: mars3d.MaterialType.PolyGradient,
372+
materialOptions: {
373+
color: "#004DFF",
374+
isInner: true,
375+
alphaPower: 2.6,
376+
diffusePower: 1.3
377+
}
378+
},
379+
attr: { remark: "示例10" }
380+
})
381+
graphicLayer.addGraphic(graphic)
382+
}
358383

359384
// 生成演示数据(测试数据量)
360385
export function addRandomGraphicByCount(count) {

src/example/graphic/primitive/addDynamicPosition-tileset/map.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ function random(min, max) {
119119
export async function startDrawGraphic() {
120120
const graphic = await graphicLayer.startDraw({
121121
type: "billboardP",
122+
frameRate: 1,
122123
position: {
123124
type: "time", // 时序动态坐标
124125
speed: 260

src/example/graphic/primitive/polygon/map.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export function onMounted(mapInstance) {
4242
addDemoGraphic10(graphicLayer)
4343
addDemoGraphic11(graphicLayer)
4444
addDemoGraphic12(graphicLayer)
45+
addDemoGraphic13(graphicLayer)
4546
}
4647

4748
// 释放当前地图业务的生命周期函数,具体项目中时必须写onMounted的反向操作(如解绑事件、对象销毁、变量置空)
@@ -405,6 +406,28 @@ function addDemoGraphic12(graphicLayer) {
405406
graphicLayer.addGraphic(graphic) // 还可以另外一种写法: graphic.addTo(graphicLayer)
406407
}
407408

409+
function addDemoGraphic13(graphicLayer) {
410+
const graphic = new mars3d.graphic.PolygonPrimitive({
411+
positions: [
412+
[117.308161, 31.907334, 16.9],
413+
[117.302609, 31.877667, 12.2],
414+
[117.337423, 31.873329, 13.6],
415+
[117.340994, 31.902117, 19.7]
416+
],
417+
style: {
418+
materialType: mars3d.MaterialType.PolyGradient,
419+
materialOptions: {
420+
color: "#004DFF",
421+
isInner: true,
422+
alphaPower: 2.6,
423+
diffusePower: 1.3
424+
}
425+
},
426+
attr: { remark: "示例13" }
427+
})
428+
graphicLayer.addGraphic(graphic)
429+
}
430+
408431
// 生成演示数据(测试数据量)
409432
export function addRandomGraphicByCount(count) {
410433
graphicLayer.clear()

src/example/graphic/video/video-edit/map.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ function addDemoGraphic1(graphicLayer) {
5555
style: {
5656
url: "https://data.mars3d.cn/file/video/lukou.mp4",
5757
opacity: 0.9,
58+
maskImage: "https://data.mars3d.cn/img/textures/video-mask.png", // 羽化视频四周,融合更美观
5859
distanceDisplayCondition_far: 5000
5960
}
6061
})

src/example/layer-tile/online/tdt/map.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ const creditHtml = `自然资源部 - <span>审图号:GS(2023)336号</span>
99
export const mapOptions = {
1010
scene: {
1111
center: { lat: 31.675177, lng: 117.323257, alt: 81193, heading: 359, pitch: -79 },
12-
highDynamicRange: false
12+
highDynamicRange: false,
13+
showSkyAtmosphere: false,
14+
fog: false,
15+
fxaa: false,
16+
globe: {
17+
showGroundAtmosphere: false
18+
}
1319
},
1420
// 方式1:在创建地球前的参数中配置
1521
basemaps: [

src/example/layer-tileset/type/bim-qiaoliang/map.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export const mapOptions = {
1313
baseColor: "rgba(0,0,0.0,0.5)",
1414
globe: {
1515
depthTestAgainstTerrain: true
16-
},
17-
highDynamicRange: true
16+
}
17+
// highDynamicRange: true //不可以加,加了看不到开挖的墙图片
1818
}
1919
}
2020

src/example/map/options/scene-center/map.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export function mapFlyToPoint() {
176176
map.graphicLayer.clear()
177177

178178
const position = [113.939351, 36.068144, 350.9]
179-
map.flyToPoint(position, { radius: 50000 })
179+
map.flyToPoint(position, { maxHeight: 5000 })
180180

181181
// 显示参照物
182182
const graphic = new mars3d.graphic.PointPrimitive({

src/example/query/geoserver/map.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export function query(text) {
4646
}
4747
})
4848

49-
5049
// queryMapserver.queryBySql({
5150
// cql_filter: `name like '%${text}%'`,
5251
// graphic: drawGraphic,
@@ -170,7 +169,11 @@ export function clearAll(noClearDraw) {
170169
geoJsonLayer.clear()
171170
}
172171

173-
export function flyToGraphic(graphic) {
172+
export function flyToGraphic(graphicId) {
173+
const graphic = geoJsonLayer.getGraphicById(graphicId)
174+
if (!graphic) {
175+
return
176+
}
174177
graphic.openHighlight()
175178
graphic.flyTo({
176179
radius: 1000, // 点数据:radius控制视距距离

src/example/thing/camera/tween/map.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ let roaming
1717
export function onMounted(mapInstance) {
1818
map = mapInstance // 记录map
1919

20-
// const tiles3dLayer = new mars3d.layer.TilesetLayer({
21-
// url: "https://data.mars3d.cn/3dtiles/max-ditiezhan/tileset.json",
22-
// maximumScreenSpaceError: 1,
23-
// popup: "all"
24-
// })
25-
// map.addLayer(tiles3dLayer)
20+
const tiles3dLayer = new mars3d.layer.TilesetLayer({
21+
url: "https://data.mars3d.cn/3dtiles/max-ditiezhan/tileset.json",
22+
position: { lat: 22.736443, lng: 108.380053, alt: -1 }, // 原始的
23+
// position: { lng: 117.139776, lat: 31.80001, alt: -69 }, // 改为到合肥的
24+
maximumScreenSpaceError: 1,
25+
popup: "all"
26+
})
27+
map.addLayer(tiles3dLayer)
2628

2729
const viewPoints = [
2830
{ id: 0, name: "地铁口", lat: 22.7407925, lng: 108.3793365, alt: 89.7, heading: 37.4, pitch: -7.1, duration: 2 },

src/example/thing/other/task/map.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ export function onMounted(mapInstance) {
139139
},
140140
polyline: {
141141
color: "#ffff00",
142-
width: 3
142+
width: 3,
143+
clampToGround: true
143144
},
144145
model: {
145146
url: "https://data.mars3d.cn/gltf/mars/man/walk.gltf",

src/example/thing/terrain/floodByMaterial/map.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ async function updateHeightRange(graphic, positions, callback) {
9797
const result = await mars3d.PolyUtil.interPolygonByDepth({ scene: map.scene, positions })
9898

9999
graphic.show = true // 恢复显示
100-
const minHeight = Math.ceil(result.minHeight)
101-
const maxHeight = Math.floor(result.maxHeight)
100+
const minHeight = Math.floor(result.minHeight)
101+
const maxHeight = Math.ceil(result.maxHeight)
102102

103103
callback(minHeight, maxHeight)
104104

src/example/thirdParty/turf/shortestPath/map.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export async function drawPolygon() {
4545
style: {
4646
color: "#00ffff",
4747
opacity: 0.4,
48+
clampToGround: true,
4849
outline: true,
4950
outlineWidth: 1,
5051
outlineColor: "#ffffff"
@@ -161,9 +162,10 @@ export function shortestPath() {
161162
const path = turf.shortestPath(startPoint, endPoint, options)
162163

163164
const positions = path.geometry.coordinates
164-
const polyonLine = new mars3d.graphic.PolylineEntity({
165+
const polyonLine = new mars3d.graphic.PolylinePrimitive({
165166
positions,
166167
style: {
168+
clampToGround: true,
167169
color: " #55ff33"
168170
}
169171
})

0 commit comments

Comments
 (0)