Merge pull request #13524 from dataease/pr@dev-v2@chart-symbolic-map-style

style(图表): 联动到符号地图时,中心位置聚焦到数据点
This commit is contained in:
jianneng-fit2cloud 2024-11-25 12:45:49 +08:00 committed by GitHub
commit c6eb1384f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -106,6 +106,18 @@ export class SymbolicMap extends L7ChartView<Scene, L7Config> {
if (basicStyle.autoFit === false) {
center = [basicStyle.mapCenter.longitude, basicStyle.mapCenter.latitude]
}
// 联动时聚焦到数据点多个取第一个
if (
chart.chartExtRequest?.linkageFilters?.length &&
xAxis?.length === 2 &&
chart.data?.tableRow.length
) {
// 经度
const lng = chart.data?.tableRow?.[0][chart.xAxis[0].dataeaseName]
// 纬度
const lat = chart.data?.tableRow?.[0][chart.xAxis[1].dataeaseName]
center = [lng, lat]
}
const chartObj = drawOption.chartObj as unknown as L7Wrapper<L7Config, Scene>
let scene = chartObj?.getScene()
if (!scene) {