Skip to content

Commit

Permalink
fix: 修复在 Map 上使用组件事件穿透到图层上的问题 (#2518)
Browse files Browse the repository at this point in the history
* fix: 修复在 Map 上使用组件事件穿透到图层上的问题

* chore: add changeset
  • Loading branch information
lvisei authored Jun 4, 2024
1 parent 100fd87 commit 8939e9b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/gold-fans-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@antv/l7-maps': patch
---

fix: 修复在 Map 上使用组件事件穿透到图层上的问题
16 changes: 16 additions & 0 deletions packages/maps/src/map/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,22 @@ export default class DefaultMapService extends BaseMapService<Map> {
this.handleCameraChanged();
}

protected creatMapContainer(id: string | HTMLDivElement) {
let wrapper = id as HTMLDivElement;
if (typeof id === 'string') {
wrapper = document.getElementById(id) as HTMLDivElement;
}
const container = document.createElement('div');
container.style.cssText += `
position: absolute;
top: 0;
height: 100%;
width: 100%;
`;
wrapper.appendChild(container);
return container;
}

public exportMap(type: 'jpg' | 'png'): string {
const renderCanvas = this.map.getCanvas();
const layersPng =
Expand Down

0 comments on commit 8939e9b

Please sign in to comment.