Commit ca01b1cd by 饶艳婷

合并分支 'feature/hyl' 到 'develop'

Feature/hyl

查看合并请求 !29
parents bb25b9df f9c49a54
...@@ -15,3 +15,4 @@ tests/**/coverage/ ...@@ -15,3 +15,4 @@ tests/**/coverage/
*.ntvs* *.ntvs*
*.njsproj *.njsproj
*.sln *.sln
yarn.lock
<svg t="1692175494268" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="13238" width="200" height="200"><path d="M926.6 422.9C895 277.9 802 166.5 657.9 100.8c-8.4-3.8-17.5-4.1-25.6-0.7-16 6.6-22.5 24.2-28.3 39.6-1.7 4.5-4.4 11.8-6.2 14.8-18.2 12-26.4 37.1-19.1 59.9 4.4 13.7 13.9 23.9 26.2 29.4-0.3 10.7 1.2 24.2 5.9 41.4 5 18.2 13.6 40.4 34.8 50.9 24.5 12.1 55.6 2.7 82.9-8.1 5.4-1.9 9.3-2.7 11.8-2.9v0.6c-1.9 14.3-6.7 23.2-12.3 33.5-15.1 28.2-24.2 52.8-2.9 113.5 11.9 34.2 33.2 55.7 52 74.7 13.7 13.8 25.5 25.7 32.2 40.7 11.9 29 48.4 48.5 80.5 65.7l6.1 3.3c3.3 1.8 6.9 2.7 10.6 2.7 3.2 0 6.5-0.7 9.5-2.1 6.4-3 11-8.9 12.4-15.8l0.1-0.7c5.5-25.2 20.7-114.7-1.9-218.3z m-36.5 179.9c-17.7-10.2-35.4-21.9-39.4-31.9-0.1-0.3-0.2-0.5-0.3-0.8-10-22.5-26-38.7-41.4-54.2-17-17.1-33-33.3-41.6-58v-0.1c-16.5-46.8-9.9-59.1 0.1-77.7 6.4-11.9 14.3-26.6 17.3-49.3 0-0.3 0.1-0.6 0.1-0.9 2.1-22.6-7.2-34.8-15.3-41-5.8-4.5-14.6-8.6-27.4-8.6-8 0-17.6 1.6-28.9 5.7-0.2 0.1-0.4 0.2-0.7 0.3-32.1 12.8-43.2 11.6-47 9.7-2.8-1.4-7.1-6.5-11.7-22.9-6.3-22.7-4.1-32.3-3.5-34.4 4.8-6.6 5.7-15.3 2-22.8-4.1-8.5-13.2-13.5-22.6-12.4-7.1 0.8-8-1.3-8.4-2.2-1.6-3.5-0.3-8.7 0.9-9.7l1.5-0.9c11.6-7.7 16.9-21.9 21.9-35.5 1-2.6 2.3-6.1 3.6-9.3C906.8 269.4 902.8 509 890.1 602.8zM610.8 597.1c-12.2-10.5-20.8-19.3-28.4-27.1-24.7-25.4-40-38.7-93.1-38.7-33.9 0-71.6 3.6-93.9 30.3-18 21.6-22.5 52.8-14.1 98.3 10 54.4 32.3 70.2 47.1 80.6 10 7.1 12.1 8.6 10.8 27.7-4.3 59.6 7.3 83.7 20.7 105.1 1.1 1.8 2.2 3.5 3.2 5.2 9.4 16.4 28.1 42.6 52.4 42.6 1.9 0 3.9-0.2 5.8-0.5 28.2-4.9 34.4-40 36.5-51.5 11.5-64.4 32.6-98.2 53.7-125 18.8-24 68.7-87.5-0.7-147z m-34.3 119.4C553 746.4 527.2 787 514 861.2c-0.7 4-1.5 7.2-2.2 9.7-3.1-3.6-6.7-8.6-10.1-14.5-1.2-2.2-2.6-4.4-4-6.7-8.3-13.3-17.6-28.3-14-78.4 2.9-40.8-11.6-54.6-29.4-67.2-11.5-8.1-22.3-15.8-29-52.4-5.6-30.6-4.1-51.4 4.5-61.7 8.2-9.9 26.6-14.3 59.6-14.3 36.7 0 41.4 4.8 61.1 25.2 7.8 8.1 17.6 18.1 31.3 29.9 28 24.1 26.7 44.9-5.3 85.7zM306.5 485.2c0.4-0.5 1.6-1.5 3.8-2.7l0.9-0.5c11.1-5.9 27.5-14.7 34.5-15.6 0.6 1.1 1.4 3.1 2.2 6.5 5.9 23.4 23.5 38.5 46 39.4 26.8 1 54.3-19 63.5-46.6 5.1-15.3 9-16.2 27.5-20.2 9.9-2.2 22.2-4.9 36-10.9 34.1-14.9 69.9-34.8 62-81.9l-0.5-3.2c-4.5-27.4-11.2-68.8-83.8-68.8-31.5 0-48.4 13.7-58.6 21.9-1.2 0.9-2.6 2.1-3.8 3-2.2-1.4-6.6-4.5-13.8-11.7-2.2-2.2-4-4.1-5.5-5.8 2.2-0.5 4.5-1 6.3-1.4 9.3-2 18.9-4.1 27.4-8.3 23.8-11.9 47.7-51.4 41.7-80.6-3.9-19.2-19-31.4-40.3-32.6-24.3-1.4-36.7 4.6-44.9 8.5-5.2 2.5-5.6 2.7-14-0.3-34.1-12.2-56.2 20.3-69.5 39.8-1.9 2.7-4.2 6.1-6.4 9.1-1.5-1.8-3-3.7-4.3-5.3-15.7-19.6-39.5-49.2-74.3-48.2-7.9 0.2-26.5 0.8-71.4 62.3-24.3 33.2-47.3 72.5-60 102.5-1.4 3.4-2 7-1.7 10.6 6.6 74.7 41.9 118.1 52.7 129.7 8.6 15.6 43.3 64.6 162.3 121 2.4 1.1 4.9 1.8 7.5 2.1 1.1 0.1 2.2 0.1 3.3 0.1 10.2 0 22.8-4.2 28.5-16.5 9.8-21-10.2-41-18.7-49.5-31-31.3-34.7-42.4-34.6-45.9z m-17.1-42c-19.5 10.4-25.4 24.8-26.9 35.1-2 13.4 2.4 26.8 10.1 39.8-58.7-36.8-73.9-63.4-75.5-66.3-1.1-3.1-2.7-5-5.1-7.4-1.4-1.4-34.1-33.9-41.5-99 24.4-54.6 74.6-121.9 91.8-132.3 12.2 1.7 26.4 19.4 36 31.4 9.4 11.7 16.9 21.1 27.3 25.1 25.9 10.8 43.3-14.7 54.9-31.6 4.8-7.1 13.6-20 18.5-22.6 23.6 8.2 36 3.8 47.7-1.9 5.5-2.7 9.9-4.8 22.2-4.2-1 8.5-10.4 25.2-18 29-3.4 1.7-10.6 3.2-16.9 4.6-16.7 3.6-39.6 8.6-45.8 29.6-6 20.3 9.1 38.8 22.9 52.6 34.1 34.1 54.8 29.9 77 11.9 8.3-6.7 14.8-12 30.6-12 34.7 0 35.8 6.7 39.8 31.5l0.6 3.4c1.6 9.4 2.8 16.9-35.9 33.8-9.8 4.3-18.9 6.3-27.7 8.2-21 4.6-47.1 10.3-60.2 49.6-3.5 10.6-13.5 16.2-19.3 16.2h-0.3c-1.4-0.1-3.1-0.1-4.5-5.7-4.6-18.5-13.6-30.9-26.8-36.7-22.7-10.1-46.5 2.6-74.1 17.4l-0.9 0.5z" fill="#231815" p-id="13239"></path><path d="M512 0C229.7 0 0 229.7 0 512s229.7 512 512 512 512-229.7 512-512S794.3 0 512 0z m0 979.5C254.2 979.5 44.5 769.8 44.5 512S254.2 44.5 512 44.5 979.5 254.2 979.5 512 769.8 979.5 512 979.5z" fill="#231815" p-id="13240"></path></svg>
...@@ -1181,7 +1181,7 @@ export default { ...@@ -1181,7 +1181,7 @@ export default {
chart_pie_rose: 'Rose Pie', chart_pie_rose: 'Rose Pie',
chart_pie_donut_rose: 'Rose Donut Pie', chart_pie_donut_rose: 'Rose Donut Pie',
chart_funnel: 'Funnel', chart_funnel: 'Funnel',
chart_sankey:'Sankey', chart_sankey: 'Sankey',
chart_radar: 'Radar', chart_radar: 'Radar',
chart_gauge: 'Gauge', chart_gauge: 'Gauge',
chart_map: 'Map', chart_map: 'Map',
...@@ -1534,6 +1534,7 @@ export default { ...@@ -1534,6 +1534,7 @@ export default {
no_function: 'Function not enter,please input.', no_function: 'Function not enter,please input.',
chart_flow_map: 'Flow Map', chart_flow_map: 'Flow Map',
chart_city_brightness_map: 'City Brightness Map', chart_city_brightness_map: 'City Brightness Map',
chart_float_map: 'Float Map Module',
chart_city_sweep_map: 'City Sweep Map', chart_city_sweep_map: 'City Sweep Map',
start_point: 'Start point(Lat/Long)', start_point: 'Start point(Lat/Long)',
end_point: 'End point(Lat/Long)', end_point: 'End point(Lat/Long)',
......
...@@ -1179,7 +1179,7 @@ export default { ...@@ -1179,7 +1179,7 @@ export default {
chart_pie_rose: '南丁格爾玫瑰圖', chart_pie_rose: '南丁格爾玫瑰圖',
chart_pie_donut_rose: '南丁格爾玫瑰環形圖', chart_pie_donut_rose: '南丁格爾玫瑰環形圖',
chart_funnel: '漏鬥圖', chart_funnel: '漏鬥圖',
chart_sankey:'桑基圖', chart_sankey: '桑基圖',
chart_radar: '雷達圖', chart_radar: '雷達圖',
chart_gauge: '儀表盤', chart_gauge: '儀表盤',
chart_map: '地圖', chart_map: '地圖',
...@@ -1527,6 +1527,7 @@ export default { ...@@ -1527,6 +1527,7 @@ export default {
no_function: '函數尚未支持直接引用,請在字段表達式中手動輸入。', no_function: '函數尚未支持直接引用,請在字段表達式中手動輸入。',
chart_flow_map: '流向地圖', chart_flow_map: '流向地圖',
chart_city_brightness_map: '城市亮度圖', chart_city_brightness_map: '城市亮度圖',
chart_float_map: '漂浮地圖模塊',
chart_city_sweep_map: '圓形掃光城市', chart_city_sweep_map: '圓形掃光城市',
start_point: '起點經緯度', start_point: '起點經緯度',
end_point: '終點經緯度', end_point: '終點經緯度',
......
...@@ -1561,6 +1561,7 @@ export default { ...@@ -1561,6 +1561,7 @@ export default {
map_line_theta_offset: '弧度', map_line_theta_offset: '弧度',
chart_bubble_map: '气泡地图', chart_bubble_map: '气泡地图',
chart_city_brightness_map: '城市亮度图', chart_city_brightness_map: '城市亮度图',
chart_float_map: '漂浮地图模块',
chart_city_sweep_map: '圆形扫光城市' chart_city_sweep_map: '圆形扫光城市'
}, },
dataset: { dataset: {
......
import { Scene, PointLayer, PolygonLayer, LineLayer } from '@antv/l7'
import { GaodeMap } from '@antv/l7-maps'
import { getLanguage } from '@/lang'
export function baseFloatMapOption(chartDom, chartId, chart, action) {
const xAxis = JSON.parse(chart.xaxis)
let customAttr
if (chart.customAttr) {
customAttr = JSON.parse(chart.customAttr)
}
const size = customAttr.size
const color = customAttr.color
const mapStyle = `amap://styles/${color.mapStyle ? color.mapStyle : 'normal'}`
const lang = getLanguage().includes('zh') ? 'zh' : 'en'
let init = false
if (!chartDom?.map) {
try {
chartDom.destroy()
} catch (e) {
// ignore
}
chartDom = new Scene({
id: chartId,
map: new GaodeMap({
lang: lang,
pitch: size.mapPitch,
// style: mapStyle,
style: 'dark',
// pitch: 60,
// center: [104.58631, 30.71882], // 成阿中心经纬度
zoom: 6.2,
maxZoom: 10
}),
logoVisible: false
})
init = true
} else {
if (chartDom.map) {
chartDom.setPitch(size.mapPitch)
// chartDom.setMapStyle(mapStyle)
}
}
if (xAxis?.length < 3) {
chartDom.removeAllLayer()
return chartDom
}
const texts = []
const newTableRow = chart.data.tableRow.map((item, index) => {
const name = item[xAxis[0].dataeaseName]
const center = JSON.parse(item[xAxis[1].dataeaseName])
const [lng, lat] = center
texts.push({ name, lng, lat })
return {
type: 'Feature',
geometry: {
type: 'MultiPolygon',
coordinates: JSON.parse(item[xAxis[2].dataeaseName])
},
properties: {
name: item[xAxis[0].dataeaseName],
center: JSON.parse(item[xAxis[1].dataeaseName])
}
}
})
const mapData = { type: 'FeatureCollection', features: newTableRow }
const proData = { type: 'FeatureCollection', features: [newTableRow[0]] }
console.log(mapData, proData, texts)
chartDom.removeAllLayer()
.then(() => {
const textLayer = new PointLayer({ zIndex: 2 })
.source(texts, {
parser: {
type: 'json',
x: 'lng',
y: 'lat'
}
})
.shape('name', 'text')
.size(14)
.color('#0ff')
.style({
textAnchor: 'center', // 文本相对锚点的位置 center|left|right|top|bottom|top-left
spacing: 2, // 字符间距
padding: [1, 1], // 文本包围盒 padding [水平,垂直],影响碰撞检测结果,避免相邻文本靠的太近
stroke: '#0ff', // 描边颜色
strokeWidth: 0.2, // 描边宽度
raisingHeight: 200000 + 150000 + 10000,
textAllowOverlap: true
})
const lineDown = new LineLayer()
.source(mapData)
.shape('line')
.color('#0DCCFF')
.size(1)
.style({
raisingHeight: 200000
})
const lineUp = new LineLayer({ zIndex: 1 })
.source(mapData)
.shape('line')
.color('#0DCCFF')
.size(1)
.style({
raisingHeight: 200000 + 150000
})
const lineLayer = new LineLayer()
.source(proData)
.shape('wall')
.size(150000)
.style({
heightfixed: true,
opacity: 0.6,
sourceColor: '#0DCCFF',
targetColor: 'rbga(255,255,255, 0)'
})
const provincelayer = new PolygonLayer({})
.source(proData)
.size(150000)
.shape('extrude')// shape 为 extrude 几何图层用于绘制 3D 的几何体
.color('#0DCCFF')
.active({
color: 'rgb(100,230,255)'
})
.style({
heightfixed: true, // heightFixed 设置 3D 填充图的高度时候固定
pickLight: true, // pickLight 设置 3D 填充图的拾取高亮色是否计算光照。
raisingHeight: 200000,
opacity: 0.8
})
provincelayer.on('mousemove', () => {
provincelayer.style({
raisingHeight: 200000 + 100000
})
lineDown.style({
raisingHeight: 200000 + 100000
})
lineUp.style({
raisingHeight: 200000 + 150000 + 100000
})
textLayer.style({
raisingHeight: 200000 + 150000 + 10000 + 100000
})
})
provincelayer.on('unmousemove', () => {
provincelayer.style({
raisingHeight: 200000
})
lineDown.style({
raisingHeight: 200000
})
lineUp.style({
raisingHeight: 200000 + 150000
})
textLayer.style({
raisingHeight: 200000 + 150000 + 10000
})
})
if (!init) {
chartDom.addLayer(textLayer)// 地图文字
chartDom.addLayer(lineDown)// 漂浮块底部
chartDom.addLayer(lineUp)// 漂浮块顶部线
chartDom.addLayer(lineLayer)
chartDom.addLayer(provincelayer)
}
chartDom.on('loaded', () => {
chartDom.addLayer(textLayer)// 地图文字
chartDom.addLayer(lineDown)// 漂浮块底部
chartDom.addLayer(lineUp)// 漂浮块顶部线
chartDom.addLayer(lineLayer)
chartDom.addLayer(provincelayer)
})
})
return chartDom
}
...@@ -2180,6 +2180,38 @@ export const TYPE_CONFIGS = [ ...@@ -2180,6 +2180,38 @@ export const TYPE_CONFIGS = [
] ]
} }
}, },
// 漂浮地图模块
{
render: 'antv',
category: 'chart.chart_type_space',
value: 'float',
title: 'chart.chart_float_map',
icon: 'float',
properties: [
'size-selector-ant-v',
'title-selector-ant-v'
],
propertyInner: {
'size-selector-ant-v': [
'mapPitch'
],
'title-selector-ant-v': [
'show',
'title',
'fontSize',
'color',
'hPosition',
'isItalic',
'isBolder',
'remarkShow',
'fontFamily',
'letterSpace',
'fontShadow'
]
}
},
// 点击建筑 // 点击建筑
{ {
render: 'antv', render: 'antv',
...@@ -2193,6 +2225,7 @@ export const TYPE_CONFIGS = [ ...@@ -2193,6 +2225,7 @@ export const TYPE_CONFIGS = [
'title-selector-ant-v' 'title-selector-ant-v'
], ],
propertyInner: { propertyInner: {
'color-selector': [ 'color-selector': [
'mapStyle' 'mapStyle'
], ],
......
...@@ -65,6 +65,7 @@ import { mapState } from 'vuex' ...@@ -65,6 +65,7 @@ import { mapState } from 'vuex'
import { baseFlowMapOption } from '@/views/chart/chart/map/map_antv' import { baseFlowMapOption } from '@/views/chart/chart/map/map_antv'
import { baseBubbleMapOption } from '@/views/chart/chart/bubble/bubble_antv' import { baseBubbleMapOption } from '@/views/chart/chart/bubble/bubble_antv'
import { baseCityBrightnessMapOptionAntV } from '@/views/chart/chart/cityBrightness/cityBrightness_antv' import { baseCityBrightnessMapOptionAntV } from '@/views/chart/chart/cityBrightness/cityBrightness_antv'
import { baseFloatMapOption } from '@/views/chart/chart/float/float_antv'
import { baseCitySweepMapOptionAntV } from '@/views/chart/chart/citySweep/citySweep_antv' import { baseCitySweepMapOptionAntV } from '@/views/chart/chart/citySweep/citySweep_antv'
import { clear } from 'size-sensor' import { clear } from 'size-sensor'
import { baseSankeyOptionAntV } from '@/views/chart/chart/sankey/sankey_antv' import { baseSankeyOptionAntV } from '@/views/chart/chart/sankey/sankey_antv'
...@@ -265,7 +266,6 @@ export default { ...@@ -265,7 +266,6 @@ export default {
] ]
} }
} }
console.log('chart.type ',chart.type )
if (chart.type === 'bar') { if (chart.type === 'bar') {
this.myChart = baseBarOptionAntV(this.myChart, this.chartId, chart, this.antVAction, true, false) this.myChart = baseBarOptionAntV(this.myChart, this.chartId, chart, this.antVAction, true, false)
} else if (chart.type === 'bar-group') { } else if (chart.type === 'bar-group') {
...@@ -316,25 +316,23 @@ export default { ...@@ -316,25 +316,23 @@ export default {
this.myChart = baseBubbleMapOption(this.myChart, this.chartId, chart, this.antVAction) this.myChart = baseBubbleMapOption(this.myChart, this.chartId, chart, this.antVAction)
} else if (chart.type === 'city-brightness') { } else if (chart.type === 'city-brightness') {
this.myChart = baseCityBrightnessMapOptionAntV(this.myChart, this.chartId, chart, this.antVAction) this.myChart = baseCityBrightnessMapOptionAntV(this.myChart, this.chartId, chart, this.antVAction)
} else if (chart.type === 'city-sweep') { } else if (chart.type === 'city-sweep') {
this.myChart = baseCitySweepMapOptionAntV(this.myChart, this.chartId, chart, this.antVAction) this.myChart = baseCitySweepMapOptionAntV(this.myChart, this.chartId, chart, this.antVAction)
} else if (chart.type === 'chart_sankey') { } else if (chart.type === 'chart_sankey') {
this.myChart = baseSankeyOptionAntV(this.myChart, this.chartId, chart, this.antVAction) this.myChart = baseSankeyOptionAntV(this.myChart, this.chartId, chart, this.antVAction)
} else if (chart.type === 'threeDColumn') { } else if (chart.type === 'threeDColumn') {
this.myChart = base3DColumnOptionAntV(this.myChart, this.chartId, chart, this.antVAction) this.myChart = base3DColumnOptionAntV(this.myChart, this.chartId, chart, this.antVAction)
} else if (chart.type === 'float') {
this.myChart = baseFloatMapOption(this.myChart, this.chartId, chart, this.antVAction)
} else if (chart.type === 'chart_building') { } else if (chart.type === 'chart_building') {
this.myChart = baseBuildingOptionAntV(this.myChart, this.chartId, chart, this.antVAction) this.myChart = baseBuildingOptionAntV(this.myChart, this.chartId, chart, this.antVAction)
} else { } else {
if (this.myChart) { if (this.myChart) {
this.antVRenderStatus = false this.antVRenderStatus = false
this.myChart.destroy() this.myChart.destroy()
} }
} }
if (this.myChart && !equalsAny(chart.type, 'liquid', 'flow-map', 'bubble', 'city-brightness', 'city-sweep', 'float') && this.searchCount > 0) {
if (this.myChart && !equalsAny(chart.type, 'liquid', 'flow-map', 'bubble', 'city-brightness','city-sweep') && this.searchCount > 0) {
this.myChart.options.animation = false this.myChart.options.animation = false
} }
if (this.myChart?.options?.legend) { if (this.myChart?.options?.legend) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论