-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Allow custom cursors via filename/CSS #13266
Labels
Comments
Hi @stepankuzmin and @jackplo, I have gone through this repo and came across this issue. I have a query regarding what we are considering to be interactive—specifically, when the cursor should change. Is it when the user hovers over the landmarks, or while zooming in or out? As this repo is not responsible for displaying information about the landmarks, I’d like to clarify this. Thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Motivation
Custom pointers on layer interactions. I want to be able to change the cursor to a custom .cur/.svg when hovering over different layers on the map. This will allow users to visually identify that certain symbols on the map may have interactive properties.
Design Alternatives
Allow me to use custom CSS classes to overwrite the cursor on mouseover, mouseenter, and mouseleave events or make map.getCanvas().style.cursor able to take custom cursors.
Design
Either design works and both seem minimally invasive to the current functionality of the mapbox cursors. I don't believe there are any drawbacks, I think this is a pretty intuitive feature that would provide significant enhancement to the UI/UX of mapbox.
Mock-Up
Developers:
This could be easy as one line of code for developers. For example in a 'mouseenter' event, a developer could simply set the cursor to a custom .cur/.svg file. Example:
End Users:
This would just look like the existing functionality for cursor events but replace it with a custom cursor.
Concepts
This feature could just be an addition to the current wiki page about mouse/cursor events.
I think the terminology could just be "Custom Cursor."
This feature relates to the current cursor functionality associated with mapbox mouse events.
The concept just introduces a new option customization in an intuitive way.
Implementation
For both C++ & Javascript the design implementation would be as simple as the folllowing:
Edgecases:
The text was updated successfully, but these errors were encountered: