Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 ChoroplethLayer组件的onCreated方法中监听不到legend的变化 #187

Open
Dreammy23 opened this issue Sep 26, 2023 · 0 comments

Comments

@Dreammy23
Copy link
Contributor

Dreammy23 commented Sep 26, 2023

/### 使用ChoroplethLayer行政区下钻组件时,想监听 legend 改变的方法,发现没有生效

<ChoroplethLayer
      id="boundsLayer"
       autoFit: true,
       fillColor: {
         field: 'predictsValue',
         value: [
          '#fadfce',
          '#ffbb96', 
          '#ff8f5b',
          '#fc6e35',
          '#f03c21',
        ]
      },
      zIndex: 0,
      opacity: 0.8,
      lineWidth: 1,
      label: {
        field: 'areaName',
        visible: true,
        style: { fill: 'black', fontSize: 12, stroke: '#fff', strokeWidth: 1 },
      },
      source={{ data: boundData }}
      onCreated={(layer) => {
        layer?.on('legend:color', () => console.log('监听legend:color')); // 无效,没有打印语句
        layer?.on('legend', () => console.log('监听legend')); // 无效,没有打印语句
        layer?.on('dataUpdate', () => console.log('监听legend')); // 生效,有打印语句
      }}
    />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant