Is there a simple way to have a custom cursor for a map? The following code I have works very nicely, it's simple too but it's just a predefined option :
map.getCanvas().style.cursor = 'default';
Is it possible to have something like this? :
map.getCanvas().style.cursor = url('custom.png');
You can change the style of the cursor through the css of the mapboxgl canvas container :
.mapboxgl-canvas-container { cursor: url(/path/to/cursor.png), auto !important }
[ https://jsfiddle.net/dpbx96of/ ]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With