Skip to content

Commit a6fea03

Browse files
committed
同步代码
1 parent 71c7bf0 commit a6fea03

File tree

87 files changed

+13705
-13054
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+13705
-13054
lines changed

public/lib/Cesium/Cesium.js

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

public/lib/Cesium/index.cjs

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

public/lib/Cesium/index.js

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

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.1
5-
* 编译日期:2025-02-23 11:21
4+
* 版本信息:v3.9.2
5+
* 编译日期:2025-03-02 20:20
66
* 版权所有:Copyright by 火星科技 http://mars3d.cn
77
* 使用单位:火星科技免费公开版 ,2025-02-01
88
*/

public/lib/mars3d/mars3d.d.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
/**
33
* Mars3D三维可视化平台 mars3d
44
*
5-
* 版本信息:v3.9.1
6-
* 编译日期:2025-02-23 11:21
5+
* 版本信息:v3.9.2
6+
* 编译日期:2025-03-02 20:20
77
* 版权所有:Copyright by 火星科技 http://mars3d.cn
88
* 使用单位:火星科技免费公开版 ,2025-02-01
99
*/
@@ -29004,7 +29004,7 @@ declare namespace Map {
2900429004
* @property [showSun] - 是否显示太阳,如修改对象可以用 [map.scene.sun]{@link http://mars3d.cn/api/cesium/Sun.html}
2900529005
* @property [showMoon] - 是否显示月亮,如修改对象可以用 [map.scene.moon]{@link http://mars3d.cn/api/cesium/Moon.html}
2900629006
* @property [showSkyAtmosphere] - 是否显示地球大气层外光圈,如修改对象可以用 [map.scene.skyAtmosphere]{@link http://mars3d.cn/api/cesium/SkyAtmosphere.html}
29007-
* @property [fog] - 是否启用雾化效果,如修改对象可以用 [map.scene.fog]{@link http://mars3d.cn/api/cesium/fog.html}
29007+
* @property [fog] - 是否启用雾化效果,如修改对象可以用 [map.scene.fog]{@link http://mars3d.cn/api/cesium/Fog.html}
2900829008
* @property [atmosphere] - 3D贴图和模型用于渲染天空大气、地面大气和雾的常见大气设置。
2900929009
* @property [atmosphere.lightIntensity = 10.0] - 用于计算地面大气颜色的光的强度。
2901029010
* @property [atmosphere.rayleighScaleHeight = 10000.0] - 地面大气散射方程中使用的瑞利尺度高度,单位为米。
@@ -39876,6 +39876,13 @@ declare namespace PolyUtil {
3987639876
* @returns 缓冲后的新坐标数组
3987739877
*/
3987839878
function bufferPoints(points: LngLatPoint[] | Cesium.Cartesian3[] | any[], width: number, steps?: number): LngLatPoint[];
39879+
/**
39880+
* 坐标数组整体移动到新的中心点位置
39881+
* @param points - 坐标数组
39882+
* @param centerNew - 新的中心点坐标
39883+
* @returns 移动后的坐标点数组
39884+
*/
39885+
function movePoints(points: LngLatPoint[] | Cesium.Cartesian3[] | any[], centerNew: Cesium.Cartesian3): Cesium.Cartesian3[];
3987939886
/**
3988039887
* 求坐标数组的矩形范围内 按 splitNum网格数插值的 granularity值
3988139888
* @param positions - 坐标数组

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.0",
3+
"version": "3.9.1",
44
"description": "Mars3D三维可视化平台",
55
"main": "./mars3d.js",
66
"types": "./mars3d.d.ts",

public/lib/mars3d/plugins/echarts/mars3d-echarts.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/plugins/heatmap/mars3d-heatmap.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/plugins/mapv/mars3d-mapv.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/plugins/space/mars3d-space.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/plugins/wind/mars3d-wind.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.

src/components/MarsSample/GraphicLayerState.tsx

Lines changed: 80 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import {
88
$message,
99
$alert,
1010
$showLoading,
11-
$hideLoading
11+
$hideLoading,
12+
MarsFormItem
1213
} from "@mars/components/MarsUI"
1314
import { Space, Upload } from "antd"
1415
import { Component } from "react"
@@ -254,7 +255,9 @@ export class GraphicLayerState extends Component<any, any> {
254255
enabledRightMenu: false,
255256
enabledShowHide: true,
256257
enabledOpacity: true,
258+
enabledCluster: true,
257259
isDrawing: false,
260+
isCluster: false,
258261
opacity: 1,
259262
currentPage: 5, // 分页查询每页条数
260263
graphicDataList: [], // 表格数据
@@ -333,7 +336,8 @@ export class GraphicLayerState extends Component<any, any> {
333336
if (graphics.length > 0) {
334337
this.setState({
335338
enabledOpacity: graphics[0].hasOpacity,
336-
enabledEdit: graphics[0].hasEdit
339+
enabledEdit: graphics[0].hasEdit,
340+
enabledCluster: graphics[0].hasCluster
337341
})
338342
}
339343
// 当加载矢量只有一条时,自动打开编辑面板
@@ -352,9 +356,9 @@ export class GraphicLayerState extends Component<any, any> {
352356

353357
// 触发属性编辑面板
354358
const editUpdateFun = mars3d.Util.funDebounce(that.openGraphicOptionsWidget, 500)
355-
layer.on([mars3d.EventType.click, mars3d.EventType.drawCreated, mars3d.EventType.editStart, mars3d.EventType.editStyle], editUpdateFun)
359+
layer.on([mars3d.EventType.click, mars3d.EventType.drawCreated, mars3d.EventType.editStart, mars3d.EventType.editStyle], editUpdateFun, that)
356360
const removeFun = mars3d.Util.funDebounce(that.closeGraphicOptionsWidget, 500)
357-
layer.on(mars3d.EventType.removeGraphic, removeFun)
361+
layer.on(mars3d.EventType.removeGraphic, removeFun, that)
358362

359363
// 表格相关操作 - 添加、删除
360364
this.initGraphicableData(layer)
@@ -385,6 +389,7 @@ export class GraphicLayerState extends Component<any, any> {
385389
initGraphicableData(graphicLayer) {
386390
const list = graphicLayer.graphics
387391

392+
let graphic
388393
list.forEach((item) => {
389394
if (item.isPrivate) {
390395
return
@@ -395,12 +400,22 @@ export class GraphicLayerState extends Component<any, any> {
395400
name: getGraphicName(item)
396401
})
397402
rowKeys.push(item.id)
403+
404+
graphic = item
398405
})
399406

400407
this.setState({
401408
graphicDataList: [...graphicDataList],
402409
rowKeys: [...rowKeys]
403410
})
411+
412+
if (graphic) {
413+
this.setState({
414+
enabledOpacity: graphic.hasOpacity,
415+
enabledEdit: graphic.hasEdit,
416+
enabledCluster: graphic.hasCluster
417+
})
418+
}
404419
}
405420

406421
// 展示属性面板
@@ -415,6 +430,9 @@ export class GraphicLayerState extends Component<any, any> {
415430
return
416431
}
417432

433+
console.log("this.props?.customEditor", this.props)
434+
console.log("graphic.type", graphic.type)
435+
418436
if (this.props?.customEditor === graphic.type) {
419437
this.closeGraphicOptionsWidget() // 关闭属性面板
420438
this.props.onStartEditor({ graphicId: graphic.id, graphicName: getGraphicName(graphic) })
@@ -433,8 +451,8 @@ export class GraphicLayerState extends Component<any, any> {
433451
}
434452

435453
closeGraphicOptionsWidget() {
436-
if (this.props.onStopEditor) {
437-
this.props?.onStopEditor() // 关闭参数调节面板
454+
if (this.props?.onStopEditor) {
455+
this.props.onStopEditor() // 关闭参数调节面板
438456
} else {
439457
disable("graphic-options")
440458
}
@@ -523,6 +541,13 @@ export class GraphicLayerState extends Component<any, any> {
523541
})
524542
}
525543

544+
onChangClustering = (checked: boolean) => {
545+
const layer = getManagerLayer()
546+
layer.clusterEnabled = checked
547+
548+
this.setState({ isCluster: checked })
549+
}
550+
526551
// ***************************** 数据维护 *********************** //
527552
// drawLabel1
528553
onClickStartDraw() {
@@ -548,7 +573,7 @@ export class GraphicLayerState extends Component<any, any> {
548573

549574
// 是否编辑
550575
onChangeHasEdit(checked: boolean) {
551-
mapWork.graphicLayer.hasEdit = checked
576+
mapWork.graphicLayer.isAutoEditing = checked
552577

553578
this.setState({
554579
hasEdit: checked
@@ -712,8 +737,8 @@ export class GraphicLayerState extends Component<any, any> {
712737
"f-dn": !this.state.interaction
713738
})}
714739
>
715-
<Space>
716-
<span className="mars-pannel-item-label">图层交互:</span>
740+
<span className="mars-pannel-item-label">数据维护:</span>
741+
<Space wrap style={{ width: "350px" }}>
717742
<MarsCheckbox checked={this.state.enabledPopup} onChange={(e) => this.onChangePopup(e.target.checked)}>
718743
单击Popup
719744
</MarsCheckbox>
@@ -723,6 +748,11 @@ export class GraphicLayerState extends Component<any, any> {
723748
<MarsCheckbox checked={this.state.enabledRightMenu} onChange={(e) => this.onChangeRightMenu(e.target.checked)}>
724749
右键菜单
725750
</MarsCheckbox>
751+
{this.state.enabledCluster && (
752+
<MarsCheckbox checked={this.state.isCluster} onChange={(e) => this.onChangClustering(e.target.checked)}>
753+
是否聚合
754+
</MarsCheckbox>
755+
)}
726756
</Space>
727757
</div>
728758

@@ -747,51 +777,50 @@ export class GraphicLayerState extends Component<any, any> {
747777
取消绘制
748778
</MarsButton>
749779

750-
<span
751-
className={classNames({
752-
"f-dn": !this.state.interaction && this.state.enabledEdit
753-
})}
754-
>
755-
{this.state.interaction && this.state.enabledEdit ? (
756-
<MarsCheckbox checked={this.state.hasEdit} onChange={(e) => this.onChangeHasEdit(e.target.checked)}>
757-
是否编辑
758-
</MarsCheckbox>
759-
) : (
760-
""
761-
)}
762-
</span>
780+
{this.state.interaction && this.state.enabledEdit ? (
781+
<MarsCheckbox checked={this.state.hasEdit} onChange={(e) => this.onChangeHasEdit(e.target.checked)}>
782+
是否编辑
783+
</MarsCheckbox>
784+
) : (
785+
""
786+
)}
763787

764788
<MarsCheckbox checked={this.state.hasTable} onChange={(e) => this.setState({ hasTable: e.target.checked })}>
765789
显示列表
766790
</MarsCheckbox>
767791
</Space>
768792
</div>
769793

770-
<div className="f-mb">
771-
<Space>
772-
<span className="mars-pannel-item-label">数据测试:</span>
773-
<MarsInputNumber
774-
defaultValue={this.state.count}
775-
{...{ min: 1, max: 1000000, step: 1 }}
776-
onChange={(data: number) => {
777-
this.setState({
778-
count: data
779-
})
780-
}}
781-
style={{ width: "152px" }}
782-
></MarsInputNumber>
783-
<MarsButton onClick={() => this.addRandomGraphicByCount()}>生成</MarsButton>
784-
<MarsButton onClick={() => this.onClickClear()}>
785-
<MarsIcon icon="delete" />
786-
清除
787-
</MarsButton>
788-
</Space>
789-
</div>
794+
{mapWork.addRandomGraphicByCount && (
795+
<div className="f-mb">
796+
<Space>
797+
<span className="mars-pannel-item-label">数据测试:</span>
798+
<MarsInputNumber
799+
defaultValue={this.state.count}
800+
{...{ min: 1, max: 1000000, step: 1 }}
801+
onChange={(data: number) => {
802+
this.setState({
803+
count: data
804+
})
805+
}}
806+
style={{ width: "152px" }}
807+
></MarsInputNumber>
808+
<MarsButton onClick={() => this.addRandomGraphicByCount()}>生成</MarsButton>
809+
<MarsButton onClick={() => this.onClickClear()}>
810+
<MarsIcon icon="delete" />
811+
清除
812+
</MarsButton>
813+
</Space>
814+
</div>
815+
)}
790816

791817
<div className="f-mb">
792818
<Space>
793819
<span className="mars-pannel-item-label">数据导出:</span>
794820

821+
<MarsButton onClick={() => this.expJSONFile()} title={"导出图层数据为JSON文件"}>
822+
导出数据
823+
</MarsButton>
795824
<Upload
796825
{...{
797826
name: "file",
@@ -804,20 +833,21 @@ export class GraphicLayerState extends Component<any, any> {
804833
onChange: (info: any) => this.onClickImpFile(info)
805834
}}
806835
>
807-
<MarsButton title={"打开GeoJSON"}>
836+
<MarsButton title={"打开历史导出的JSON文件图层数据"}>
808837
<MarsIcon icon="folder-open" />
809-
打开
838+
导入数据
810839
</MarsButton>
811840
</Upload>
841+
{!mapWork.addRandomGraphicByCount && (
842+
<MarsButton danger onClick={() => this.onClickClear()}>
843+
清除
844+
</MarsButton>
845+
)}
812846

813-
<MarsButton onClick={() => this.expGeoJSONFile()} title={"保存GeoJSON"}>
847+
{/* <MarsButton onClick={() => this.expGeoJSONFile()} title={"保存GeoJSON"}>
814848
<MarsIcon icon="save-one" />
815849
导出GeoJSON
816-
</MarsButton>
817-
818-
<MarsButton onClick={() => this.expJSONFile()} title={"导出构造参数Json"}>
819-
导出构造JSON
820-
</MarsButton>
850+
</MarsButton> */}
821851
</Space>
822852
</div>
823853

src/components/MarsUI/MarsInput/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const MarsInputGroup = forwardRef<any, MarsInputGroupProps>(({ value = []
4242
<Space>
4343
{values.map((item, i) => (
4444
<MarsInput
45-
value={item}
45+
defaultValue={item}
4646
key={i}
4747
suffix={units[i]}
4848
onChange={(e) => {

src/components/MarsUI/MarsTree/index.less

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
}
3838

3939
.ant-tree-node-selected {
40-
background: none !important;
40+
background: @mars-select-bg;
41+
color: @mars-base-color;
4142
}
4243

4344
.ant-tree-switcher-noop::before {

src/components/MarsUI/base.less

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,17 @@
9898
padding: 10px;
9999
}
100100
}
101+
102+
.mars-space {
103+
display: flex;
104+
105+
.ant-space-item {
106+
flex: 1;
107+
.mars-button {
108+
width: 100%;
109+
}
110+
}
111+
}
101112
}
102113

103114
.mars-primary-table {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.active-row {
2+
background-color: var(--mars-hover-color, #1487f5) !important;
3+
}

0 commit comments

Comments
 (0)