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

Difficulties to understand how to get the menuGlobe working #1178

Open
thomleysens opened this issue Jul 15, 2019 · 4 comments
Open

Difficulties to understand how to get the menuGlobe working #1178

thomleysens opened this issue Jul 15, 2019 · 4 comments
Milestone

Comments

@thomleysens
Copy link

My Environment

  • Version used: iTowns v2.12.0
  • Browser Name and version: Mozilla Firefox 67.0.4 (64 bits)
  • Operating System and version (desktop or mobile): Ubuntu 18.04.2 LTS (64 bit)
  • Link to your project:

Difficulties

Hi,

It appears to be difficult to understand how to configure the menuGlobe.

Maybe I'm wrong but I didn't find anything in the iTowns documentation. There is a lot of examples and it is great but it is not easy to understand how to build a menu (to manage opacity and visibility of layers).
We have to use:

As I understand it, GuiTools.js uses a specific version of the dat.gui JS library without the CSS and specific CSS in example.css and we have to also use debug.js to make loops like this:

for (var layer of this.view.getLayers()) {
       layer.whenReady.then(  (layer) => {
                   if (layer.visible != undefined)
                   {
                     var gui = debug.GeometryDebug.createGeometryDebugUI(this.menuGlobe.gui, this.view, layer);
                  }
                 });
             }

It takes time to understand this. A simple example on how to build a menu with all the necessary sources could be useful I think.

@gchoqueux gchoqueux added this to the 2.xx.x milestone Jul 16, 2019
@gchoqueux
Copy link
Contributor

gchoqueux commented Jul 16, 2019

Hi,
Unfortunately, the debug tools aren't well did. We would like soon re-factorize these tools. But we are focusing on the iTowns core.

You could visit the index.html to have example.

You could simply use dat.gui :

// example dat.gui
const myColorLayer = new itowns.ColorLayer(...);
const gui = new dat.GUI();
view.addLayer(myColorLayer).then(layer =>  { 
     gui.add(layer, 'opacity', 0.0, 1.0);
});

@thomleysens
Copy link
Author

Hi,

Thanks for your quick answer.
I will manage to use these tools and keep them simple as you suggest and wait for the future(s) version(s) of these tools.
Do I have to close this issue ?

@gchoqueux
Copy link
Contributor

Do I have to close this issue ?

No, it's good to expose this issue.

@thomleysens
Copy link
Author

Ok.

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

No branches or pull requests

2 participants