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

Fix 3D map toggle in side bar #1282

Merged
merged 1 commit into from
Jan 2, 2024
Merged

Fix 3D map toggle in side bar #1282

merged 1 commit into from
Jan 2, 2024

Conversation

tannerwuster
Copy link
Contributor

@tannerwuster tannerwuster commented Jan 2, 2024

There was an issue that if you check the 3D checkbox to show 3D map, nothing happens. This now works and fixes #1273

@tannerwuster tannerwuster changed the title ix 3D map toggle in side bar Fix 3D map toggle in side bar Jan 2, 2024
@tannerwuster tannerwuster marked this pull request as ready for review January 2, 2024 17:34
@bhousel bhousel added this to the v2.2.2 milestone Jan 2, 2024
@@ -277,7 +274,6 @@ export function uiMap3dViewer(context) {
map.on('draw', () => redraw());
map.on('move', () => redraw());
context.keybinding().on([uiCmd('⌘' + l10n.t('background.3dmap.key'))], toggle);
urlhash.on('hashchange', toggle);
Copy link
Contributor

Choose a reason for hiding this comment

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

My initial thought is that it would be a shame to lose the connection between the map3d urlhash param, and the state of the viewer, but looking elsewhere around the code it seems like this was never really set up correctly so we aren't losing anything.

I expect it to work like this:

  • checking/unchecking the box updates the map3d=true to the urlhash
    (something like urlhash.setParam('map3d', !_isHidden ? 'true' : null))
  • changing the urlhash updates the state of the box and viewer
    (something like urlhash.on('hashchange', doStuff))

Basically we should just look at how PhotoSystem or ImagerySystem works and make Map3dSystem work more like those.

Anyway, I'm going to just merge this because we need to patch the bug, but we should improve this later.

@bhousel bhousel merged commit 95f534b into main Jan 2, 2024
4 checks passed
@bhousel bhousel deleted the 3D_map_menu_fix branch January 2, 2024 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can not turn on 3D Preview with mouse click
3 participants