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

Feat: Map controls #47

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ashkalor
Copy link

@ashkalor ashkalor commented Aug 16, 2024

Hey @TiagoCavalcante

This pull request will add support for map controls without having any breaking changes. It will also fix issues faced by #31 and #40

#31 - The main problem here was that in react native locationX and locationY values get reset when you enter a new view this would cause abrupt reset of target. Using PageX and PageY will fix this issue
This can additionally be improved by having a function that checks if touches are outside the canvas and use that to prevent any actions if touches go outside canvas

#40 - I have added the support for Map controls, the changes closely reflect the gesture system used by google maps that native users are more familiar of compared to the existing implementation of map controls in threejs

One finger touch to Pan
Two finger rotation to Rotate
Two finger vertical movement for tilt
Two finger pinch for zoom

Description of commits

  • Adds Map control
  • Uses absolute values over relative values (Page over location) as location values reset on entering a different view.

WRT, to API there are no breaking changes so a new release version should be able to support orbit controls and map controls out of the box, However I have internally changed the structure of code to support both the modes effectively
We can together re do this if you prefer it in a different way.
Please let me know if you need any additional changes to get this merged.

I personally believe that the correct way to using these controls would be to implement React native gesture handler for handling the gestures but untill then this could be the first working version of map controls for react native.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant