maplibre / maplibre-rs

Experimental Maps for Web, Mobile and Desktop
Apache License 2.0
1.34k stars 77 forks source link

Use and doc the default input UI of maplibre-js #186

Closed DerKarlos closed 2 months ago

DerKarlos commented 1 year ago

To welcome the maplibre community to the Rust version, we should offer the same controls as they used to. So we have to check, what controls are used, document and code them in our input control.

🔦 Context

The input controls are not documented. Here one can try them: https://demotiles.maplibre.org/terrain-tiles There is the code (with some doc to): https://github.com/maplibre/maplibre-gl-js/tree/main/src/ui/handler

1st-mousekey, arrow-keys: shift=move=slide=pan the map 100 pixels. (No ADWS-kleys are used) 2nd-mousekey, arrow-keys+shift: rotate the camera-viewangles: direction (15) and up/down (10 degrees) mousewheel, plus-key=equal-key/minus-key: zoom in/out 1 level, or 2 if shift is pressed

1-fingerr-tab: zoom in, double-tab: zoom out 1-finger-touch: shift 2-finger-touch: shift(move) + zoom(pinch) + rotate-direction(twist) 2-finger-touch: rotate-up/down(move) ) ) This mode gets only active if the 2-finger-move-up/down is used first! It blocks pinch and twist and shift-left/right.

💻 Examples

We could document the default input UI in https://github.com/maplibre/maplibre-rs/tree/main/docs/src

maxammann commented 1 year ago

I would love to see an RFC for input handling for maplibre-rs.

RFC would serve as a design foundation. They would describe what we want maplibre-rs to be like on a high level. Here is the RFC for the "RFC Process" of Rust: https://rust-lang.github.io/rfcs/0002-rfc-process.html

I would very much like to see us documenting how maplibre-rs works in the style of RFCs. RFCs can be documented in the maplibre-rs book: https://maplibre.org/maplibre-rs/book/

What do you think?

maxammann commented 1 year ago

This would be an excellent first try for that!

maxammann commented 1 year ago

Oh I just saw that you opened this issue as RFC! Excellent!

Should we turn this into a PR right away and create an RFC section in the Rust book for that? (I have to look again into Rust's process)

DerKarlos commented 1 year ago

Sounds good, go ahead. So I will see the process working. Do I always have to start with an Issue/PR if I intend to add a chapter like "Appreciations" to the Doc? Or is the RFC only used for new features? In a Wiki multiple contributors could just edit a draft, how to do it, a pull request with many merges into it? Pleas just start and show my the steps.

maxammann commented 1 year ago

So RFC would probably not use Github Issues, but only Github PRs:

Fork the RFC repo https://github.com/rust-lang/rfcs Copy 0000-template.md to text/0000-my-feature.md (where 'my-feature' is descriptive. don't assign an RFC number yet). Fill in the RFC Submit a pull request. The pull request is the time to get review of the design from the larger community. Build consensus and integrate feedback. RFCs that have broad support are much more likely to make progress than those that don't receive any comments. (from the RFC RFC)

Usually only a single person edits an RFC and others comment. If working in a team on a PR then people can create suggestions in the PR and the PR owner or admins can accept them.

The Wiki is a Github only feature and I would like to avoid using more proprietary features of Github and lock ourselfes in. Also the Wiki lacks a way of doing a proper review process.

maxammann commented 1 year ago

Possibly duplicate of https://github.com/maplibre/maplibre-rs/issues/91. The two issues can probably be merged.

@DerKarlos can you copy all the important things over to https://github.com/maplibre/maplibre-rs/issues/91? Then close this one.

maxammann commented 2 months ago

Closing as the controls for the UI will likely change a lot