Hi there! This is just a default thing with Mapbox. Sometimes you might not want a marker to change the cursor, for instance, if a marker isn’t clickable. The markers (note, not labels, but plain markers) do have a class that you can edit: mapboxgl-marker or maplibregl-marker. You could add a hover effect to that class and it should work!
thank you for the answer.
I added the code below as custom css and it works for the default markers but not for my custom markers loaded as images
.mapboxgl-marker {
cursor:pointer !important;
}
Hello, do you have the map anywhere that I can take a look at it to see if I can spot the issue? In general, custom image markers do have cursor changes when hovered over.
The map link: https://ghost-map.it/
-
This reply was modified 2 years, 7 months ago by
massimo1980.
Thanks for the link, I can see it. It’s because of the way the markers are added, they are actually icons, not markers technically in the Mapbox API. I will look into setting a condition that changes the cursor when hovering over one of these. It may be a few days, I’m currently travelling, please email me at [email protected] if possible so I can support more!
This issue has been resolved with a fix currently in beta, to come out with the next release (1.2.38). Label/icons will now change cursor when hovered over if they have a popup attached.