Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
mars3d
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
frontend
mars3d
Commits
f77c7f79
Commit
f77c7f79
authored
Nov 23, 2022
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
同步代码
parent
159d6d16
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
282 行增加
和
27 行删除
+282
-27
.eslintrc.js
+2
-2
src/example/control/cesium/geocoder/map.js
+2
-1
src/example/control/inside/popup/map.js
+4
-4
src/example/control/other/display/map.js
+1
-1
src/example/graphic/combine/polyline-odline-flights/index.less
+91
-0
src/example/graphic/combine/polyline-odline-flights/index.tsx
+156
-2
src/example/layer-graphic/geojson/kml2json/Kml2JsonLayer.js
+3
-3
src/widgets/basic/GraphicEditor/MarsStyle.tsx
+2
-2
src/widgets/basic/GraphicEditor/config/material.js
+9
-9
src/widgets/basic/GraphicEditor/config/style.js
+12
-3
没有找到文件。
.eslintrc.js
查看文件 @
f77c7f79
...
...
@@ -25,6 +25,7 @@ module.exports = {
Terraformer
:
"readonly"
,
AMap
:
"readonly"
,
kgUtil
:
"readonly"
,
shpUtil
:
"readonly"
,
netcdfjs
:
"readonly"
,
ol
:
"readonly"
,
olcs
:
"readonly"
...
...
@@ -37,7 +38,7 @@ module.exports = {
"no-use-before-define"
:
"off"
,
// 允许 方法在未定义前使用
"multiline-ternary"
:
"off"
,
"no-restricted-globals"
:
"off"
,
"react-hooks/exhaustive-deps"
:
"off"
,
// 检查 effect 的依赖
"react-hooks/exhaustive-deps"
:
"off"
,
// 检查 effect 的依赖
"react-hooks/rules-of-hooks"
:
"error"
,
// 检查 Hook 的规则
// mars3d-react-example项目专用的配置(目的便于示例的开发调试) end
...
...
@@ -49,7 +50,6 @@ module.exports = {
"@typescript-eslint/ban-ts-comment"
:
"off"
,
// ts: 禁止ts注释
"@typescript-eslint/no-unused-vars"
:
"off"
,
// ts:允许定义未引用使用的变量
camelcase
:
"off"
,
// 强制驼峰命名规则
indent
:
"off"
,
// 强制一致的缩进风格
eqeqeq
:
"error"
,
// 是否使用 === 替代 ==
...
...
src/example/control/cesium/geocoder/map.js
查看文件 @
f77c7f79
...
...
@@ -5,7 +5,8 @@ export let map // mars3d.Map三维地图对象
// 需要覆盖config.json中地图属性参数(当前示例框架中自动处理合并)
export
const
mapOptions
=
function
(
option
)
{
option
.
control
=
{
geocoder
:
true
// geocoder: true // 用cesium原生
geocoder
:
"gaode"
// 使用高德POI服务
}
return
option
}
...
...
src/example/control/inside/popup/map.js
查看文件 @
f77c7f79
...
...
@@ -77,11 +77,11 @@ export function bindLayerDemo() {
return
attr
.
type
+
" 我是layer上绑定的Popup"
+
new
Date
().
toLocaleTimeString
()
// return new Promise((resolve) => {
// //这里可以进行后端接口请求数据,setTimeout测试异步
// //
这里可以进行后端接口请求数据,setTimeout测试异步
// setTimeout(() => {
// resolve("Promise异步回调显示的弹窗内容信息")
;
// }, 2000)
;
// })
;
// resolve("Promise异步回调显示的弹窗内容信息")
// }, 2000)
// })
},
{
timeRender
:
true
,
closeButton
:
false
}
// timeRender实时刷新
)
...
...
src/example/control/other/display/map.js
查看文件 @
f77c7f79
...
...
@@ -11,7 +11,7 @@ export const mapOptions = {
infoBox
:
false
,
vrButton
:
true
,
fullscreenButton
:
true
,
geocoder
:
true
,
geocoder
:
"gaode"
,
baseLayerPicker
:
true
,
clockAnimate
:
true
,
// 时钟动画控制(左下角)
timeline
:
true
,
// 是否显示时间线控件
...
...
src/example/graphic/combine/polyline-odline-flights/index.less
0 → 100644
查看文件 @
f77c7f79
.chartOne,
.chartTwo,
.chartThree {
width: 100%;
height: 300px;
margin-bottom: 20px;
position: relative;
border: 1px solid #17366c;
background: linear-gradient(to left, #3897cf, #3897cf) left top no-repeat, linear-gradient(to bottom, #3897cf, #3897cf) left top no-repeat,
linear-gradient(to left, #3897cf, #3897cf) right top no-repeat, linear-gradient(to bottom, #3897cf, #3897cf) right top no-repeat,
linear-gradient(to left, #3897cf, #3897cf) left bottom no-repeat, linear-gradient(to bottom, #3897cf, #3897cf) left bottom no-repeat,
linear-gradient(to left, #3897cf, #3897cf) right bottom no-repeat, linear-gradient(to left, #3897cf, #3897cf) right bottom no-repeat;
background-size: 1px 20px, 20px 1px, 1px 20px, 20px 1px;
background-color: rgba(0, 0, 0, 0.1);
h6 {
margin-top: 5px;
width: 10px;
height: 5px;
color: white;
line-height: 20px;
}
.chartTwo .chartTwo_ulgnhx,
.chartThree_ulhbtj {
height: 100%;
width: 91%;
float: left;
margin-top: 15px;
font-size: 15px;
}
.chartTwo_ulgnhx,
.chartThree_ulhbtj {
width: 84%;
height: 90%;
position: absolute;
left: 8%;
bottom: 5px;
}
}
.chartOne {
height: 96px;
}
._item_row {
display: flex;
align-items: center;
flex-wrap: wrap;
text-align: left;
}
._item_full_box_width {
width: 100%;
}
.right_title {
font-size: 1.4rem;
font-weight: bold;
color: #febc04;
line-height: 3rem;
background: linear-gradient(180deg, #e5be38 0%, #ff882e 100%);
-webkit-background-clip: text;
white-space: nowrap;
-webkit-text-fill-color: transparent;
font-family: "UnidreamLED", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.right_sub_title {
font-size: 0.85rem;
color: #d8d8d8;
line-height: 1;
white-space: nowrap;
background: linear-gradient(180deg, #e5be38 0%, #ff882e 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.row1_right {
margin-left: 0.6rem;
text-align: left;
}
.row1 {
// width: 100px;
align-items: center;
display: flex;
margin-bottom: 1.15rem;
}
.icon {
margin-left: 28px;
}
h6 {
margin-left: 10px;
}
src/example/graphic/combine/polyline-odline-flights/index.tsx
查看文件 @
f77c7f79
import
{
MarsPannel
}
from
"@mars/components/MarsUI"
import
{
MarsButton
,
MarsIcon
,
MarsPannel
}
from
"@mars/components/MarsUI"
import
{
useState
}
from
"react"
import
*
as
echarts
from
"echarts"
import
*
as
mapWork
from
"./map.js"
import
"./index.less"
function
UIComponent
()
{
let
route
=
[]
// 国内机场航线数据
let
flight
=
[]
const
airData
=
mapWork
.
getAirData
()
const
guonei
=
airData
.
guonei
const
guoji
=
airData
.
guoji
route
=
airData
.
route
flight
=
airData
.
flight
setTimeout
(()
=>
{
initCharts_Two
()
initCharts_Three
()
},
300
)
function
initCharts_Two
()
{
const
GNHX
=
document
.
getElementById
(
"ul_GNHX"
)
const
airportData
=
[]
// 机场数据
route
.
forEach
((
item
)
=>
{
airportData
.
push
({
name
:
item
.
airport
,
value
:
item
.
routeNum
})
})
console
.
log
(
"aaa"
,
echarts
)
const
myChart
=
echarts
.
init
(
GNHX
)
const
option
=
{
tooltip
:
{
trigger
:
"item"
,
formatter
:
"机场名:{b}<br/> 航线:{c}"
},
// legend: {
// orient: "horizontal",
// top: "0.1%",
// textStyle: {
// color: "#ffffff"
// }
// },
series
:
[
{
type
:
"pie"
,
radius
:
"50%"
,
label
:
{
show
:
true
},
data
:
airportData
}
]
}
myChart
.
setOption
(
option
)
}
function
initCharts_Three
()
{
const
HBTJ
=
document
.
getElementById
(
"ul_HBTJ"
)
const
year
=
[]
const
domestic
=
[]
// 国内航班
const
international
=
[]
// 国际航班
flight
.
forEach
((
item
)
=>
{
year
.
push
(
item
.
year
)
domestic
.
push
(
item
.
domestic
)
international
.
push
(
item
.
international
)
})
const
myChart
=
echarts
.
init
(
HBTJ
)
const
option
=
{
tooltip
:
{
trigger
:
"axis"
,
axisPointer
:
{
type
:
"shadow"
}
},
grid
:
{
left
:
"8%"
,
right
:
"0%"
,
bottom
:
"6%"
,
containLabel
:
true
},
xAxis
:
[
{
type
:
"category"
,
data
:
year
,
axisTick
:
{
alignWithLabel
:
true
}
}
],
yAxis
:
[
{
type
:
"value"
}
],
series
:
[
{
name
:
"国内航班"
,
type
:
"bar"
,
barWidth
:
"30%"
,
data
:
domestic
},
{
name
:
"国际航班"
,
type
:
"bar"
,
barWidth
:
"30%"
,
data
:
international
}
]
}
myChart
.
setOption
(
option
)
window
.
addEventListener
(
"resize"
,
function
()
{
myChart
.
resize
()
})
}
return
(
<>
<
MarsPannel
visible=
{
true
}
top=
{
10
}
right=
{
10
}
>
<
MarsPannel
visible=
{
true
}
top=
{
10
}
right=
{
10
}
width=
{
340
}
height=
{
787
}
>
<
div
className=
"chartOne"
id=
"chartOne"
>
<
h6
>
航线条数
</
h6
>
<
div
className=
"hx"
>
<
div
className=
"_item_row _item_full_box_width justify-between"
>
<
MarsIcon
icon=
"airplane"
width=
"30"
className=
"icon"
/>
<
div
className=
"row1_right"
>
<
div
className=
"right_title"
>
{
guonei
}
(条)
</
div
>
<
div
className=
"right_sub_title"
>
国内航班
</
div
>
</
div
>
<
MarsIcon
icon=
"take-off"
width=
"35"
className=
"icon"
/>
{
/* <airplane theme="outline" size="43" fill="#333" /> */
}
<
div
className=
"row1_right"
>
<
div
className=
"right_title"
>
{
guoji
}
(条)
</
div
>
<
div
className=
"right_sub_title"
>
国际航班
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
"chartTwo"
id=
"chartTwo"
>
<
h6
>
国内机场航线数
</
h6
>
<
div
id=
"ul_GNHX"
className=
"chartTwo_ulgnhx"
></
div
>
</
div
>
<
div
className=
"chartThree"
id=
"chartThree"
>
<
h6
>
年度航班统计
</
h6
>
<
div
id=
"ul_HBTJ"
className=
"chartThree_ulhbtj"
></
div
>
</
div
>
</
MarsPannel
>
</>
)
...
...
src/example/layer-graphic/geojson/kml2json/Kml2JsonLayer.js
查看文件 @
f77c7f79
...
...
@@ -2,7 +2,7 @@
/**
* 通过转geojson方式 加载kml和kmz文件。
* kgUtil使用需要引入 ../lib/
kml
/kml-geojson.js文件
* kgUtil使用需要引入 ../lib/
geojson
/kml-geojson.js文件
*/
class
Kml2JsonLayer
extends
mars3d
.
layer
.
GeoJsonLayer
{
/**
...
...
@@ -39,7 +39,7 @@ class Kml2JsonLayer extends mars3d.layer.GeoJsonLayer {
this
.
_load_data
(
data
)
})
.
catch
(
function
(
error
)
{
this
.
showE
rror
(
"服务出错"
,
error
)
console
.
e
rror
(
"服务出错"
,
error
)
})
}
else
if
(
this
.
options
.
data
)
{
kgUtil
...
...
@@ -51,7 +51,7 @@ class Kml2JsonLayer extends mars3d.layer.GeoJsonLayer {
this
.
_load_data
(
data
)
})
.
catch
(
function
(
error
)
{
this
.
showE
rror
(
"服务出错"
,
error
)
console
.
e
rror
(
"服务出错"
,
error
)
})
}
else
{
if
(
newOptions
)
{
...
...
src/widgets/basic/GraphicEditor/MarsStyle.tsx
查看文件 @
f77c7f79
...
...
@@ -40,7 +40,7 @@ interface MarsAttrProps {
onChange
?:
(
value
?:
any
)
=>
void
}
let
newViewMaterials
:
any
[]
=
[]
export
default
function
MarsStyle
({
style
,
layerName
,
customType
,
graphicType
,
onChange
=
()
=>
{}
}:
MarsAttrProps
)
{
export
default
function
MarsStyle
({
style
,
layerName
,
customType
,
graphicType
,
onChange
=
()
=>
{
}
}:
MarsAttrProps
)
{
const
originStyles
=
useRef
([])
// 完整的属性数据
const
[
styleValue
,
setStyleValue
]
=
useState
<
any
>
(
null
)
// 矢量数据样式属性对象
const
[
viewStyles
,
setViewStyles
]
=
useState
<
any
[]
>
([])
// 当前状态下显示的属性数组
...
...
@@ -68,7 +68,7 @@ export default function MarsStyle({ style, layerName, customType, graphicType, o
// 设置初始化的默认值
function
setDefault
()
{
const
newStyleValue
=
cloneDeep
(
style
)
const
styleConfig
=
styleConfigAll
[
graphicType
]
||
styleConfigAll
[
custom
Type
]
const
styleConfig
=
styleConfigAll
[
customType
]
||
styleConfigAll
[
graphic
Type
]
if
(
!
styleConfig
)
{
return
}
...
...
src/widgets/basic/GraphicEditor/config/material.js
查看文件 @
f77c7f79
...
...
@@ -29,7 +29,7 @@ const materialConfig = {
type
:
"number"
,
step
:
1
,
defval
:
1
,
show
(
style
,
allStyle
,
graphicType
)
{
show
(
style
,
allStyle
,
graphicType
)
{
return
!
style
.
axisY
}
},
...
...
@@ -39,7 +39,7 @@ const materialConfig = {
type
:
"number"
,
step
:
1
,
defval
:
1
,
show
(
style
,
allStyle
,
graphicType
)
{
show
(
style
,
allStyle
,
graphicType
)
{
return
style
.
axisY
}
},
...
...
@@ -105,7 +105,7 @@ const materialConfig = {
max
:
1
,
step
:
0.1
,
defval
:
1
,
show
(
style
,
allStyle
,
graphicType
)
{
show
(
style
,
allStyle
,
graphicType
)
{
return
style
.
transparent
===
true
}
},
...
...
@@ -161,7 +161,7 @@ const materialConfig = {
label
:
"描边颜色"
,
type
:
"color"
,
defval
:
"#ffffff"
,
show
(
style
,
allStyle
,
graphicType
)
{
show
(
style
,
allStyle
,
graphicType
)
{
return
style
.
stroke
}
},
...
...
@@ -173,7 +173,7 @@ const materialConfig = {
max
:
5
,
step
:
1
,
defval
:
1
,
show
(
style
,
allStyle
,
graphicType
)
{
show
(
style
,
allStyle
,
graphicType
)
{
return
style
.
stroke
}
},
...
...
@@ -189,7 +189,7 @@ const materialConfig = {
label
:
"背景颜色"
,
type
:
"color"
,
defval
:
"#000000"
,
show
(
style
,
allStyle
,
graphicType
)
{
show
(
style
,
allStyle
,
graphicType
)
{
return
style
.
background
}
},
...
...
@@ -199,7 +199,7 @@ const materialConfig = {
type
:
"number"
,
step
:
1
,
defval
:
5
,
show
(
style
,
allStyle
,
graphicType
)
{
show
(
style
,
allStyle
,
graphicType
)
{
return
style
.
background
}
}
...
...
@@ -211,8 +211,8 @@ const materialConfig = {
{
name
:
"lineThickness"
,
label
:
"网格宽度"
,
type
:
"number"
,
step
:
1
,
defval
:
2
}
],
Checkerboard
:
[
{
name
:
"
light
Color"
,
label
:
"主色"
,
type
:
"color"
,
defval
:
"#000000"
},
{
name
:
"
dark
Color"
,
label
:
"衬色"
,
type
:
"color"
,
defval
:
"#ffffff"
},
{
name
:
"
even
Color"
,
label
:
"主色"
,
type
:
"color"
,
defval
:
"#000000"
},
{
name
:
"
odd
Color"
,
label
:
"衬色"
,
type
:
"color"
,
defval
:
"#ffffff"
},
{
name
:
"repeat_x"
,
label
:
"横向数量"
,
type
:
"number"
,
step
:
1
,
defval
:
10
},
{
name
:
"repeat_y"
,
label
:
"纵向数量"
,
type
:
"number"
,
step
:
1
,
defval
:
10
}
],
...
...
src/widgets/basic/GraphicEditor/config/style.js
查看文件 @
f77c7f79
...
...
@@ -986,6 +986,16 @@ const styleConfig = {
style
:
[
{
name
:
"radius"
,
label
:
"半径"
,
type
:
"number"
,
step
:
1
,
defval
:
0.0
},
{
name
:
"height"
,
label
:
"高度"
,
type
:
"number"
,
step
:
1
,
defval
:
0.0
,
show
(
style
,
allStyle
,
graphicType
)
{
return
!
style
.
clampToGround
}
},
{
name
:
"diffHeight"
,
label
:
"立体高度"
,
type
:
"number"
,
...
...
@@ -2638,7 +2648,7 @@ const styleConfig = {
min
:
0.0
,
max
:
360.0
,
step
:
0.01
,
defval
:
0.0
,
defval
:
0.0
},
{
name
:
"endAngle"
,
...
...
@@ -2647,7 +2657,7 @@ const styleConfig = {
min
:
0.0
,
max
:
360.0
,
step
:
0.01
,
defval
:
0.0
,
defval
:
0.0
},
{
name
:
"noCenter"
,
...
...
@@ -2656,7 +2666,6 @@ const styleConfig = {
defval
:
false
},
{
name
:
"diffHeight"
,
label
:
"立体高度"
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论