![]() |
||||||||||
|
|
||||||||||
|
Digital Earth > TerravisionTM > User Guide > NS Plugin TerraVision's JavaScript InterfaceOnce you have embedded TerraVision inside of your web page, you can navigate around the terrain models that you originally loaded, but what if you want change one of the settings? For example, what if you want to load another terrain model, or jump to a specific latitude/longitude, or turn on wireframe rendering? All of this can be achieved by sending commands to the TerraVision plugin's LiveConnect API. LiveConnect provides a way to send commands from a web page into a plugin via Java or JavaScript. The Netscape plugin implements one entry function, called "cmd", which can be used to send commands to TerraVision. The format and suite of commands is exactly the same as for TerraVision's OAA interface. To begin, we must give our TerraVision plugin instance a name so that we can refer to it later in the HTML file, e.g. Then, we can refer to this instance using JavaScript calls. For example, the following HTML segment creates a button that when clicked will send the viewer back to the original viewpoint (the Origin).<EMBED TYPE="application/x-terravision" NAME="mytv" WIDTH="640" HEIGHT="480">
You can of course also write JavaScript code inside a <SCRIPT>
tag and call that later in your HTML text. For example, the following
segment shows a function for toggling a boolean value and then
hooking this up to a checkbox button for toggling wireframe rendering.
This works by sending the "set('SHOW_WIREFRAME',value)" command to
the TerraVision plugin, where value is found by looking at the
state of the checkbox.
Copyright ©2000 SRI International. All rights reserved. |
|||||||||||||||||||||||||||||||||||