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
9284d221
Commit
9284d221
authored
Jul 24, 2023
by
wangmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
城市亮度图修改
parent
470d2f54
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
14 行增加
和
174 行删除
+14
-174
src/views/chart/chart/cityBrightness/cityBrightness_antv.js
+14
-174
没有找到文件。
src/views/chart/chart/cityBrightness/cityBrightness_antv.js
查看文件 @
9284d221
import
{
Scene
,
PointLayer
}
from
'@antv/l7'
import
{
Scene
,
PointLayer
}
from
'@antv/l7'
import
{
GaodeMap
}
from
'@antv/l7-maps'
import
{
GaodeMap
}
from
'@antv/l7-maps'
import
{
getLanguage
}
from
'@/lang'
import
{
getLanguage
}
from
'@/lang'
// const location = [
// [113.950375, 22.534875],
// [113.950625, 22.534875],
// [113.930125, 22.515625],
// [113.930375, 22.515625],
// [113.929625, 22.515625]
// ]
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
function
baseCityBrightnessMapOptionAntV
(
chartDom
,
chartId
,
chart
,
action
)
{
export
function
baseCityBrightnessMapOptionAntV
(
chartDom
,
chartId
,
chart
,
action
)
{
// console.log('亮度===', chart)
const
xAxis
=
JSON
.
parse
(
chart
.
xaxis
)
const
xAxis
=
JSON
.
parse
(
chart
.
xaxis
)
const
yAxis
=
JSON
.
parse
(
chart
.
yaxis
)
const
yAxis
=
JSON
.
parse
(
chart
.
yaxis
)
// console.log('chart==chart.data.tableRow==', chart, chart.data.tableRow)
// console.log('chart==chart.data.tableRow==', chart, chart.data.tableRow)
...
@@ -128,11 +29,11 @@ export function baseCityBrightnessMapOptionAntV(chartDom, chartId, chart, action
...
@@ -128,11 +29,11 @@ export function baseCityBrightnessMapOptionAntV(chartDom, chartId, chart, action
lang
:
lang
,
lang
:
lang
,
pitch
:
size
.
mapPitch
,
pitch
:
size
.
mapPitch
,
// pitch: 64.88, // 地图倾角
// pitch: 64.88, // 地图倾角
style
:
mapStyle
,
style
:
mapStyle
// style: 'dark',
// style: 'dark',
center
:
[
116.41667
,
39.91667
],
// 地图中心经纬度-北京
//
center: [116.41667, 39.91667], // 地图中心经纬度-北京
zoom
:
10
,
//
zoom: 10,
maxZoom
:
20
//
maxZoom: 20
}),
}),
logoVisible
:
false
logoVisible
:
false
})
})
...
@@ -147,89 +48,28 @@ export function baseCityBrightnessMapOptionAntV(chartDom, chartId, chart, action
...
@@ -147,89 +48,28 @@ export function baseCityBrightnessMapOptionAntV(chartDom, chartId, chart, action
chartDom
.
removeAllLayer
()
chartDom
.
removeAllLayer
()
return
chartDom
return
chartDom
}
}
// chart.data.tableRow.map((item, index) => {
// console.log('item===', index, item, item[yAxis[0].dataeaseName])
const
newTableRow
=
chart
.
data
.
tableRow
.
map
((
item
,
index
)
=>
{
// })
const
newTableRow
=
location
.
map
((
item
,
index
)
=>
{
return
{
return
{
type
:
'Feature'
,
type
:
'Feature'
,
properties
:
{
properties
:
{
h0
:
'3'
,
h8
:
item
[
yAxis
[
0
].
dataeaseName
]
// 0到6
h1
:
'2'
,
h2
:
'1'
,
h3
:
'0'
,
h4
:
'0'
,
h5
:
'0'
,
h6
:
'0'
,
h7
:
'3'
,
h8
:
'4'
,
h9
:
'5'
,
h10
:
'6'
,
h11
:
'5'
,
h12
:
'6'
,
h13
:
'4'
,
h14
:
'4'
,
h15
:
'5'
,
h16
:
'4'
,
h17
:
'5'
,
h18
:
'4'
,
h19
:
'4'
,
h20
:
'5'
,
h21
:
'4'
,
h22
:
'6'
,
h23
:
'6'
},
},
geometry
:
{
geometry
:
{
type
:
'Point'
,
type
:
'Point'
,
coordinates
:
location
[
index
]
coordinates
:
[
item
[
xAxis
[
0
].
dataeaseName
],
item
[
xAxis
[
1
].
dataeaseName
]
]
},
},
bbox
:
[
location
[
index
][
0
],
location
[
index
][
1
],
location
[
index
][
0
],
location
[
index
][
1
]]
// bbox 参数: 使用边界框(bbox)指定静态图像的整个视口
bbox
:
[
item
[
xAxis
[
0
].
dataeaseName
],
item
[
xAxis
[
1
].
dataeaseName
],
item
[
xAxis
[
0
].
dataeaseName
],
item
[
xAxis
[
1
].
dataeaseName
]]
}
}
})
})
const
mapData
=
{
type
:
'FeatureCollection'
,
features
:
newTableRow
}
const
mapData
=
{
type
:
'FeatureCollection'
,
features
:
newTableRow
}
// console.log('11==map==', mapData)
// console.log('mapData', mapData)
// const mapData = { type: 'FeatureCollection', features: [{ type: 'Feature', properties: {
// h0: '3',
// h1: '2',
// h2: '1',
// h3: '0',
// h4: '0',
// h5: '0',
// h6: '0',
// h7: '3',
// h8: '4',
// h9: '5',
// h10: '6',
// h11: '5',
// h12: '6',
// h13: '4',
// h14: '4',
// h15: '5',
// h16: '4',
// h17: '5',
// h18: '4',
// h19: '4',
// h20: '5',
// h21: '4',
// h22: '6',
// h23: '6'
// }, geometry: {
// type: 'Point',
// coordinates: [113.950375, 22.534875]
// }, bbox: [113.950375, 22.534875, 113.950375, 22.534875] }] }
// bbox 参数: 使用边界框(bbox)指定静态图像的整个视口
chartDom
.
removeAllLayer
()
chartDom
.
removeAllLayer
()
.
then
(()
=>
{
.
then
(()
=>
{
const
pointLayer
=
new
PointLayer
({})
const
pointLayer
=
new
PointLayer
({})
.
source
(
mapData
)
.
source
(
mapData
)
// .source(chart.data.tableRow, {
.
size
(
2
)
// parser: {
// type: 'json',
// x: xAxis[0].dataeaseName,
// y: xAxis[1].dataeaseName
// }
// })
.
size
(
4
)
.
color
(
'h8'
,
[
.
color
(
'h8'
,
[
'#0A3663'
,
'#0A3663'
,
'#1558AC'
,
'#1558AC'
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论