lebanta
lebanta

Reputation: 13

How to add event at mapbox popup

I need to know how to use events like mouseover, click for the popup, when the popup is opened. I can't find anything about this functionality for Angular.

When the popup is opened I need to handle mouseover event for this popup! Thanks!

   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);

Upvotes: 0

Views: 123

Answers (1)

lebanta
lebanta

Reputation: 13

Just add the event at DOM and it will work. ( i had a mistake at my HTML and it didn't worked)

Upvotes: 0

Related Questions