我需要知道如何使用鼠标悬停、单击弹出窗口等事件,当弹出窗口打开时。我找不到有关 Angular 的此功能的任何信息。 当弹出窗口打开时,我需要处理此弹出窗口的鼠标悬停事件! 谢谢
const popup = new mapboxgl.Popup({
offset: 25,
anchor: 'left',
className: 'popup',
});
this.cdRef.detectChanges();
popup.setDOMContent(this.toolTip.nativeElement);
let coords = this.reverseCoords(
this.segmentsArray[index]?.segmentLocation.coordinates as any
);
const marker = new mapboxgl.Marker()
.setLngLat(coords)
.setPopup(popup)
.addTo(this.map);
只需在 DOM 中添加事件即可。 (我的 HTML 有一个错误,它不起作用)