Merge pull request #13524 from dataease/pr@dev-v2@chart-symbolic-map-style
style(图表): 联动到符号地图时,中心位置聚焦到数据点
This commit is contained in:
commit
c6eb1384f4
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user