Skip to content
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

Navigation mode to tilt and orientate map to users perspective #1896

Closed
wants to merge 2 commits into from

Conversation

NSUWAL123
Copy link
Contributor

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation
  • πŸ§‘β€πŸ’» Refactor
  • βœ… Test
  • πŸ€– Build or CI
  • ❓ Other (please specify)

Related Issue

Describe this PR

  • Tilt map by 45 degrees on geolocation toggle

Screenshots

image_720

@NSUWAL123 NSUWAL123 requested a review from spwoodcock November 18, 2024 11:59
@github-actions github-actions bot added the enhancement New feature or request label Nov 18, 2024
@NSUWAL123
Copy link
Contributor Author

We would only tilt the map on the geolocation trigger or should we also add other functionalities(needs discussion) if the geolocation is on?
CC: @spwoodcock @manjitapandey

@spwoodcock
Copy link
Member

The long tern goal is to have a navigation mode I think.

User clicks a button to navigate to a building.

The map tilts / pitches and orientation rotation starts. We face the map in the direction the user is facing.

Then the next step is to work out adding routing as a polyline to follow.

Do you think the first part is achievable now (without routing?)

@NSUWAL123
Copy link
Contributor Author

I'll have a look at that.
I tried to add map rotation based on device rotation but it makes the UI a bit laggy & zooming in and out the map is also laggy. But have to do more research.
There's a routing feature on Maplibre but have to do research on how we can integrate it.

@spwoodcock
Copy link
Member

spwoodcock commented Nov 22, 2024

@charliemcgrady do you know how we could achieve a smooth map rotation experience in MapLibre when the device orientation changes?

We want to have a UX similar to most other mapping apps, with geolocation point and oritentation displayed with a blue arc in the normal view (we have this working).

But then we want a navigation mode where the map pitches to 30o (we also have this working), and the map rotates to look in the direction the user is oriented (the lagging problem Nishit described).

Eventually we want routing too, but that's another problem to solve!

@spwoodcock spwoodcock changed the title Feat/map tilt on location Navigation mode to tilt and orientate map ti users perspective Nov 22, 2024
@spwoodcock spwoodcock changed the title Navigation mode to tilt and orientate map ti users perspective Navigation mode to tilt and orientate map to users perspective Nov 22, 2024
@spwoodcock
Copy link
Member

@NSUWAL123 I think the spec of this has changed slightly taking into account #1909

Ideally we want:

  • Geolocation dot and orientation arc by default when the page loads (if the user accepts permissions).
  • A separate button to go in 'navigation mode':
    • The orientation arc is removed as it's not needed.
    • The geolocation dot icon changes to an arrow.
    • The map pitches to an angle.
    • The map rotates to match the users orientation.

I'm basically describing Google maps navigation or similar!

Copy link
Member

@spwoodcock spwoodcock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment πŸ‘

@NSUWAL123
Copy link
Contributor Author

Sure, I'll be looking at routing today.
Found this: https://maplibre.org/maplibre-gl-directions/#/
But don't know exactly if this would work as per our requirement

@spwoodcock
Copy link
Member

Routing is complex! I don't this we should address the routing quite yet, but just allow for navigation mode that tilts the view and causes map rotation with the device πŸ‘

@spwoodcock
Copy link
Member

@NSUWAL123 I think the spec of this has changed slightly taking into account #1909

Ideally we want:

  • Geolocation dot and orientation arc by default when the page loads (if the user accepts permissions).
  • A separate button to go in 'navigation mode':
    • The orientation arc is removed as it's not needed.
    • The geolocation dot icon changes to an arrow.
    • The map pitches to an angle.
    • The map rotates to match the users orientation.

I'm basically describing Google maps navigation or similar!

I think these points should be enough requirements for now πŸ˜ƒ

@NSUWAL123
Copy link
Contributor Author

Oh. Achieved this state till now where routing is done from geolocation to the entity. But still need to work on live routing on the basis of live geolocation and refactoring the code.
image

So I'll finish the above mentioned priority requirement points and other issues then will revisit this routing feature again later.

@spwoodcock
Copy link
Member

I mean, this is incredible if it works!

I assume routing is based on OSM and this would be great for many scenarios. Obviously not perfectly in all, but it's a really nice addition regardless! Great work 😁

@NSUWAL123 NSUWAL123 closed this Dec 10, 2024
@NSUWAL123
Copy link
Contributor Author

NSUWAL123 commented Dec 10, 2024

@NSUWAL123 NSUWAL123 deleted the feat/map-tilt-on-location branch December 10, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants