Skip to content

Can I show popup on mouse hover on marker? #361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sudhanshu-hytech opened this issue Apr 1, 2022 · 2 comments
Open

Can I show popup on mouse hover on marker? #361

sudhanshu-hytech opened this issue Apr 1, 2022 · 2 comments

Comments

@sudhanshu-hytech
Copy link

sudhanshu-hytech commented Apr 1, 2022

I am currently showing markers and popups on click of markers. We have a requirement now to show popups on hover.

my template is like below :

                            <mgl-map #map1 
                                [style]="'mapbox://styles/mapbox/streets-v11'" 
                                [zoom]="[4]"
                                [maxZoom]="maxZoom"
                                [center]="[-95.7129, 37.0902]"
                                [fitBounds]="bounds"
                                [fitBoundsOptions]="boundsOptions">
                                <mgl-control mglNavigation [showCompass]="false"></mgl-control>
                                <ngContainer *ngFor="let deal of unlockedDeals">
                                    <mgl-marker #myMarker [lngLat]="lngLat[deal.deal_id]">
                                        <div class="marker"></div>
                                        <span><b>{{ deal.deal_name }}</b></span>
                                    </mgl-marker>
                                    <mgl-popup [marker]="myMarker" class="" [closeButton]="true" [closeOnClick]="false"
                                        [anchor]="'top'">
                                        <div class="marker-popup-details">
                                         custom popup
                                        </div>
                                    </mgl-popup>
                                </ngContainer>
                            </mgl-map>

no code relevant to map in component.

Kindly advise

@sudhanshu-hytech
Copy link
Author

any help on this?

@791045873
Copy link

Mapbox don't have hover event on marker.
Maybe you can use a layer, and add hover event on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants