stadiamaps / ferrostar

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

Common/suggested camera calculations (meta-issue) #38

Open ianthetechie opened 4 months ago

ianthetechie commented 4 months ago

Every frontend will be in charge of camera handling, and in many cases, the user may be allowed to temporarily take over. However, for the case of the "default" camera following the user around during navigation, we want to outsource this logic in a fairly generic manner to the core, which returns the key bits to be translated into camera control of the renderer by the frontend.

This issue will track individual cases until we finish the next milestone.

Archdoog commented 4 months ago

Yep, this is a solid idea. A couple of notes either new or from previous discussions:

ianthetechie commented 4 months ago

Beyond the basics like speed or speed limit based zoom/pitch, I can see needing different versions of the camera parameters for a mobile UI versus CarPlay/AndroidAuto within the same app.

Yes, good call-out! I think there are a few things packed into this so let me try to get it all out in the open.

  1. With no other configuration, we will compute other parameters like zoom and pitch assuming something sane like phone + automotive navigation.
  2. We should probably also add profiles for in-dash use (or large screen? help welcome on deciding what kind of thing this is) with sensible defaults.
  3. We should also allow the developer end-users of the framework to provide their own implementations. Of course users wanting to throw out the "batteries included" UI can always write their own logic, but we want to provide a way that plugs into the provided UI components as a matter of principle. Since we are trying to make the UI as composable as possible, most people should be able to override the logic for, say, zoom level and then not have to reimplement their own UI.

Anything I'm missing?

Considerations to enable future configurations (e.g. bbox for next maneuver)

Yeah, that's actually a really good call-out too. Many navigation experiences will want this to be able to quickly show a maneuver and highlight it in a route detail. I think this should actually be a property on RouteStep. Let me know if you agree and I'll capture that in an issue.

It should be extremely easy to extend either by adding either fields to the data structures (for stuff that is useful for a wide range of applications) or extension methods and the like (for those which are not used as often / make sense to compute lazily).

ianthetechie commented 4 months ago

@Archdoog to do a SwiftUI first pass at what the core state value looks like.

ianthetechie commented 2 months ago

Ok, so first thoughts on this now that I'm getting into it...

Desirable properties

Points of observation

Where we go from here

ianthetechie commented 2 months ago

Some salient points from the discussion with @Archdoog today: