Hotspots and Links.



To view this content please install Java.

ADG Java Viewer has parameter ADG, which can be used to configure hotspots and links to another webpages, panoramas and 3D models. This parameter is a long string, which represents a set of ADG script commands, delimited with semicolons. Each command is composition of tag, target name and property name, delimited with dot symbol. For instance, to add two links one can use the following HTML code:

<applet id='ADGview' code='ADGview.class' width=500 height=200>
  <param name=archive value="ADGview.jar">
  <param name=data    value="autumn.adg">
  <param name=ADG     value=" 
    port.Main.link.1:=http://www.domain1.com; area= 25,0,25,20;
    port.Main.link.2:=http://www.domain2.com; area=-25,0,25,20; 
    image=advertising.jpg; 
  ">
</applet>
One more sample:
Autumn Forest
Winter Forest
Summer Forest
Demo Products


To view this content please install Java.

 
<applet id='ADGview' code='ADGview.class' width=400 height=200>
  <param name=archive value="ADGview.jar">
  <param name=data    value="autumn.adg">
  <param name=ADG     value=" 
    port.Autumn: url=autumn.adg; info=Autumn Forest;
    port.Winter: url=winter.adg; info=Winter Forest;
    port.Summer: url=summer.adg; info=Summer Forest;
    port.Demo3D: url=shoes.adg;  info=Shoes;
        
    port.Autumn.link.1:=Summer;                area= 30,0,20,20;
    port.Autumn.link.2:=Winter;                area=  5,0,20,20;
    port.Autumn.link.3:=http://www.domain.com; area=-25,0,25,20;
    image=advertising.jpg;
        
    port.Winter.link.1:=Autumn;                area=-20,0,20,20;
    port.Winter.link.2:=Summer;                area=  0,0,20,20;
    port.Winter.link.3:=http://www.domain.com; area= 20,0,20,20;
    
    port.Summer.link.1:=Winter;                area=-20,0,20,20;
    port.Summer.link.2:=Demo3D;                area=  0,0,20,20;
    port.Summer.link.3:=http://www.domain.com; area= 20,0,20,20;
    
    port.Demo3D.link.1:=Autumn; object=shoes_body;
    port.Demo3D.link.2:=Winter; object=shoes_bod2; 
  ">
</applet> 
 

In this example, first selected line specify the port named Autumn. This port is attached to panoramic image autumn.adg and has info text "Autumn Forest" be shown in status bar. Similarly, the next three lines specify another three ports. Thus first four lines specify four ports: Autumn, Winter, Summer and Demo3D.

Next lines in parameter ADG specify a set of links for each port to another port or web page. Each link require map area. Attribute area has four parameters delimited with comma: horizontal and vertical offset, and horizontal and vertical size. Parameters are estimated in degrees. The attribute image specify the icon image. The attribute object allows to specify the 3D link.

Moreover, predefined ports can be switched using Javascript commands. Typical html code in such cases looks like:

  <a href="javascript:document.ADGview.adg('current.port=Autumn')">Autumn Forest</a>

Javascript function "adg" has single string parameter, which represent a set of adg commands, delimited with semicolons. In example above, ADG script command current.port=Autumn will switch current port to Autumn.


ADG Javascript Viewer allows to view flat panoramas without Java or QTVR plugins requirement. To insert hotspots you can use javascript function setLink(x,y,w,h,url,icon,alt). See html code and demo below:

<script>
  createPanorama(500,200,"autumn.jpg"); setVel (-0.1);
  setLink( 100,0,100,100,'http://www.domain1.com','icon1.gif','text1'));
  setLink(-100,0,100,100,'http://www.domain2.com','icon2.gif','text2'));
</script>

List of script functions:

function createPanorama(width,height,url) 

  width   - sets the width  of viewer window in pixels
  height  - sets the height of viewer window in pixels
  url     - sets the url of panoramic image

function setLink(x,y,w,h,url,icon,alt)

  x,y,w,h - link rectangle 
  url     - link url
  icon    - link iconic image
  alt     - link alternative text

function setVel(vx,vy,vz) - sets initial velocity
function setPos(px,py,pz) - sets initial position