stadiamaps / ferrostar

A FOSS navigation SDK built from the ground up for the future
https://stadiamaps.github.io/ferrostar/
Other
91 stars 10 forks source link

First pass at snapped/following camera calculation #39

Open ianthetechie opened 4 months ago

ianthetechie commented 4 months ago

We want the core to calculate most parameters so that all rendering frontends can implement the standard "following" camera consistently.

This information should be returned as part of TripState.

Components needed:

ianthetechie commented 3 months ago

We will get smoothed course eventually out of #23. Heading should be able to benefit from similar techniques. This isn't necessary for the first pass though, so I'm changing the descriptions of those.

Some more notes after further research in https://github.com/stadiamaps/ferrostar/issues/38#issuecomment-1987300282:

ianthetechie commented 3 months ago

Ok, so capturing the back and forth after discussion and a lot of work on implementation:

ianthetechie commented 2 months ago

We'll probably also need to have (in each platform + renderer pair) more than one way to customize cameras.

In the MapLibre world, for example, we'll want to support controlling the camera completely yourself, as well as keeping the "following" mode on but specifying a custom zoom level.

I THINK this zoom only control will be necessary since MapLibre seems to have its own internal logic for trying to smooth things when tracking and it makes sense to leverage that and push for improvements upstream as needed.

But full custom should also be supported. I'll work on this next week, with a focus on Android first.

ianthetechie commented 1 month ago

As far as I can tell, #95 finishes everything we could possibly want on iOS, but we still need to basically port the same stuff back to Android. I think your recent compose work on Android @Archdoog has also enabled the same behaviors, but it just needs to be exposed in the NavigationMapView.