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

3D Map not instantiating #991

Closed
Bonkles opened this issue Jul 25, 2023 · 3 comments
Closed

3D Map not instantiating #991

Bonkles opened this issue Jul 25, 2023 · 3 comments
Assignees
Milestone

Comments

@Bonkles
Copy link
Contributor

Bonkles commented Jul 25, 2023

Description

when I hit the shortcut key, the 3D map isn't coming up.

Also, the background panel 'Show 3D Map' checkbox errors out with a stacktrace when clicked:

Uncaught TypeError TypeError: Cannot read properties of null (reading 'jumpTo')
    at updateProjection (/Users/clarkben/working/RapiD/modules/ui/map3d_viewer.js:33:38)
    at redraw (/Users/clarkben/working/RapiD/modules/ui/map3d_viewer.js:21:7)
    at <anonymous> (/Users/clarkben/working/RapiD/modules/ui/map3d_viewer.js:220:28)
    at call (/Users/clarkben/working/RapiD/node_modules/d3-dispatch/src/dispatch.js:57:72)
    at tick (/Users/clarkben/working/RapiD/node_modules/d3-transition/src/transition/schedule.js:141:15)
    at timerFlush (/Users/clarkben/working/RapiD/node_modules/d3-timer/src/timer.js:61:48)
    at wake (/Users/clarkben/working/RapiD/node_modules/d3-timer/src/timer.js:71:5)

Version

2.0.3

What browser are you seeing the problem on? What version are you running?

any/all

The OS you're using

MacOS 13

Steps to reproduce

Hit 'B' for background panel -> click on 'Show 3D Map' to observe the stack trace.

Also use the 'cmd+/' hotkey to observe that the minimap doesn't toggle when pressed.

The browser URL at the time you encountered the bug

n/a

The auto-detected useragent string for your browser (leave blank if you're manually filling this form out)

No response

@Bonkles Bonkles added this to the v2.1 milestone Jul 25, 2023
@Bonkles Bonkles self-assigned this Jul 25, 2023
@Bonkles
Copy link
Contributor Author

Bonkles commented Jul 26, 2023

Ah, with the new service / systems rewrite that @bhousel did, this '3d map' system isn't started by default. As such, whenever the user requires it, the system will now be started as soon as the 'toggle' method is invoked. This brings the map up correctly.

This is much easier to follow and reason about! I simply needed to create the maplibre container for canvas to fit in, and be sure to call 'startAsync' after that container is created. Nice.

@bhousel
Copy link
Contributor

bhousel commented Jul 27, 2023

Cool! Sorry I wasn't more clear with what I was doing..
All of the core systems now support deferring some of their startup work until it's actually needed - this is useful for anything that has extra code that needs to fetch (like the maplibre bundle, or mapillary viewer, or osmose strings, etc - we do a lot of this!). It makes the startup of the main parts of Rapid much quicker.

I think we will want to throttle the redraws of the 3D map, because the move/draw events from the main map will fire a lot. We're going to definitely want to profile how much time is being spent converting the main map data into features to show on the 3d map.. But this should get things working again for now.

@Bonkles
Copy link
Contributor Author

Bonkles commented Jul 27, 2023

You were very clear in what you were doing- this was just my first exposure to it so it took a little bit (not much!) of figuring out the new system startup/deferral type machinery you put in. The ability to control the instantiation of the mapLibre map until it's demanded is pretty great.

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

No branches or pull requests

2 participants