Merge pull request #4959 from dataease/pr@dev@fix_flow_map_init

fix(视图-流向地图): 流向地图初始化使用默认主题,无数据可调节倾角和主题
This commit is contained in:
fit2cloudrd 2023-04-04 14:53:22 +08:00 committed by GitHub
commit cbe212c76a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,7 +11,7 @@ export function baseFlowMapOption(chartDom, chartId, chart, action) {
}
const size = customAttr.size
const color = customAttr.color
const mapStyle = `amap://styles/${color.mapStyle}`
const mapStyle = `amap://styles/${color.mapStyle ? color.mapStyle : 'normal'}`
const lang = getLanguage().includes('zh') ? 'zh' : 'en'
let init = false
if (!chartDom) {
@ -25,6 +25,9 @@ export function baseFlowMapOption(chartDom, chartId, chart, action) {
logoVisible: false
})
init = true
} else {
chartDom.setPitch(size.mapPitch)
chartDom.setMapStyle(mapStyle)
}
if (xAxis?.length < 2 || xAxisExt?.length < 2) {
return chartDom
@ -66,8 +69,6 @@ export function baseFlowMapOption(chartDom, chartId, chart, action) {
.color(color.mapLineSourceColor)
}
if (!init) {
chartDom.setPitch(size.mapPitch)
chartDom.setMapStyle(mapStyle)
chartDom.addLayer(lineLayer)
}
chartDom.on('loaded', () => {