如何在地图框弹出窗口添加事件

问题描述 投票:0回答:1

我需要知道如何使用鼠标悬停、单击弹出窗口等事件,当弹出窗口打开时。我找不到有关 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);
angular mapbox mapbox-gl-js mapbox-gl mapbox-marker
1个回答
0
投票

只需在 DOM 中添加事件即可。 (我的 HTML 有一个错误,它不起作用)

© www.soinside.com 2019 - 2024. All rights reserved.