Commit 5af46c61 by wanghao

同步代码

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