Skip to content

Commit

Permalink
fix: fix: 修复在 Map 上使用组件事件穿透到图层上的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
lvisei committed Jun 3, 2024
1 parent eed9710 commit 286e153
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/maps/src/map/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@ export default class MapService extends BaseMapService<Map> {
this.handleCameraChanged();
}

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

protected handleCameraChanged = () => {
const { lat, lng } = this.map.getCenter();
const center: [number, number] = [lng, lat];
Expand Down

0 comments on commit 286e153

Please sign in to comment.