-
Notifications
You must be signed in to change notification settings - Fork 27
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
Uniffi React Native Integration #401
base: main
Are you sure you want to change the base?
Conversation
…ostarCore state to the view
Edit: I've added these. |
Initial version of puck, route and trip progress view. Screenrecorder-2024-12-24-07-28-28-106.mp4I have discover one issue and it's that I don't think we can currently override the current location that MapLibre is using within maplibre-react-native. I'm wondering if @KiwiKilian might know of any available solution here or if it's something that's going to need to be exposed on that libraries side. |
Just glanced at your recent commits, do I understand correctly:
Currently there is no clean way to do this. I'm not sure if we you actually want to override the |
Yes we only want to use the snapped location when we are navigating and if our snappedToRoute options is enable in the FerrostarCore, I think the android version does this using a StaticEngine and inserts that into MapLibre @ianthetechie might be able to explain that a bit better. But I don't think that will probably be the best approach here.
I really like this idea and I agree users might want a different functionality here, is this something that could be extracted here or have to be expose on the maplibre-react-native side? |
MapControl need a bit of work, we need some fonts for the +, -, mute, route and recenter button (I've tried + & - as just normal character but it doesn't look good) will look at extracting some google fonts as I think that's what we are using on Android. We will also need to sort out the camera state mostly for the route overview and recenter. I don't think we can just apply a the navigation camera again to reset like we do on Android. So will have to look at keeping a camera state some where probably a provider that will get updated via the |
Background
After testing an expo modules approach in this PR #394 . We have found that the work to maintain the record types between the Rust layer and expo modules would be too tendinous. So this PR has an initial implementation of using uniffi-bindgen-react-native to create a similar binding as Android and iOS. One downside of this is we have to implement the views all again just for react-native but this downside is worth it long term definitely since the FerrostarCore-RS is still changing it's model quite frequently.
Implementation overview
Implementation of the core integration is following the current Android implementation quite closely apart from segments where there our missing language features and such. We are using uniffi-bindgen-react-native to create the Rust binding the generated TypeScript types are located in
src/generated
.Current status
Please let me know missing implementations that should be on the list and I will update it.