Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yqlh-dataEase
概览
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
yqlh-dataEase
Commits
210752f8
Commit
210752f8
authored
Jul 25, 2023
by
付振洋
Browse files
Options
Browse Files
Download
Plain Diff
合并分支 'feature/Tippi' 到 'develop'
Feature/tippi 查看合并请求
!21
parents
48a57de3
a7cf06ed
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
5 行增加
和
132 行删除
+5
-132
src/views/chart/chart/bubble/bubble_antv.js
+4
-128
src/views/chart/chart/util.js
+1
-4
没有找到文件。
src/views/chart/chart/bubble/bubble_antv.js
查看文件 @
210752f8
import
{
Scene
,
PointLayer
}
from
'@antv/l7'
import
{
GaodeMap
}
from
'@antv/l7-maps'
import
{
getLanguage
}
from
'@/lang'
import
axios
from
'axios'
const
location
=
[[
121.473701
,
31.230416
],
[
102.710002
,
25.045806
],
[
111.765617
,
40.817498
],
[
116.407526
,
39.90403
],
[
125.32599
,
43.896536
],
[
104.075931
,
30.651651
],
[
117.200983
,
39.084158
],
[
106.258754
,
38.471317
],
[
117.284922
,
31.861184
],
[
117.020359
,
36.66853
],
[
112.562398
,
37.873531
],
[
113.26653
,
23.132191
],
[
108.327546
,
22.815478
],
[
87.627704
,
43.793026
],
[
118.763232
,
32.061707
],
[
115.909228
,
28.675696
],
[
114.468664
,
38.037057
],
[
113.753602
,
34.765515
],
[
120.152791
,
30.267446
],
[
110.349228
,
20.017377
],
[
114.341861
,
30.546498
],
[
112.98381
,
28.112444
],
[
103.826308
,
36.059421
],
[
119.295144
,
26.100779
],
[
91.117212
,
29.646922
],
[
106.70741
,
26.598194
],
[
123.42944
,
41.835441
],
[
106.551556
,
29.563009
],
[
108.954239
,
34.265472
],
[
101.780199
,
36.620901
],
[
126.661669
,
45.742347
]]
// export async function baseBubbleMapOption(chartDom, chartId, chart, action) {
export
function
baseBubbleMapOption
(
chartDom
,
chartId
,
chart
,
action
)
{
const
xAxis
=
JSON
.
parse
(
chart
.
xaxis
)
const
yAxis
=
JSON
.
parse
(
chart
.
yaxis
)
console
.
log
(
'xAxis,yAxis'
,
xAxis
,
yAxis
)
let
customAttr
if
(
chart
.
customAttr
)
{
customAttr
=
JSON
.
parse
(
chart
.
customAttr
)
...
...
@@ -125,7 +27,7 @@ export function baseBubbleMapOption(chartDom, chartId, chart, action) {
// pitch: size.mapPitch,
style
:
mapStyle
,
// style: 'dark',
center
:
[
96.99215001469588
,
29.281597225674773
],
center
:
[
104.58631
,
30.71882
],
// 成阿中心经纬度
zoom
:
2.194613775109773
,
maxZoom
:
10
}),
...
...
@@ -138,28 +40,17 @@ export function baseBubbleMapOption(chartDom, chartId, chart, action) {
chartDom
.
setMapStyle
(
mapStyle
)
}
}
// if (xAxis?.length < 2 || xAxisExt?.length < 2) {
if
(
xAxis
?.
length
<
1
||
yAxis
?.
lang
<
1
)
{
if
(
xAxis
?.
length
<
2
||
yAxis
?.
lang
<
1
)
{
chartDom
.
removeAllLayer
()
return
chartDom
}
// const newTableRow = await Promise.all(chart.data.tableRow.map(async(item) => {
const
newTableRow
=
chart
.
data
.
tableRow
.
map
((
item
,
index
)
=>
{
// const mapInfo = await axios
// .get(
// `https://restapi.amap.com/v3/geocode/geo?key=${'76cd4f09c916ab5edc529185e5d38c38'}&address=${
// item[xAxis[0].dataeaseName]
// }`
// )
// console.log('mapInfo==', mapInfo)
// const location = mapInfo?.data?.geocodes?.length > 0 ? mapInfo.data.geocodes[0].location : ''
// const location = '111,222'
return
{
type
:
'Feature'
,
geometry
:
{
type
:
'Point'
,
coordinates
:
location
[
index
]
coordinates
:
[
item
[
xAxis
[
0
].
dataeaseName
],
item
[
xAxis
[
1
].
dataeaseName
]
]
},
properties
:
{
capacity
:
item
[
yAxis
[
0
].
dataeaseName
]
...
...
@@ -167,28 +58,13 @@ export function baseBubbleMapOption(chartDom, chartId, chart, action) {
}
})
const
mapData
=
{
type
:
'FeatureCollection'
,
features
:
newTableRow
}
console
.
log
(
'mapData==='
,
mapData
)
chartDom
.
removeAllLayer
()
.
then
(()
=>
{
const
pointLayer
=
new
PointLayer
({})
.
source
(
mapData
)
.
shape
(
'circle'
)
.
size
(
'capacity'
,
[
0
,
16
])
.
color
(
'capacity'
,
[
// '#34B6B7',
// '#4AC5AF',
// '#5FD3A6',
// '#7BE39E',
// '#A1EDB8',
// '#CEF8D6'
'#FFB7DD'
,
'#FF88C2'
,
'#FF44AA'
,
'#FF0088'
,
'#C10066'
,
'#A20055'
])
.
color
(
'capacity'
,
color
?.
colors
)
.
active
(
true
)
.
style
({
opacity
:
0.5
,
...
...
src/views/chart/chart/util.js
查看文件 @
210752f8
...
...
@@ -2014,11 +2014,8 @@ export const TYPE_CONFIGS = [
],
propertyInner
:
{
'color-selector'
:
[
'alpha'
,
'mapStyle'
,
'mapLineGradient'
,
'mapLineSourceColor'
,
'mapLineTargetColor'
'value'
],
'size-selector-ant-v'
:
[
'mapPitch'
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论