-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Separation of map rendering and input controls in different Rust crates #185
Comments
Yes, I would very much like to see such an API. Input processingThe only issue we have to navigate around is that input depends on a "windowing library". That is for example right now winit. In the future we might replace winit on iOS or Android because it is not sufficient right now. That's why we already have the I would say that Input handlingThat is one part of the story. The other is to make the map to things. That could be a different kind of API. SummaryAs you can see there are multiple layers which must be though of. E.g. for users of the renderer the way how input is processed is maybe not important, but how input is handled. On the other hand there might be users who want to port maplibre-rs to another platform. Those users would be interested in customizing the input processing. |
So winit is only for windows/desktop, not like wgpu generated according to the target? This issue was mend for custom controls, not for winit. And event-based is in issue #91 The controler api should be the
Hm? That means, the user can not change the control reactions, as I intended. In maplibre-JS the input events generate deltas and new set values for the map. The map is an extended camera! The set values can be jumped to or interpolated by the map. We may do the same. The interpolation would be in the map crate and the input reactions in the control crate. |
Winit is only for complete apps, running the entire app lifecycle in it (in Rust). I presume maplibre-rs also targets running as single embedded view within an externally defined Android app? |
May I write an extra issue for winit? |
@DerKarlos What do you want to make an issue about, and what do you expect as response/outcome? |
I made this issue about controlers. |
It also supports mobile, but not in a way in which we require it. winit currently only supports full screen apps. I'm not sure if changing/extending winit is desired, or if we implement the parts we need ourselves. I think we have a little bit too much issues now open about how we want to handle input. We also need to think first about how to support the low-level features of input handling and then we can go and think about defining "different controls". For example right now pinch-to-zoom is not working on the web, android and ios. Also it is not possible to update the view e.g. from click listeners in browsers. So there is a lot of basic work required. |
The core feature of maplibre, rendering the map/scene, should be in a Rust crate like "osm-ml-render".
The "default" control should be in a separate Rust crate like "osm-ml-def-controls".
A demo application shows use both crates.
🤔 Expected Behavior
A user of maplibre-rs could replace the control by a deviated, user defined control.
😯 Current Behavior
The whole repository has to be forked.
💁 Possible Solution
We offer an core Rust crate for rendering OSM, independent of any input UI
and a separate control crate, a user could fork and adapt as wished.
The window input events will go into the control instance
and the camera will be moved to change the view of the map
🔦 Context
There are different possible uses and such controls for OSM map and 3D rendering.
Even gamification with 1st or 3rd person controls are possible.
💻 Examples
An air plain simulator will have quite a different control but may use the same OSM rendering.
The text was updated successfully, but these errors were encountered: