Commit 5af46c61 by wanghao

同步代码

parent 6cec5d77
/**
* Mars3D三维可视化平台 mars3d
*
* 版本信息:v3.6.17
* 编译日期:2023-12-17 23:57:16
* 版本信息:v3.6.18
* 编译日期:2023-12-28 21:28:23
* 版权所有:Copyright by 火星科技 http://mars3d.cn
* 使用单位:免费公开版 ,2023-03-17
*/
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -28,7 +28,8 @@ export const FixedRouteInfo = () => {
const showInfo = (item: any) => {
let val = Math.ceil((item.second * 100) / item.second_all)
if (val < 1) {
val = 1
// 原本是1 ,但是这个示例graphic/custom/fixedRoute-walk需要为0
val = 0
}
if (val > 100) {
val = 100
......
......@@ -4,7 +4,7 @@
margin-top: 7px;
}
.ant-popover-inner {
background: @mars-bg-base !important;
background: rgba(23, 49, 71, 0.95) !important;
.ant-popover-inner-content {
padding: 10px !important;
border-radius: 4px !important;
......
......@@ -10,6 +10,9 @@
input {
color: @mars-base-color !important;
}
input::placeholder {
color: @mars-base-color !important;
}
}
.ant-picker-clear {
background: @mars-bg-base;
......
......@@ -26,6 +26,9 @@
}
}
}
.ant-select-selection-item {
color: #fff;
}
}
.mars-select-dropdown {
padding: 0 !important;
......
......@@ -64,8 +64,6 @@ function removeLayer() {
}
}
// 示例:
export function showCar() {
removeLayer()
......@@ -96,8 +94,8 @@ export function showAircraft() {
graphicLayer = new mars3d.layer.CzmlLayer({
name: "飞行编队",
url: "//data.mars3d.cn/file/czml/flight2.czml",
popup: "all",
flyTo: true
popup: "all"
// flyTo: true
})
map.addLayer(graphicLayer)
......@@ -118,8 +116,8 @@ export function showShip() {
graphicLayer = new mars3d.layer.CzmlLayer({
name: "船舶编队",
url: "//data.mars3d.cn/file/czml/ship2.czml",
popup: "all",
flyTo: true
popup: "all"
// flyTo: true
})
map.addLayer(graphicLayer)
......@@ -137,6 +135,8 @@ export function showShip() {
export function showBDSatellite() {
removeLayer()
map.setCameraView({ lat: 51.630551, lng: 165.640607, alt: 110141973.7, heading: 360, pitch: -89.9 })
// 更新地球参数
map.setSceneOptions({
cameraController: {
......@@ -147,8 +147,8 @@ export function showBDSatellite() {
graphicLayer = new mars3d.layer.CzmlLayer({
name: "北斗卫星",
url: "//data.mars3d.cn/file/czml/satellite.czml",
center: { lng: 10, lat: 111.833884, z: 150000000, heading: 0, pitch: -90, roll: 0 },
flyTo: true
center: { lng: 10, lat: 111.833884, z: 150000000, heading: 0, pitch: -90, roll: 0 }
// flyTo: true
})
map.addLayer(graphicLayer)
......
import { MarsPannel, MarsButton, MarsCheckbox } from "@mars/components/MarsUI"
import { LocationTo } from "@mars/components/MarsSample/LocationTo.jsx"
import { Space } from "antd"
import { Space, Upload } from "antd"
import { useCallback, useState } from "react"
import * as mapWork from "./map.js"
interface FileItem {
uid: string
name?: string
status?: string
response?: string
url?: string
}
interface FileInfo {
file: FileItem
fileList: FileItem[]
}
function UIComponent() {
const [pickModel, setValue] = useState(false)
......@@ -18,6 +30,17 @@ function UIComponent() {
<div className="f-mb">
<Space>
<MarsButton onClick={clear}>清除</MarsButton>
<MarsButton onClick={saveGeoJSON}>保存Json</MarsButton>
<Upload
multiple={false}
name="file"
accept="json,geojson"
showUploadList={false}
onChange={onClickOpenJson}
beforeUpload={() => false}
>
<MarsButton>打开Json</MarsButton>
</Upload>
<MarsCheckbox checked={pickModel} onChange={isChecked}>
仅测量模型(不拾取地形)
</MarsCheckbox>
......@@ -89,4 +112,14 @@ const measureAngle = () => {
const clear = () => {
mapWork.removeAll()
}
// 点击保存GeoJSON
const saveGeoJSON = () => {
mapWork.saveJSON()
}
// 打开GeoJSON
function onClickOpenJson(info: FileInfo) {
mapWork.openJSON(info.file)
}
export default UIComponent
......@@ -21,6 +21,8 @@ function UIComponent() {
const [color, setColor] = useState("rgba(0, 123, 230, 0.5)")
const [show, setShow] = useState(false)
useMemo(() => {
mapWork.eventTarget.on("heightChange", (e: any) => {
setVlaue({ ...floodParams, minHeight: minH, maxHeight: maxH, height: Math.ceil(e.height) })
......@@ -36,7 +38,7 @@ function UIComponent() {
}
minH = min
maxH = max
setVlaue({ ...floodParams, minHeight: min, maxHeight: max })
setVlaue({ ...floodParams, minHeight: min, maxHeight: max, height: Math.ceil(min) })
})
}
......@@ -45,7 +47,7 @@ function UIComponent() {
mapWork.btnDraw((min: number, max: number) => {
maxH = Math.ceil(max)
minH = Math.ceil(min)
setVlaue({ ...floodParams, minHeight: Math.ceil(min), maxHeight: Math.ceil(max) })
setVlaue({ ...floodParams, minHeight: Math.ceil(min), maxHeight: Math.ceil(max), height: Math.ceil(min) })
})
}
......@@ -77,6 +79,7 @@ function UIComponent() {
// 开始分析
const begin = () => {
setShow(true)
mapWork.begin({ ...floodParams, speed })
}
......@@ -101,6 +104,7 @@ function UIComponent() {
})
setSpeed(80)
setIsStart(true)
setShow(false)
}
const options: GuiItem[] = [
......@@ -119,7 +123,7 @@ function UIComponent() {
return (
<MarsPannel visible={true} top={10} right={10}>
{floodParams.height === 0 ? (
{!show ? (
<>
<div className="f-mb">
<Space>
......@@ -162,7 +166,7 @@ function UIComponent() {
""
)}
{floodParams.height !== 0 ? (
{show ? (
<>
<div>
<Space>
......
......@@ -53,7 +53,7 @@ function UIComponent() {
onClick={() => {
mapWork.pointGrid(step)
}}
></MarsButton>
>确定</MarsButton>
</Space>
</div>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论