Skip to content

Commit

Permalink
同步代码
Browse files Browse the repository at this point in the history
  • Loading branch information
muyao1987 committed Dec 11, 2024
1 parent 9418706 commit ba7b72d
Show file tree
Hide file tree
Showing 25 changed files with 1,018 additions and 839 deletions.
7 changes: 4 additions & 3 deletions public/config/example.json
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,8 @@
"RouteLine.js",
"ZoomIn.js",
"ZoomOut.js",
"FlickerEntity.js"
"GraphicStyle.js",
"CreateTarget.js"
]
}
]
Expand Down Expand Up @@ -3300,7 +3301,7 @@
]
},
{
"name": "鼠标单击信息窗",
"name": "Popup鼠标单击信息窗",
"thumbnail": "control-inside-popup.jpg",
"main": "control/inside/popup",
"api": "Popup.html",
Expand All @@ -3310,7 +3311,7 @@
]
},
{
"name": "鼠标移入信息窗",
"name": "Tooltip鼠标移入信息窗",
"thumbnail": "control-inside-tooltip.jpg",
"main": "control/inside/tooltip",
"api": "Tooltip.html",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions public/lib/mars3d/mars3d.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Mars3D三维可视化平台 mars3d
*
* 版本信息:v3.8.9
* 编译日期:2024-12-10 22:08
* 版本信息:v3.8.10
* 编译日期:2024-12-11 21:55
* 版权所有:Copyright by 火星科技 http://mars3d.cn
* 使用单位:免费公开版 ,2024-08-01
*/
Expand Down
1,445 changes: 727 additions & 718 deletions public/lib/mars3d/mars3d.d.ts

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions public/lib/mars3d/mars3d.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions public/lib/mars3d/plugins/echarts/mars3d-echarts.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions public/lib/mars3d/plugins/heatmap/mars3d-heatmap.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions public/lib/mars3d/plugins/mapv/mars3d-mapv.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions public/lib/mars3d/plugins/space/mars3d-space.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/lib/mars3d/plugins/tdt/mars3d-tdt.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions public/lib/mars3d/plugins/wind/mars3d-wind.js

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions public/temp/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ function init() {
if (!mars3d.Util.webglreport()) {
mars3d.Util.webglerror()
}

// 读取 config.json 配置文件
mars3d.Util.fetchJson({ url: "config/config.json" })
.then(function (json) {
console.log("读取 config.json 配置文件完成", json) // 打印测试信息
mars3d.Log.logInfo("读取 config.json 配置文件完成", json) // 打印测试信息

// 构建地图
const initMapFun = window.initMap ? window.initMap : globalInitMap
Expand All @@ -35,7 +36,7 @@ function init() {
// parentGlobal.mapWork = window // 这句话是将当前js对象绑定赋予给index.项目内进行调用
})
.catch(function (error) {
console.log("加载JSON出错", error)
mars3d.Log.logError("加载JSON出错", error)
globalAlert(error ? error.message : "加载JSON出错")
})
}
Expand All @@ -50,7 +51,7 @@ function globalInitMap(options) {
window.mapOptions = options = mars3d.Util.merge(options, window.mapOptions)
}
}
console.log("地图构造参数为", options)
mars3d.Log.logInfo("地图构造参数为", options)

// 创建三维地球场景
return new mars3d.Map("mars3dContainer", options)
Expand Down
28 changes: 5 additions & 23 deletions src/components/mars-sample/graphic-layer-state.vue
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ onMounted(() => {
// 修改了矢量数据
graphicLayer.on([mars3d.EventType.editMovePoint, mars3d.EventType.editStyle, mars3d.EventType.editRemovePoint], function (e) {
updateEditor(e.graphic)
showEditor(e.graphic)
})
// 停止编辑
Expand All @@ -753,7 +753,6 @@ onMounted(() => {
})
})
let lastUUid = ""
function showEditor(graphic: any) {
if (graphic.isDestroy || graphic.isPrivate) {
return
Expand All @@ -774,44 +773,27 @@ function showEditor(graphic: any) {
graphic._conventStyleJson = true // 只处理一次
}
if (lastUUid !== graphic.id) {
activate({
name: "graphic-editor",
if (isActivate("graphic-editor")) {
updateWidget("graphic-editor", {
data: {
graphic: markRaw(graphic)
}
})
lastUUid = graphic.id
}
}
function updateEditor(graphic) {
if (graphic.isDestroy || graphic.isPrivate) {
return
}
if (props.customEditor) {
closeEditor() // 关闭属性面板
emit("onStartEditor", {
graphicId: graphic.id,
graphicName: getGraphicName(graphic)
})
} else {
updateWidget("graphic-editor", {
activate({
name: "graphic-editor",
data: {
graphic: markRaw(graphic)
}
})
}
}
function closeEditor() {
if (props.customEditor) {
emit("onStopEditor")
} else {
disable("graphic-editor")
lastUUid = ""
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/example/graphic/entity/polyline/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,8 @@ function addDemoGraphic16(graphicLayer) {
],
style: {
width: 3,
color: "#ff0000"
// color: "#ff0000"
image: "//data.mars3d.cn/img/textures/line-gradient.png"
},
attr: { remark: "示例16" }
})
Expand Down
11 changes: 11 additions & 0 deletions src/example/graphic/space/satellite/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ function addGraphicLayer() {
opacity: 0.5,
width: 1
},
// path: {
// width: 2,
// materialType: mars3d.MaterialType.Image2,
// materialOptions: {
// image: "//data.mars3d.cn/img/textures/line-gradient.png"
// },
// closure: true
// },
interpolationDegree: 10,
interpolationAlgorithm: Cesium.HermitePolynomialApproximation,

highlight: {
type: mars3d.EventType.click,
model: {
Expand Down
2 changes: 1 addition & 1 deletion src/example/layer-graphic/draw/military/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export function openGeoJSON(file) {
const reader = new FileReader()
reader.readAsText(file, "UTF-8")
reader.onloadend = function (e) {
const geojson = this.result
const geojson = JSON.parse(this.result)
console.log("打开了json文件", geojson)
graphicLayer.loadJSON(geojson, { flyTo: true, clear: true })
}
Expand Down
2 changes: 1 addition & 1 deletion src/example/layer-tileset/monomer/building-edit/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export function openGeoJSON(file) {
const reader = new FileReader()
reader.readAsText(file, "UTF-8")
reader.onloadend = function (e) {
const json = this.result
const json = JSON.parse(this.result)
console.log("打开了json文件", json)
graphicLayer.loadJSON(json, { flyTo: true, clear: true })
}
Expand Down
10 changes: 7 additions & 3 deletions src/example/map/options/lang/CustomLang.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ const CustomLang = {
/** 标识语言的唯一标识 */
type: "en",

// Cesium renderError 错误弹窗
RenderingHasStopped: "An error occurred while rendering. Rendering has stopped.",
ErrorConstructingCesiumWidget: "Error constructing CesiumWidget.",
/** Cesium内部 初始化CesiumWidget时 错误弹窗 标题 */
ErrorCreateCatch: "Error constructing CesiumWidget.",
/** Cesium内部 初始化CesiumWidget时 错误弹窗 内容 */
ErrorCreateCatchMessage: `Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:`,
/** Cesium内部 运行中 renderError时 错误弹窗 标题 */
ErrorTitleRenderStopped: "An error occurred while rendering. Rendering has stopped.",


// src\control\czm\Animation.js
Today: "Today",
Expand Down
4 changes: 3 additions & 1 deletion src/example/thing/other/task/CameraList.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
class CameraList extends mars3d.TaskItem {
// 进入,激活开始处理事务
_activateWork() {
this._map.setCameraViewList(this.options.list)
if (this.options && this.options.list) {
this._map.setCameraViewList(this.options.list)
}
}

// 暂停(非必须)
Expand Down
94 changes: 94 additions & 0 deletions src/example/thing/other/task/CreateTarget.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// import * as mars3d from "mars3d"

/**
* 进入时创建对象,离开时销毁对象
*
* @param {object} [options] 参数对象,包括以下:
* @param {string} [options.name] 标题名称
* @param {string} [options.type] 类型标识,自动赋值的,无需手动传入
* @param {number} [options.start] 开始时间,相当于map.clock.startTime的秒数
* @param {number} [options.duration] 时长
*
* @param {object[]} [options.graphics] 矢量对象创建参数 列表
* @param {object[]} [options.layers] 图层创建参数 列表
* @param {object[]} [options.effects] 特效对象创建参数 列表
* @param {object[]} [options.controls] 控件对象创建参数 列表
*/
class CreateTarget extends mars3d.TaskItem {
// 进入,激活开始处理事务
_activateWork() {
// 存在需要创建的矢量对象时
const graphicsOptions = this.options.graphics || []
if (graphicsOptions && graphicsOptions.length > 0) {
this._graphicLayer = new mars3d.layer.GraphicLayer({
data: graphicsOptions // 直接支持传入构造参数数组
})
this._map.addLayer(this._graphicLayer)
}

// 存在需要创建的图层时
const layersOptions = this.options.layers
if (layersOptions && layersOptions.length > 0) {
const layers = []
layersOptions.forEach((options) => {
const layer = mars3d.LayerUtil.create(options)
if (layer) {
this._map.addLayer(layer)
layers.push(layer)
}
})
this._layers = layers
}

// 存在需要创建的特效时
const effectsOptions = this.options.effects
if (effectsOptions && effectsOptions.length > 0) {
const effects = []
effectsOptions.forEach((options) => {
const effect = mars3d.EffectUtil.create(options)
if (effect) {
this._map.addEffect(effect)
effects.push(effect)
}
})
this._effects = effects
}

// 存在需要创建的控件时
const controlsOptions = this.options.controls
if (controlsOptions && controlsOptions.length > 0) {
const controls = []
controlsOptions.forEach((options) => {
const control = mars3d.ControlUtil.create(options)
if (control) {
this._map.addControl(control)
controls.push(control)
}
})
this._controls = controls
}
}

// 离开,释放相关对象
_disableWork() {
if (this._graphicLayer) {
this._graphicLayer.remove(true)
delete this._graphicLayer
}

if (this._layers) {
this._layers.forEach((layer) => {
layer.remove(true)
})
delete this._layers
}

if (this._effects) {
this._effects.forEach((layer) => {
layer.remove(true)
})
delete this._effects
}
}
}
mars3d.thing.Task.register("createTarget", CreateTarget)
45 changes: 0 additions & 45 deletions src/example/thing/other/task/FlickerEntity.js

This file was deleted.

Loading

0 comments on commit ba7b72d

Please sign in to comment.