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

vue3 使用 响应式ref绑定scene 使用l7-draw 工具报错 #2241

Closed
Gor-c opened this issue Jan 4, 2024 · 1 comment
Closed

vue3 使用 响应式ref绑定scene 使用l7-draw 工具报错 #2241

Gor-c opened this issue Jan 4, 2024 · 1 comment
Assignees
Labels
good first issue Good for newcomers

Comments

@Gor-c
Copy link

Gor-c commented Jan 4, 2024

版本:
"@antv/l7": "^2.20.13",
"@antv/l7-draw": "^3.1.1",
"@antv/l7-maps": "^2.20.13",

示例代码:

import { Scene } from '@antv/l7';
import { GaodeMap } from '@antv/l7-maps';
import { ControlEvent, DrawControl } from '@antv/l7-draw';

const scene = new Scene({
  id: 'map',
  map: new GaodeMap({
    style: 'light',
    center: [116.1608, 40.1119],
    zoom: 15,
  }),
});
scene.on('loaded', () => {


  const drawControl = new DrawControl(scene, {});
  scene.addControl(drawControl);
  drawControl.on(ControlEvent.DrawChange, (changeType) => {
    console.log(changeType);
  });
});

源码里直接写死了 scene,导致 找不到对象内的 方法,是否应该 使用this 来统一处理
image

Copy link
Contributor

github-actions bot commented Jan 4, 2024

hi @Gor-c, welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants