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

在同步地图的基础上,需要一个同步hover或者click的功能,但湿了emit好像无效,有没有解决办法 #2653

Open
yyyykl opened this issue Dec 27, 2024 · 2 comments
Assignees

Comments

@yyyykl
Copy link

yyyykl commented Dec 27, 2024

const onSceneLoaded = (scene: Scene, mapId: string) => {
    setSceneArray((oldValue) => [...oldValue, scene]);
    if (mapId === 'baseScene') {
      map1Ref.current = scene; // 保存第二个地图的引用
      scene.on('click', (event) => {
        if (map2Ref.current) {
                map2Ref.current.emit('click', {
                  type: 'click',
                  lngLat: event.lngLat,
                  point: event.point,
                  target: map2Ref.current,
                });
        }
      });
    }
    if (mapId === 'baseScene2') {
      map2Ref.current = scene;
    }
  };
Copy link
Contributor

hi @yyyykl, welcome!

Copy link
Contributor

Hi @yyyykl, Please star this repo if you find it useful! Thanks ⭐!
你好~ @yyyykl 🌟 如果这个仓库对你有帮助,可以给我们点个star支持一下~你的支持对我们来说是最大的鼓励,感谢你的支持与点赞 🌟

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

2 participants