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

Add 2D/3D visibility switch #360

Merged
merged 23 commits into from
Jun 13, 2024
Merged

Conversation

andreeaceachir142
Copy link
Contributor

What

  • Add 2D/3D visibility switch component which can only be visible if the mapbox, 3dwalls and floorplan modules are enabled in the CMS

How

  • Create a mapboxViewMode atom which can hold three values: initial3D, clicked3D or clicked2D
  • Create a currentPitch Recoil selector that combines the pitch property with the mapboxViewMode into a calculated value.
  • Create a ViewModeSwitch.jsx component which holds the switch buttons and sets the mapboxViewMode when clicked. It also sets the desired pitch and turns on and off the visibility of features on the map.
  • The useMapBoundsDeterminer uses the currentPitch selector to apply the correct pitch when eg. a venue changes.
  • Use the useReset method to handle the timeout property

Copy link
Contributor

@ammapspeople ammapspeople left a comment

Choose a reason for hiding this comment

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

🆗

@andreeaceachir142
Copy link
Contributor Author

Ready for review again, fixed all the issues found earlier. ✅ @ammapspeople

@ammapspeople
Copy link
Contributor

@andreeaceachir142 I just realized this: we're adding a new way of adding a UI control on top of the map (let's call it technical debt).
The venue selector and 2D/3D switch visually belong to the same group of elements. Also, styling & position would be more straightforward if they actually did.
We could try to use a React portal to make that happen.
But that could be a separate "tech debt removal" task.

@ammapspeople
Copy link
Contributor

Other than that, I maintain my approval ✅ 🆗

@andreeaceachir142 andreeaceachir142 merged commit 5a95d1e into main Jun 13, 2024
@andreeaceachir142 andreeaceachir142 deleted the feature/2D-3D-switch-take-2 branch June 13, 2024 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants