Joysticks for Viewer

I’d like to make some modifications to the UI to make it easier for people to navigate on their phones/tablets. I would like to add some joysticks to make it easier for people to move without having to pinch and zoom.

Do you know where I could start my quest to figure this out?

1 Like

Hi @bowen_utahbim

I would suggest you use an existing library for web onscreen joysticks like this one (may not be the best one, just one that I quickly found), and then command the camera using the viewer’s setView function with a PolarView as argument constructed from the data the joystick library provides.

Cheers

Hi @alex ,

Thank you for your response on this. As a total noob, how could we add this to an instance of the viewer? Would we have to create our own instance (like you can do with Forge Viewer)?

Is there documentation around this that I could look at?

Hi @bowen_utahbim

The viewer API documentation is here.

A simple example for using the viewer in your own application is our sandbox.

You will need to add your own custom code in order to get it working. The actual on screen joysticks will have to be handled separately by a module of your own, since the viewer has no inbuilt functionality related to joysticks or other on screen controls. But once you have the joysticks running, you can use the setView method from the viewer’s API to control the camera.

As a side note, we’ve been working on a new version for the viewer API which will make a lot of things (including the thing you want to do) far easier to implement. We’ll keep you posted on the forum regarding it’s progress!

Cheers

1 Like

Hi @alex,

This is great to know! When do you foresee the new viewer coming about? Is this in a couple of weeks, months, or next year?

1 Like

No promises. However this is an active initiative, we work hard, and you may have noticed improvements come thick and fast here at Speckle. We will be talking about progress and roadmap at the next Community Standup

2 Likes