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

How to obtain values from input tags #18

Open
tylersuchan opened this issue Jul 1, 2019 · 2 comments
Open

How to obtain values from input tags #18

tylersuchan opened this issue Jul 1, 2019 · 2 comments

Comments

@tylersuchan
Copy link

I am attempting to slightly modify the plugin.

In essence, I need to create some additional fields in the editor.html file. When a user enters information in those fields, I will take their responses and use them to produce a series of layers that the plugin will interpret to make a 3D Globe on the rendering screen above the inputs.

My issue is I do not know how to do this. In the codebase there is no index.html file that contains scripts that normally would be included in an index.html file. In fact, the editor.html file doesn't contain any "head" or "body" tags.

What I've tried to do is first to create a simple function in monitor.js, like so:

updateBaseURL = () => { const url = document.getElementById('wms_base_url').value; console.log(url); }

The corresponding html looks like this:
image

At the very bottom of the file, I attempted to link the module.js file to editor.js like so:

<script src="module.js"></script>

I've tried all sorts of filepaths for the src...relative file path, absolute, local. I did every combination I could think of that people would do to normally link external js files to html files. The end result is always the same whenever I type into the field I made:

image

All that I need to do is get the input that the user is typing in. Talking to a colleague of mine, he noticed that some of the other html elements in the file utilize angular. I haven't ever touched Angular so I'm unsure of the Angular way to do things, but shouldn't the default way of importing Javascript into the html file work?

For reference, here's one of the default tags located in editor.html:

image

I have no idea where ctrl.render() is located...my guess is within module.js but I haven't seen any imports or reference to a "render" besides this line in a class "GlobeCtrl" within module.js.
Am I missing something obvious, or is this something specific to Angular/the plugin itself?

/*
... Some other code
*/
 
...Farther down
  updateViewerHeight = () => {
    // Cesium needs a fixed height to correctly size its canvas
    this.viewer.container.style.height =${Math.ceil(this.height)}px;
    // Add a small delay to ensure the rectangle is correclty displayed
    window.setTimeout(() => {
      this.viewer.camera.setView({
        destination: rectangle,
      });
    }, 100);
  }
@luciotorre
Copy link
Contributor

I have no idea, but as this code was created by a contractor, you might not get a reply. Any complexity most likely arises from the use of angular.

@tylersuchan
Copy link
Author

Has anyone tried to add to the base code in the past? All I require is a means of reading user input, the code I added I can figure out myself. I'm moreso confused as to how the javascript interacts with editor.html since I don't see any <script> tags in there.

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